mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2025-02-07 04:30:31 +00:00
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
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user