summaryrefslogtreecommitdiff
path: root/twasm/asm/tests.asm
diff options
context:
space:
mode:
Diffstat (limited to 'twasm/asm/tests.asm')
-rw-r--r--twasm/asm/tests.asm16
1 files changed, 16 insertions, 0 deletions
diff --git a/twasm/asm/tests.asm b/twasm/asm/tests.asm
index 23e0178..bc12ecd 100644
--- a/twasm/asm/tests.asm
+++ b/twasm/asm/tests.asm
@@ -251,6 +251,11 @@ test_get_tte_typed_metadata:
cmp al, 0x02 ; # operands
jne .fail
+ mov di, 0x004F ; hlt
+ call get_tte_typed_metadata
+ cmp al, 0x00 ; # operands
+ jne .fail
+
mov di, 0x0003 ; rdx
call get_tte_typed_metadata
cmp al, 00001011b ; reg: 010b
@@ -289,21 +294,32 @@ test_get_opcode:
call print.test
mov di, 0x0053 ; xor
+ mov sil, 0b
call get_opcode
cmp al, 0x31
jne .fail
+ mov di, 0x0053 ; xor
+ mov sil, 1b
+ call get_opcode
+ cmp al, 0x33
+ jne .fail
+
+
mov di, 0x0054 ; inc
+ mov sil, 0b
call get_opcode
cmp al, 0xFF
jne .fail
mov di, 0x004F ; hlt
+ mov sil, 0b
call get_opcode
cmp al, 0xF4
jne .fail
mov di, 0x0003 ; rdx (not an operator)
+ mov sil, 0b
call get_opcode
cmp al, UNRECOGNISED_ID_OPCODE
jne .fail