;; PutDec--Display the contents of ax as a decimal number ;; ;; Input: ;; ax = the number to be displayed ;; ;; Output: ;; The displayed number ;; ;; Errors: none ;; ;; 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 .DATA Buffer DB 7 DUP (?) .CODE PUBLIC PutDec EXTRN Bin2Dec : NEAR PutDec PROC push ds push ax push dx push di mov di, @data mov ds, di ASSUME ds: @data mov di, OFFSET Buffer call Bin2Dec ; Compute output string mov BYTE PTR [di], '$' ; Terminate output string _PutStr Buffer ; Display output string pop di pop dx pop ax pop ds ret PutDec ENDP END