summaryrefslogtreecommitdiff
path: root/twasm/asm/tests.asm
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-03-24 20:49:52 +0100
committerandromeda <andromeda@lenovo>2026-03-24 20:49:52 +0100
commit121a0df8e462babe3b6bf86bde2d900e4feea2b5 (patch)
tree53c0c5c2b20acfaf19e1e08d8cdc81f290b8b4e6 /twasm/asm/tests.asm
parent74fc57cdfc012b2d3cd621ef9dd11794dd0e5fcf (diff)
improve data structures
Diffstat (limited to 'twasm/asm/tests.asm')
-rw-r--r--twasm/asm/tests.asm49
1 files changed, 44 insertions, 5 deletions
diff --git a/twasm/asm/tests.asm b/twasm/asm/tests.asm
index bc12ecd..bc52041 100644
--- a/twasm/asm/tests.asm
+++ b/twasm/asm/tests.asm
@@ -294,32 +294,71 @@ test_get_opcode:
call print.test
mov di, 0x0053 ; xor
- mov sil, 0b
+ mov sil, 0
call get_opcode
cmp al, 0x31
jne .fail
+ cmp dl, 0q0
+ jne .fail
mov di, 0x0053 ; xor
- mov sil, 1b
+ mov sil, 1
call get_opcode
cmp al, 0x33
jne .fail
+ cmp dl, 0q0
+ jne .fail
+
+ mov di, 0x0053 ; xor
+ mov sil, 2
+ call get_opcode
+ cmp al, 0x81
+ jne .fail
+ cmp dl, 0q6
+ jne .fail
+ mov di, 0x0053 ; xor
+ mov sil, 3
+ call get_opcode
+ cmp al, 0x83
+ jne .fail
+ cmp dl, 0q6
+ jne .fail
mov di, 0x0054 ; inc
- mov sil, 0b
+ mov sil, 0
call get_opcode
cmp al, 0xFF
jne .fail
+ cmp dl, 0q0
+ jne .fail
+
+ mov di, 0x0055 ; dec
+ mov sil, 0
+ call get_opcode
+ cmp al, 0xFF
+ jne .fail
+ cmp dl, 0q1
+ jne .fail
mov di, 0x004F ; hlt
- mov sil, 0b
+ mov sil, 0
call get_opcode
cmp al, 0xF4
jne .fail
+ cmp dl, 0q0
+ jne .fail
+
+ mov di, 0x0059 ; call
+ mov sil, 0q0
+ call get_opcode
+ cmp al, 0xFF
+ jne .fail
+ cmp dl, 0q2
+ jne .fail
mov di, 0x0003 ; rdx (not an operator)
- mov sil, 0b
+ mov sil, 0q0
call get_opcode
cmp al, UNRECOGNISED_ID_OPCODE
jne .fail