Write a program in assembly language TASM only when user ent
Write a program in assembly language TASM only
when user enters A
D get displayed
when user enters B
E gets displayed
when user enters C
F gets displayed
write program for these 3 instructions only
Please i need code in TASM
Write a program in assembly language TASM only
when user enters A
D get displayed
when user enters B
E gets displayed
when user enters C
F gets displayed
write program for these 3 instructions only
Please i need code in TASM
when user enters A
D get displayed
when user enters B
E gets displayed
when user enters C
F gets displayed
write program for these 3 instructions only
Please i need code in TASM
Solution
stack segment
stack ends
data segment
msg1 db \'please enter A, B or C only $\'
data ends
printmsg macro msg
lea dx,msg
mov ah,09h
int 21h
endm
code segment
assume cs:code,ds:data,ss:stack
start:
mov ax,data
mov ds,ax
main proc
mov ah, 1 ; get user input
int 21h
mov bl, al ; save input to bl
cmp bl,\'A\'
jne nota
mov ah,2
mov dl,\'D\'
int 21h
nota:
cmp bl,\'B\'
jne notb
mov ah,2
mov dl,\'E\'
int 21h
notb:
cmp bl,\'C\'
jne notc
mov ah,2
mov dl,\'F\'
int 21h
notc:
printmsg msg1
mov ah,4ch ; return control to dos
int 21h
main endp
code ends
end start

