;; PUTUDEC.ASM--displays ax as an unsigned decimal number ;; ;; Library source text from "Assembly Language for the IBM PC Family" by ;; William B. Jones, (c) Copyright 1992, 1997, Scott/Jones Inc. ;; INCLUDE PCMAC.INC .MODEL SMALL .CODE PUBLIC PutUDec PutUDec PROC push dx push cx push bx push ax sub cx, cx ; Digit Count := 0 mov bx, 10 ; Constant for Division DigLoop: sub dx, dx ; Unsigned extension of ax div bx ; ax := dx:ax div 10; dx := remainder add dl, '0' push dx inc cx test ax, ax jne DigLoop PopLoop: pop dx _PutCh ; _PutCh without params puts dl loop PopLoop RetLab: pop ax pop bx pop cx pop dx ret PutUDec ENDP END