home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
progjour
/
1991
/
06
/
alib
/
put_uns.asm
< prev
next >
Wrap
Assembly Source File
|
1991-08-21
|
463b
|
35 lines
title put_unsigned
include asm.inc
public put_unsigned
.code
extn putchar
;; put unsigned
;
; entry AX number
; uses AX
;
put_unsigned proc
pushm cx,dx
mov cx,10
mov dx,-1 ; push sentinal
pus1: push dx
mov dx,0
div cx ; divide digits
cmp ax,0
jne pus1
inc dx
pus2: xchg ax,dx ; write digits
add al,'0'-1
call putchar
pop dx
inc dx
jnz pus2 ; if not sentinal
popm dx,cx
ret
put_unsigned endp
end