COSIM Computer Organization Simulator
program.asm

COSIM help

COSIM runs the generic RISC-style assembly language of Hamacher et al., Computer Organization and Embedded Systems (Chapters 2–3), with the Chapter 3 I/O devices, a Chapter 5 datapath view, a Chapter 6 pipeline model and a Chapter 8 cache model.

Open the simulator manual (instruction set, directives, memory map, devices, interrupts, pipeline and cache models).

Other instruction sets: choose a target in the menu at the top left (or open index.html?target=<id>).

Keyboard shortcuts

Ctrl+EnterAssemble and load
F10Step one instruction
Shift+F10Step back
F5Run / continue
F6 or EscPause
Shift+F5Reset
F9Toggle breakpoint on the cursor line (or click the line number)
Ctrl+S / Ctrl+OSave / open an .asm file
Tab / Shift+TabIndent / outdent (in the editor)
Alt+1…9Switch tab
?This help (outside the editor)

Tips

  • The highlighted line is the next instruction to execute (the one PC points to).
  • Your program is saved automatically in this browser, separately for each example and task.
  • Programs that poll the keyboard pause while waiting for input: type in the terminal on the I/O board.
  • Click a register or memory word to change its value.
  • Run settings can be embedded in a program: ; @cosim input="Hi\n" displayDelay=5.