This project is read-only.

ColdFire Studio Macro Assembler and Simulator

This is an integrated macro assembler and simulator for Freescale's ColdFire family of MCUs. Instruction set architectures A, B, and C are supported by assembler, while some B, and C instructions are simulated.
No MAC/EMAC/FPU support is presently available.


This project has been developed using Visual Studio 2012. Either full version or VS Express for Desktop is needed to build it. I have only tried building it on Windows 7 so far.

External Dependencies

If you just want to build executables and have VS 2012 installed, all you need is boost libraries.
To create help file Help/build.bat file expects to find hhc.exe compiler at "C:\Program Files (x86)\HTML Help Workshop" path. It will generate compiled HTML help file.
To build setup MSI file VS Professional may be needed, since WiX doesn't integrate itself with VS 2012 Express (as of October 2012).

Included Dependencies

Those components are included in a source control.
After creating working directory, open ColdFireStudio.sln in VS 2012, choose desired configuration, and build all projects. Debug/Release x86/x64 flavors are included.
Executables are placed in a 'bin' folder. To run they need access to two folders: 'Config' and 'Monitor'. Config contains config.ini with simulator configuration, while Monitor contains CF binary program used to control execution of user programs (assembled in CF Studio).
When starting CF Studio from VS working directory is already set to point to the solution folder.


Setup project builds x64 and x86 installers. They are found in the Setup/bin folder. Install version matching your OS: either x64-Release or x86-Release.

Creating and Assembling CF Programs

After launching CF Studio one can create their own CF programs using built-in editor and macro assembler. To learn assembler syntax consult Freescale ColdFire Programmer's Manual. Folder "Examples" contains a few short snippets of CF code that can be compiled and run.
To check program syntax, press Alt+C. To assemble it and start simulator press Alt+A.

Assembler Directives

Those are directives supported by macro assembler:
  • ALIGN [number]
  • DC.b/w/l data [, data]
  • DCB.b/w/l size, fill
  • DS.b.w.l data *[, data]
  • END [start]
  • ERROR message
  • INCLUDE file-name
  • ORG expression
  • SET expression
  • label = expression/register list
Help file describes them in detail, as well as assembler syntax.

Monitor Program

To provide some OS-like facilities CF Studio relies on a monitor program. This program (found in a "Monitor" folder) bridges your code and simulator's terminal window and helper functions. To call monitor's functions one uses TRAP #15 opcode with function code pushed onto the stack. Parameters are passed in registers. Check "Examples/Monitor.cfs" include file for a list of macros corresponding to the monitor's functions.

Available functions so far include:
  1. Terminate, Clear, PutC, GetC, PutS, GetS, PutInt, PutUInt, PutHex
  2. GetCursorX, GetCursorY, SetCursorX, SetCursorY
  3. GetTerminalWidth, GetTerminalHeight, SetTerminalWidth, SetTerminalHeight
  4. GetRTTimer, GetDateTime, GetRandomNumber, RunAsSuper, Sleep
This list shall grow as more functions will be added on "as needed" basis.

Note that monitor source code is supplied in a "Monitor/CFMonitor.cfs". To make modifications one needs to assemble it, save it (Ctrl+K) back to "Monitor/monitor.cfp" (binary code), and restart CF Studio.

Running CF Programs

After assembling your program with Alt+A simulator is ready to execute it. There are a few commands available to run simulation:
  • F5 - Run
  • F11 - Step Into
  • F10 - Step Over
  • Shift+F11 - Step Out
  • Ctrl+F11 - Step Into Exception Code
Alternatively use Ctrl+L to load binary file. [This facility is under development, and currently loads files into address 0x10000 in a simulator]


This project is in alpha state. IDE is usable but not finished yet. Expect many rough corners.

Last edited Oct 14, 2012 at 8:43 PM by mkov, version 10


No comments yet.