Enter new code:
8917 Microcontroller Simulator
Output:
Instructions:
1 Byte instructions
- 0 = Halt
- 1 = Add (R0 = R0 + R1)
- 2 = Subtract (R0 = R0 - R1)
- 3 = Increment R0 (R0 = R0 + 1)
- 4 = Increment R1 (R1 = R1 + 1)
- 5 = Decrement R0 (R0 = R0 - 1)
- 6 = Decrement R1 (R1 = R1 - 1)
- 7 = Ring Bell
2 Byte Instructions
value of the second byte is called <data>
- 8 = Print <data> (The nemerical value of <data> is printed)
- 9 = Load value at address <data> into R0
- 10 = Load value at address <data> into R1
- 11 = Store R0 into address <data>
- 12 = Store R1 into address <data>
- 13 = Jump to address <data>
- 14 = Jump to address <data> if R0 == 0
- 15 = Jump to address <data> if R0 != 0
- 24 = Print ASCII <data>
Start UP
- All registers are set to 0
- All memoty locations are set to 0
- The program is read into memory. The first instruction into address 0, and so on
- the fetch-execute cycle begins
Fetch-Execute Cycle
- The instruction at the address given by IP is loaded into IS
- The IP is increment by 1 (is IS contains a one byte instruction) or by 2 (if IS contains a 2 byte instruction)
- The instruction in IS is executed
- Repeat until IS = HALT
- If the instruction is not in the above table, then the results will be undefinded behavior