DOSSEG ; A Assembler program that does something ; Author: ; Purpose: ;Data section .model huge .stack 100h .586 .data greeting db "Enter a single digit",13,10,'$' bye db "Bye - this program is done",13,10,"$" len db 10 newlen db 0 block db 20 dup (" ") line1 db "The ASCII is " out1 db 5 dup (" "),13,10,"$" line2 db "Numeric equivalent and result " out2 db 60 dup (" "),13,10,"$" .code ; Here is the code start: mov ax,@data ; Address the data mov ds,ax mov es,ax ; Announce self mov ah,9 lea dx, greeting int 21h ; Read a line in mov ah,10 lea dx,len int 21h ; Get the byte mov al,block cbw cwde ; call lea ebx,out1 call int_to_str push eax mov ah,9 lea dx,line1 int 21h pop eax ; call 2 and al,0fh lea ebx,out2 call int_to_str ; double and convert inc ebx shl eax,4 inc eax call int_to_str neg eax inc ebx call int_to_str neg ax inc ebx call int_to_str mov ah,9 lea dx,line2 int 21h ; Bye bye mov ah,9 lea dx,bye int 21h mov ax,4c00h ; Leave the program int 21h ; Any subroutines would go here include int2str.asm ; Last line of assembly is end end