;; DECTOHEX.ASM--A program which requests input of a decimal number ;; from the keyboard and then prints its hexadecimal representation ;; ;; Must be linked using ;; link (or tlink) DECTOHEX,,,UTIL ;; ;; ;; Program text from "Assembly Language for the IBM PC Family" by ;; William B. Jones, (c) Copyright 1992, 1997, 2001, Scott/Jones Inc. ;; INCLUDE PCMAC.INC .MODEL SMALL .586 .STACK 100h .DATA Cr EQU 13 LF Equ 10 Message DB 'Hello , This is a line of text', CR IF, '$' Mess2 DB 'The answer is: ' Answer DB 'x' Answer2 DB 'y' Answer3 DB 'z' .CODE Hello PROC _Begin _PutStr Message mov al, Answer add al, 2 mov Answer, al mov al, Answer2 mov ah, Answer3 add ax, 1 mov Answer2, al mov Answer3, ah _PutStr Mess2 _Exit 0 Hello END END Hello