ack/mach/i86/libem/print.s

48 lines
500 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 printc,printd,prints
! argument in ax
! uses bx
prints:
xchg ax,bx
1:
movb al,(bx)
inc bx
testb al,al
jz 2f
call printc
jmp 1b
2:
ret
! argument in ax
! uses cx and dx
printd:
xor dx,dx
mov cx,10
div cx
test ax,ax
jz 1f
push dx
call printd
pop dx
1:
xchg ax,dx
addb al,'0'
! argument in ax
printc:
push ax
1987-06-10 14:52:39 +00:00
mov bx,sp
mov ax,1
push ax
push bx
push ax
call _write
pop bx
pop bx
pop bx
pop bx
1985-02-07 15:33:13 +00:00
ret