home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
program
/
compiler
/
nasm20b
/
nasm_src
/
lib
/
src
/
atoi.s65
< prev
next >
Wrap
Text File
|
1993-01-19
|
533b
|
29 lines
.include #16bit
.zext _string1
.zext _value
; --------------------------------------------------------------
; This is just like ATOU but also converts the sign, if it
; exists _string1 will point to the string after the sign
; --------------------------------------------------------------
atoi:
ldy #0
lda (_string1),y
cmp #'+
beq :plus
cmp #'-
beq :minus
jmp atou
:plus
inc.w _string1
jmp atou
:minus
inc.w _string1
jsr atou
neg.w _value
rts