1.3 KiB
1.3 KiB
Op Layout
The first three bits are the category, the next four are the op, the last one is whether or not the op should operate on two bytes (1 for 2byte/16bit, 0 for 1byte/8bit)
[ 000 0000 0 ]
| \/ |
Cat Op 2byte
- memory - 000
- set - 000
- get - 001
- sei - 010 - set indirect (use a pointer stores elswhere)
- gei - 011
- .
- .
- .
- stack - 001
- psh - 000
- pop - 001
- ovr - 010
- swp - 011
- rot - 100
- dup - 101
- .
- math - 010
- add - 000
- sub - 001
- mul - 010
- div - 011
- inc - 100
- dec - 101
- .
- bits - 011
- and - 000
- bor - 001 (bitwise or)
- xor - 010
- not - 011
- shr - 100
- shl - 101
- eql - 111
- jump - 100
- jmp - 000
- sub - 001
- jcd - 010
- ret - 011
- .
- .
- .
- sys - 101
- gch - 000
- gst - 001
- pch - 010
- pst - 011
- hlt - 100
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- dev - 111
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
Memory Layout
var memory = [MAX_uint16]byte{}