about summary refs log tree commit diff stats
path: root/subx/opcodes
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-09-21 16:02:50 -0700
committerKartik Agaram <vc@akkartik.com>2018-09-21 16:03:31 -0700
commit45967d2106335dbd595cb43ae5732ba88b5d0553 (patch)
tree49b750a77571037df44967f8c14a1a8553e8205c /subx/opcodes
parentbd9f6d0cd069f3504c1825c6b25c7149c13ff57a (diff)
downloadmu-45967d2106335dbd595cb43ae5732ba88b5d0553.tar.gz
4578 - subx: implement inc/dec operations
Diffstat (limited to 'subx/opcodes')
-rw-r--r--subx/opcodes18
1 files changed, 17 insertions, 1 deletions
diff --git a/subx/opcodes b/subx/opcodes
index 77630208..41f2e65d 100644
--- a/subx/opcodes
+++ b/subx/opcodes
@@ -17,6 +17,22 @@ Opcodes currently supported by SubX:
   39: compare: set SF if rm32 < r32
   3b: compare: set SF if r32 < rm32
   3d: compare: set SF if R0 < imm32
+  40: increment R0 (EAX)
+  41: increment R1 (ECX)
+  42: increment R2 (EDX)
+  43: increment R3 (EBX)
+  44: increment R4 (ESP)
+  45: increment R5 (EBP)
+  46: increment R6 (ESI)
+  47: increment R7 (EDI)
+  48: decrement R0 (EAX)
+  49: decrement R1 (ECX)
+  4a: decrement R2 (EDX)
+  4b: decrement R3 (EBX)
+  4c: decrement R4 (ESP)
+  4d: decrement R5 (EBP)
+  4e: decrement R6 (ESI)
+  4f: decrement R7 (EDI)
   50: push R0 (EAX) to stack
   51: push R1 (ECX) to stack
   52: push R2 (EDX) to stack
@@ -63,7 +79,7 @@ Opcodes currently supported by SubX:
   eb: jump disp8 bytes away
   f4: halt
   f7: bitwise complement of rm32
-  ff: jump/push/call rm32 based on subop
+  ff: inc/dec/jump/push/call rm32 based on subop
   0f 84: jump disp16 bytes away if ZF is set
   0f 85: jump disp16 bytes away if ZF is not set
   0f 8c: jump disp16 bytes away if lesser (SF != OF)