Implement atoll() function.
This is just a small wrapper around strtoll().
This commit is contained in:
parent
f9d7017687
commit
52c011ab48
29
stdlib.asm
29
stdlib.asm
|
@ -276,6 +276,35 @@ atol entry
|
||||||
rtl
|
rtl
|
||||||
end
|
end
|
||||||
|
|
||||||
|
****************************************************************
|
||||||
|
*
|
||||||
|
* atoll - convert a string to a long long
|
||||||
|
*
|
||||||
|
* Inputs:
|
||||||
|
* str - pointer to the string
|
||||||
|
*
|
||||||
|
* Outputs:
|
||||||
|
* converted number
|
||||||
|
*
|
||||||
|
****************************************************************
|
||||||
|
*
|
||||||
|
atoll start
|
||||||
|
|
||||||
|
ph2 #10 base 10
|
||||||
|
ph4 #0 no pointer returned
|
||||||
|
lda 12,S pass the string addr on
|
||||||
|
pha
|
||||||
|
lda 12,S
|
||||||
|
pha note: x reg is unchanged
|
||||||
|
jsl strtoll convert the string
|
||||||
|
lda 2,S fix the stack
|
||||||
|
sta 6,S
|
||||||
|
pla
|
||||||
|
sta 3,S
|
||||||
|
pla
|
||||||
|
rtl
|
||||||
|
end
|
||||||
|
|
||||||
****************************************************************
|
****************************************************************
|
||||||
*
|
*
|
||||||
* char *bsearch(key, base, count, size, compar)
|
* char *bsearch(key, base, count, size, compar)
|
||||||
|
|
Loading…
Reference in New Issue