diff --git a/stdlib.asm b/stdlib.asm index ebca178..fd9e04b 100644 --- a/stdlib.asm +++ b/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)