A2osX/SYS/KERNEL.S.STDLIB.txt
2017-08-23 17:05:29 +02:00

64 lines
1004 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

PR#3
PREFIX /A2OSX.BUILD
LOMEM $A00
INC 1
AUTO 6
*/--------------------------------------
* # AToI
* Convert String to 32 bit int
* ## In:
* PUSHW PTR to target buffer DWORD
* PUSHW Source String (PSTR)
* ## Out:
*\--------------------------------------
K.AToI jsr PullPtr1Ptr2 PSTR in Ptr1,buffer in Ptr2
stz ASCBUF
ldx #0
lda (ZPPtr1)
beq .2
ldy #0
.1 iny
lda (ZPPtr1),y
cmp #'0'
bcc .2
cmp #'9'+1
bcs .2
inx
sta ASCBUF,x
cpx #10
beq .2
tya
cmp (ZPPtr1)
bne .1
.2 stx ASCBUF
jsr DEC2HEX
ldy #3
.3 lda HEXBUF,y
sta (ZPPtr2),y
dey
bpl .3
clc
rts
*--------------------------------------
TYPES .AS "-dbclssp"
ACCESS .AS "rwxrwxrwx"
SIGN .BS 1
PADLEN .BS 1
PADCHAR .BS 1
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.STDLIB
LOAD /A2OSX.SRC/SYS/KERNEL.S
ASM