ack/mach/i86/libem/printf.s

41 lines
427 B
ArmAsm
Raw Normal View History

1987-01-08 10:13:48 +00:00
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
1985-02-07 15:33:13 +00:00
.define printf
1987-01-08 10:13:48 +00:00
.extern printc, printd, prints
1985-02-07 15:33:13 +00:00
printf:
pop bx ! return address
xchg ax,di
mov si,sp
1:
movb al,(di)
inc di
testb al,al
jz 6f
cmpb al,'%'
je 3f
2:
call printc
jmp 1b
3:
movb al,(di)
inc di
cmpb al,'c'
jne 4f
lods
jmp 2b
4:
cmpb al,'d'
jne 5f
lods
call printd
jmp 1b
5:
cmpb al,'s'
jne 2b
lods
call prints
jmp 1b
6:
jmp bx