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, 14 insertions, 2 deletions
diff --git a/twasm/asm/tests.asm b/twasm/asm/tests.asm
index 10c80ad..bc2ad84 100644
--- a/twasm/asm/tests.asm
+++ b/twasm/asm/tests.asm
@@ -341,7 +341,7 @@ test_evaluate_constant:
cmp rdx, 0x00
jne .fail
- ; PI
+ ; PI x
mov rdi, .case3h ; addr of constant
mov rsi, 18 ; length of constant
call evaluate_constant
@@ -350,7 +350,7 @@ test_evaluate_constant:
cmp rdx, 0x00
jne .fail
- ; PI
+ ; PI q
mov rdi, .case0q
mov rsi, 16
call evaluate_constant
@@ -359,6 +359,15 @@ test_evaluate_constant:
cmp rdx, 0x01
jne .fail
+ ; PI b
+ mov rdi, .case0b
+ mov rsi, 66
+ call evaluate_constant
+ cmp rax, [.case0b_solution]
+ jne .fail
+ cmp rdx, 0x02
+ jne .fail
+
.pass:
mov rsi, msg_pass
call print
@@ -380,6 +389,9 @@ test_evaluate_constant:
.case0q db "0q31103755242102"
.case0q_solution dq 0q31103755242102
+ .case0b db "0b0110011001101001011100100111001101110100001000000011011000110100"
+ .case0b_solution dq 0b0110011001101001011100100111001101110100001000000011011000110100
+
msg_pass:
db 0x0A
times (TEST_LINE_LENGTH + .start - .end) db " ", ; right align