Romasm Source Code
Output
Ready to run...
Registers
Memory
Quick Reference
Instructions
| Instruction | Description | Example |
|---|---|---|
| LOAD | Load value into register | LOAD R0, 10 |
| STORE | Store register to memory | STORE R0, [100] |
| ADD | Add two registers | ADD R0, R1 |
| SUB | Subtract two registers | SUB R0, R1 |
| MUL | Multiply two registers | MUL R0, R1 |
| DIV | Divide two registers | DIV R0, R1 |
| MOD | Modulo (remainder) | MOD R0, R1 |
| CMP | Compare two registers | CMP R0, R1 |
| SHL | Shift left (multiply by 2^n) | SHL R0, R1 |
| SHR | Shift right (divide by 2^n) | SHR R0, R1 |
| JMP | Jump to label | JMP loop |
| JEQ | Jump if equal | JEQ done |
| Print register value | PRINT R0 |
Registers
R0 through R8 (mapped to Roman numerals I through IX)
Labels: Use labels for jumps:
loop:
INC R0
JMP loop