Skip to content

Emulator

wild-pointer27 edited this page Aug 2, 2026 · 1 revision

Emulator

The emulator gives the ability to run .mcm programs. It can execute programs at your machine's clock speed or, if necessary, launch a simple command line interface to manipulate the CPU internals and have a better look at how it works.

Once the emulator is running, it will produce an output similar to this:

==General info==
Instruction 0x0008, value: 0x02d00800
Instruction fields:
Next address: 0x000b
Bus A: 0x0002    Bus B: 0x0000   Bus C: 0x0000
ALU: 0x0000     Shift: 0x0000   rwf: 0x0
==Registers==
A: 0x0000       B: 0x0000       C: 0xa7c7
D: 0x0000       TC: 0x0000      TB: 0x0000
PC: 0x0000      MDR: 0x0000     MAR: 0x0001
==RAM==
|0xfffc|0xfffd|0xfffe|0xffff|0x0000|0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|
---------------------------------------^--------------------------------------
|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|

Where it can be seen how every value changes in real time.

To stop the emulator from running, simply press: ctrl + c.

Command line

To launch a program with the command line interface, you need to add the -cmd flag at the end.

==General info==
Instruction 0x0000, value: 0x00000004
Instruction fields:
Next address: 0x0000
Bus A: 0x0000    Bus B: 0x0000   Bus C: 0x0000
ALU: 0x0000     Shift: 0x0000   rwf: 0x4
==Registers==
A: 0x0000       B: 0x0000       C: 0x0000
D: 0x0000       TC: 0x0000      TB: 0x0000
PC: 0x0000      MDR: 0x0000     MAR: 0x0000
==RAM==
|0xfffb|0xfffc|0xfffd|0xfffe|0xffff|0x0000|0x0001|0x0002|0x0003|0x0004|0x0005|
---------------------------------------^--------------------------------------
|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|0x0000|

>: 

After the cursor appears, commands can be typed.

Command list

  • next or n: Executes the next operation
  • run or r: Continues code execution
  • quit or q: Quits the program
  • setreg <REG> <hex value>: Sets the value of a register
  • setmem <hex address> <hex value>: Sets the value of a memory address
  • setdelay <delay>: Sets a delay in milliseconds between the execution of each instruction
  • getdelay: Displays the current delay

All register names must be in caps. The command line also accepts hex values typed in any of these ways: Various syntaxes to insert the number 0x000f:

  • f
  • 0xf
  • 000f
  • 0x000f

Running micro-programs

To run micro-programs, type: ./microglossum -run programname.mcm. If necessary, add the -cmd flag.


Go back home

Clone this wiki locally