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