Thursday 23 April 2009

Getting an Input from Keyboard and Displaying it

;8086 program to get an Input from Keyboard and Displaying it

data segment
msg db "Enter a character: $"
msg1 db 0dh,0ah, "The Entered character is:$"
data ends
print macro msg
lea dx,msg
mov ah,09h
int 21h
endm
read macro
mov ah,01h
int 21h
endm
display macro
mov ah,02h
int 21h
endm
code segment
start:
mov ax,data
mov ds,ax
print msg
read
mov bl,al
print msg1
mov dl,bl
display
mov ah,4ch
int 21h
code ends
end start

;Program Ends Here

querrymail@gmail.com

0 comments: