INCLUDE a:\masm\include\PCMAC.INC .MODEL SMALL .STACK 0h .DATA Msg1 DB 'Please enter a decimal number (<=32767) > $' Msg2 DB ' => $' SaveAX DW ? .CODE EXTRN GetDec : NEAR, PutDec : NEAR, PutHex : NEAR, PutBin : NEAR, PutUDec : NEAR DecToHex PROC mov ax, @data mov ds, ax _PutStr Msg1 call GetDec mov SaveAX, ax call PutDec _PutStr Msg2 mov ax, SaveAX call PutUDec _PutStr Msg2 mov ax, SaveAX call PutHex _PutCh 'h' _PutStr Msg2 mov ax, SaveAX call PutBin _PutCh 13, 10 _Exit 0 DecToHex ENDP END DecToHex