ack/mach/i86/libem/print.s

48 lines
501 B
ArmAsm
Raw Permalink 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
1991-09-02 15:46:16 +00:00
call __write
1987-06-10 14:52:39 +00:00
pop bx
pop bx
pop bx
pop bx
1985-02-07 15:33:13 +00:00
ret