forked from TCShenanigans/symphony_stdlib
Fix binary parsing and more tests
This commit is contained in:
+2
-2
@@ -77,7 +77,7 @@ atoi_bin_loop:
|
||||
load_8 r3, [r2]
|
||||
cmp r3, 0x30 ; '0'
|
||||
jl atoi_done
|
||||
cmp r3, 0x39 ; '1'
|
||||
cmp r3, 0x31 ; '1'
|
||||
jg atoi_done
|
||||
add r2, r2, 1
|
||||
sub r3, r3, 0x30 ; '0'
|
||||
@@ -143,4 +143,4 @@ add r2, r2, 1
|
||||
sub r3, r3, 0x37 ; 'A' - 10
|
||||
lsl r1, r1, 4
|
||||
add r1, r1, r3
|
||||
jmp atoi_hex_loop
|
||||
jmp atoi_hex_loop
|
||||
|
||||
@@ -47,6 +47,20 @@ mov r13, test7_pass
|
||||
jmp atoi_test
|
||||
test7_pass:
|
||||
|
||||
mov r1, 8
|
||||
mov r2, test8
|
||||
mov r3, test8_end
|
||||
mov r13, test8_pass
|
||||
jmp atoi_test
|
||||
test8_pass:
|
||||
|
||||
mov r1, 9
|
||||
mov r2, test9
|
||||
mov r3, test9_end
|
||||
mov r13, test9_pass
|
||||
jmp atoi_test
|
||||
test9_pass:
|
||||
|
||||
success:
|
||||
jmp success
|
||||
|
||||
@@ -103,5 +117,10 @@ test6_end: "\0"
|
||||
test7: U32 19 "023"
|
||||
test7_end: "9\0"
|
||||
|
||||
test8: U32 11 "0b1011"
|
||||
test8_end: "\0"
|
||||
|
||||
test9: U32 17 "0b10001"
|
||||
test9_end: "2\0"
|
||||
|
||||
include stdlib
|
||||
|
||||
Reference in New Issue
Block a user