2 ; int vsprintf (char* Buf, const char* Format, va_list ap);
4 ; Ullrich von Bassewitz, 2009-09-26
8 .import ldax0sp, pushax, staxysp
12 ; ----------------------------------------------------------------------------
13 ; vsprintf - formatted output into a buffer
15 ; int vsprintf (char* buf, const char* format, va_list ap);
20 pha ; Save low byte of ap
22 pha ; Save high byte of op
24 ; Build a stackframe for vsnprintf. To do that, we move format one word down,
25 ; and store 0x7FF (INT_MAX) as size.
27 jsr ldax0sp ; Get format
28 jsr pushax ; And push it
34 ; Retrieve ap and contine by jumping to _vsnprintf, which will cleanup the stack