MODEL smal STACK 100h DATA TimePromt DB Is it after 12 noon (Y/N)?$ GoodMorningM
ID: 3732875 • Letter: M
Question
MODEL smal STACK 100h DATA TimePromt DB Is it after 12 noon (Y/N)?$ GoodMorningMessage DB 13,10, "Good morning, world! ,13,10,' GoodAfternoonMessage DB 13,10, Good afternoon, world,13,10, $ DefaultMessage DB 13,10, Good day, world!',10, 13, CODE start: mov ax, edata mov ds, ax mov dx, OFFSET TimePromt mov ah,9 int 21h mov ah,1 int 21h or al, 20h cmp al,'y je IsAfternoon cmp al,'n je IsMorning mov dx, OFFSET DefaultMessage IsAfternoon: mov dx, OFFSET GoodAfternoonMessage jmp DisplayGreeting IsMorning: mov dx, OFFSET GoodMorningMessage DisplayGreeting: mov ah,9 int 21h mov ah, 4ch mov al, int 21h END startExplanation / Answer
mov ds,ax
mov ah,09h; display message1
mov dx, offset msg1
int 21h
mov ah, 0ah; read string
mov dx, offset string
int 21h
mov ax, 4C00H; return to DOS
int 21H
main endp
end main
.data
msg1 db "hat is your name? $"
msg2 db "OAH,ODH, your name is $"
max db 20
len db?
String db 20 DUP('$')
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.