ack/mach/i386/libem/print.s

48 lines
532 B
ArmAsm
Raw Normal View History

1989-01-19 16:43:32 +00:00
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define printc,printd,prints
! argument in eax
! uses ebx
prints:
xchg eax,ebx
1:
movb al,(ebx)
inc ebx
testb al,al
jz 2f
call printc
jmp 1b
2:
ret
! argument in eax
! uses ecx and edx
printd:
xor edx,edx
mov ecx,10
div ecx
test eax,eax
jz 1f
push edx
call printd
pop edx
1:
xchg eax,edx
addb al,'0'
! argument in eax
printc:
push eax
mov ebx,esp
mov eax,1
push eax
push ebx
push eax
1991-09-02 15:08:48 +00:00
call __write
1989-01-19 16:43:32 +00:00
pop ebx
pop ebx
pop ebx
pop ebx
ret