diff --git a/vm.md b/vm.md index cefe248..9f28924 100644 --- a/vm.md +++ b/vm.md @@ -43,32 +43,32 @@ CPU flags are addressed by bit index, going from right to left. ## Arithmetic -Arithmetic instructions store their result in the last register specified. +Arithmetic instructions store their result in the first register specified. * Add * **Params**: REG1, REG2 - * `REG2 = REG1 + REG2` + * `REG1 = REG1 + REG2` * Mul * **Params**: REG1, REG2 - * `REG2 = REG1 * REG2` + * `REG1 = REG1 * REG2` * Div * **Params**: REG1, REG2 - * `REG2 = REG1 / REG2` + * `REG1 = REG1 / REG2` * Mod * **Params**: REG1, REG2 - * `REG2 = REG1 % REG2` (exact semantics TBD) + * `REG1 = REG1 % REG2` (exact semantics TBD) * Neg * **Params**: REG1 * `REG1 = REG1 * -1` * And * **Params**: REG1, REG2 - * `REG2 = REG1 & REG2` + * `REG1 = REG1 & REG2` * Or * **Params**: REG1, REG2 - * `REG2 = REG1 | REG2` + * `REG1 = REG1 | REG2` * Xor * **Params**: REG1, REG2 - * `REG2 = REG1 ^ REG2` + * `REG1 = REG1 ^ REG2` * Shl * **Params**: REG1, REG2 * `REG1 = REG1 << REG2` @@ -124,9 +124,8 @@ Arithmetic instructions store their result in the last register specified. MEM[REG2] = REG1; ``` * StoreImm32 - * (hw = half word) - * **Params**: REG1, IMM_HW - * `REG1 = IMM_HW` + * **Params**: REG1, IMM_32 + * `REG1 = IMM_32` * MemCopy * **Params**: REG1, REG2 * `MEM[REG1] = MEM[REG2]`