31
4.3 Standard I/O Function Interface Printf
Use "%%" to specify a "%" character as an output character rather than as a control specifier.
The printf function outputs characters using putchar.
The printf function uses approximately 80 bytes of stack as a work area (excluding the
arguments and stack used by putchar).
[Examples]
❍ Assembler interface
#include scdef.inc
.import_printf
string .data.b"data=%02X",10,0
mov a,dtb
pushw a
movl a,#string
pushw ah
pushw a
callp _printf
addsp #6
: :
❍ C interface
#include "scdef.h"
prog()
{
int c ;
printf("data=%d\n",data);
: :
}
Control
Character
Type
d Signed decimal
u Unsigned decimal
oOctal
x Hexadecimal (lower case letters)
X Hexadecimal (upper case letters)
cCharacter
s Character string