cups-bytecode-interpreter.nv
· 1.4 KiB · Text
Sin formato
Playground
|move instruction pointer|
@instruction pointer
|fetch next instruction|
@decode instruction
|@current instruction is halt|
|@current instruction is inc|
, @increment source register
, @check if port was triggered
, move instruction pointer:2
, fetch next instruction
|@current instruction is dec|
, @decrement source register
, move instruction pointer:2
, fetch next instruction
|@current instruction is cpy|
, @copy source register to destination register
, @check if port was triggered
, move instruction pointer:3
, fetch next instruction
|@current instruction is mov|
, @copy source register to destination register
, @check if port was triggered
, move instruction pointer:3
, fetch next instruction
|@current instruction is jze|
, @check source register is zero
, move to next instruction for jze
|move to next instruction for jze, @soure register is zero|
, @copy next bytecode to instruction pointer
|move to next instruction for jze|
, move instruction pointer:3
, fetch next instruction
|@current instruction is jmp|
, @copy next bytecode to instruction pointer
|@current instruction is set|
, @set destination register to next bytecode
, move instruction pointer:3
, fetch next instruction
|@current instruction is unknown|
, move instruction pointer
, fetch next instruction
| 1 | |move instruction pointer| |
| 2 | @instruction pointer |
| 3 | |
| 4 | |fetch next instruction| |
| 5 | @decode instruction |
| 6 | |
| 7 | |@current instruction is halt| |
| 8 | |
| 9 | |@current instruction is inc| |
| 10 | , @increment source register |
| 11 | , @check if port was triggered |
| 12 | , move instruction pointer:2 |
| 13 | , fetch next instruction |
| 14 | |
| 15 | |@current instruction is dec| |
| 16 | , @decrement source register |
| 17 | , move instruction pointer:2 |
| 18 | , fetch next instruction |
| 19 | |
| 20 | |@current instruction is cpy| |
| 21 | , @copy source register to destination register |
| 22 | , @check if port was triggered |
| 23 | , move instruction pointer:3 |
| 24 | , fetch next instruction |
| 25 | |
| 26 | |@current instruction is mov| |
| 27 | , @copy source register to destination register |
| 28 | , @check if port was triggered |
| 29 | , move instruction pointer:3 |
| 30 | , fetch next instruction |
| 31 | |
| 32 | |@current instruction is jze| |
| 33 | , @check source register is zero |
| 34 | , move to next instruction for jze |
| 35 | |
| 36 | |move to next instruction for jze, @soure register is zero| |
| 37 | , @copy next bytecode to instruction pointer |
| 38 | |
| 39 | |move to next instruction for jze| |
| 40 | , move instruction pointer:3 |
| 41 | , fetch next instruction |
| 42 | |
| 43 | |@current instruction is jmp| |
| 44 | , @copy next bytecode to instruction pointer |
| 45 | |
| 46 | |@current instruction is set| |
| 47 | , @set destination register to next bytecode |
| 48 | , move instruction pointer:3 |
| 49 | , fetch next instruction |
| 50 | |
| 51 | |@current instruction is unknown| |
| 52 | , move instruction pointer |
| 53 | , fetch next instruction |