1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-10 19:29:45 +00:00

Make _printf() __fastcall__

git-svn-id: svn://svn.cc65.org/cc65/trunk@507 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-12-01 10:21:18 +00:00
parent 88fc6399db
commit 27f600e986
3 changed files with 12 additions and 11 deletions

View File

@ -34,7 +34,7 @@ struct outdesc {
/* Internal formatting routine */
int _printf (struct outdesc* d, const char* format, va_list ap);
int __fastcall__ _printf (struct outdesc* d, const char* format, va_list ap);

View File

@ -241,16 +241,17 @@ __printf:
; Save the register bank variables into the save area
ldx #5
Save: lda regbank,x
sta RegSave,x
dex
pha ; Save low byte of ap
ldy #5
Save: lda regbank,y
sta RegSave,y
dey
bpl Save
; Get the parameters from the stack
jsr popax ; Argument list pointer
sta ArgList
pla ; Restore low byte of ap
sta ArgList ; Argument list pointer
stx ArgList+1
jsr popax ; Format string

View File

@ -60,15 +60,15 @@ _printf:
lda (ptr1),y
jsr pushax
; Push the va_list
; Push va_list (last parameter to vfprintf)
lda ptr1
ldx ptr1+1
lda ptr1
ldx ptr1+1
jsr pushax
; Call vfprintf
jsr _vfprintf
jsr _vfprintf
; Cleanup the stack. We will return what we got from vfprintf