add octal
This commit is contained in:
@@ -315,41 +315,50 @@ test_evaluate_constant:
|
||||
call print.test
|
||||
|
||||
; just numerals
|
||||
mov rdi, .case0 ; addr of constant
|
||||
mov rsi, 8 ; length of constant
|
||||
mov rdi, .case0h ; addr of constant
|
||||
mov rsi, 8 ; length of constant
|
||||
call evaluate_constant
|
||||
cmp rax, [.case0_solution]
|
||||
cmp rax, [.case0h_solution]
|
||||
jne .fail
|
||||
cmp rdx, 0x00
|
||||
jne .fail
|
||||
|
||||
; just chars
|
||||
mov rdi, .case1 ; addr of constant
|
||||
mov rsi, 8 ; length of constant
|
||||
mov rdi, .case1h ; addr of constant
|
||||
mov rsi, 8 ; length of constant
|
||||
call evaluate_constant
|
||||
cmp rax, [.case1_solution]
|
||||
cmp rax, [.case1h_solution]
|
||||
jne .fail
|
||||
cmp rdx, 0x00
|
||||
jne .fail
|
||||
|
||||
; just chars
|
||||
mov rdi, .case2 ; addr of constant
|
||||
mov rsi, 12 ; length of constant
|
||||
mov rdi, .case2h ; addr of constant
|
||||
mov rsi, 12 ; length of constant
|
||||
call evaluate_constant
|
||||
cmp rax, [.case2_solution]
|
||||
cmp rax, [.case2h_solution]
|
||||
jne .fail
|
||||
cmp rdx, 0x00
|
||||
jne .fail
|
||||
|
||||
; PI
|
||||
mov rdi, .case3 ; addr of constant
|
||||
mov rsi, 18 ; length of constant
|
||||
mov rdi, .case3h ; addr of constant
|
||||
mov rsi, 18 ; length of constant
|
||||
call evaluate_constant
|
||||
cmp rax, [.case3_solution]
|
||||
cmp rax, [.case3h_solution]
|
||||
jne .fail
|
||||
cmp rdx, 0x00
|
||||
jne .fail
|
||||
|
||||
; PI
|
||||
mov rdi, .case0q
|
||||
mov rsi, 16
|
||||
call evaluate_constant
|
||||
cmp rax, [.case0q_solution]
|
||||
jne .fail
|
||||
cmp rdx, 0x01
|
||||
jne .fail
|
||||
|
||||
.pass:
|
||||
mov rsi, msg_pass
|
||||
call print
|
||||
@@ -359,14 +368,17 @@ test_evaluate_constant:
|
||||
call print
|
||||
ret
|
||||
.msg db "test_evaluate_constant...", 0x00
|
||||
.case0 db "0x012390"
|
||||
.case0_solution dq 0x012390
|
||||
.case1 db "0xABCDEF"
|
||||
.case1_solution dq 0xABCDEF
|
||||
.case2 db "0x1234567890"
|
||||
.case2_solution dq 0x1234567890
|
||||
.case3 db "0x243F6A8885A308D3"
|
||||
.case3_solution dq 0x243F6A8885A308D3
|
||||
.case0h db "0x012390"
|
||||
.case0h_solution dq 0x012390
|
||||
.case1h db "0xABCDEF"
|
||||
.case1h_solution dq 0xABCDEF
|
||||
.case2h db "0x1234567890"
|
||||
.case2h_solution dq 0x1234567890
|
||||
.case3h db "0x243F6A8885A308D3"
|
||||
.case3h_solution dq 0x243F6A8885A308D3
|
||||
|
||||
.case0q db "0q31103755242102"
|
||||
.case0q_solution dq 0q31103755242102
|
||||
|
||||
msg_pass:
|
||||
db 0x0A
|
||||
|
||||
Reference in New Issue
Block a user