Add more great ideas to the VM spec
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
6
vm.md
6
vm.md
@@ -41,6 +41,11 @@ CPU flags are addressed by bit index, going from right to left.
|
|||||||
* Overwriting a register without its value being used
|
* Overwriting a register without its value being used
|
||||||
* Mixing arithmetic with bit twiddling on the same target
|
* Mixing arithmetic with bit twiddling on the same target
|
||||||
|
|
||||||
|
## Register ideas
|
||||||
|
|
||||||
|
* NULL - a register that will always be zero for reading and will not change after writing.
|
||||||
|
* Other possible names: Z, NIL
|
||||||
|
|
||||||
# Instructions
|
# Instructions
|
||||||
|
|
||||||
## Arithmetic
|
## Arithmetic
|
||||||
@@ -48,7 +53,6 @@ CPU flags are addressed by bit index, going from right to left.
|
|||||||
Arithmetic instructions store their result in the first register specified. Overflow is handled by
|
Arithmetic instructions store their result in the first register specified. Overflow is handled by
|
||||||
wrapping around to 0.
|
wrapping around to 0.
|
||||||
|
|
||||||
|
|
||||||
* Add
|
* Add
|
||||||
* **Params**: REG1, REG2
|
* **Params**: REG1, REG2
|
||||||
* `REG1 = REG1 + REG2`
|
* `REG1 = REG1 + REG2`
|
||||||
|
|||||||
Reference in New Issue
Block a user