home *** CD-ROM | disk | FTP | other *** search
- 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
-