numbers!
This commit is contained in:
parent
8c7f2f4a58
commit
b5735552e2
1 changed files with 34 additions and 7 deletions
41
03/in02
41
03/in02
|
@ -7,10 +7,10 @@ cl
|
||||||
jm
|
jm
|
||||||
:-ex
|
:-ex
|
||||||
::TE
|
::TE
|
||||||
'd
|
'e
|
||||||
'1
|
'1
|
||||||
'2
|
'f
|
||||||
'6
|
'c
|
||||||
\n
|
\n
|
||||||
// open input file
|
// open input file
|
||||||
im
|
im
|
||||||
|
@ -246,8 +246,18 @@ jm
|
||||||
::d$
|
::d$
|
||||||
AJ
|
AJ
|
||||||
re return
|
re return
|
||||||
// convert ASCII hex digit in rbx to number in rax.
|
::#x
|
||||||
::hx
|
zA
|
||||||
|
JA use rdi to store number
|
||||||
|
::xL hexadecimal loop
|
||||||
|
BI
|
||||||
|
zA
|
||||||
|
lb
|
||||||
|
BA
|
||||||
|
im
|
||||||
|
##a.
|
||||||
|
je
|
||||||
|
:-x$ newline reached
|
||||||
im
|
im
|
||||||
##30. compare with ascii '0'
|
##30. compare with ascii '0'
|
||||||
jg
|
jg
|
||||||
|
@ -273,7 +283,24 @@ im
|
||||||
##ffffffffffffffa9. -87 (10 - 'a')
|
##ffffffffffffffa9. -87 (10 - 'a')
|
||||||
::hX
|
::hX
|
||||||
+B
|
+B
|
||||||
re // return
|
BA
|
||||||
|
// digit's numerical value now in rbx
|
||||||
|
AJ
|
||||||
|
<I
|
||||||
|
04
|
||||||
|
+B add digit
|
||||||
|
JA store away
|
||||||
|
// increment rsi
|
||||||
|
BI
|
||||||
|
im
|
||||||
|
##1.
|
||||||
|
+B
|
||||||
|
IA
|
||||||
|
jm
|
||||||
|
:-xL
|
||||||
|
::x$
|
||||||
|
AJ
|
||||||
|
re return
|
||||||
// bad number
|
// bad number
|
||||||
::bn
|
::bn
|
||||||
im
|
im
|
||||||
|
@ -283,7 +310,7 @@ im
|
||||||
--BN error message
|
--BN error message
|
||||||
IA
|
IA
|
||||||
im
|
im
|
||||||
##a. length of error message
|
##b. length of error message
|
||||||
DA
|
DA
|
||||||
im
|
im
|
||||||
##1. write
|
##1. write
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue