Question: .MODEL small .STACK 100h .DATA TimePrompt DB 'Is it after 12 noon (Y/N)?$' GoodMorningMessage DB 13,10,'Good morning, world!', 13,10,'$' GoodAfternoonMessage DB 13,10,'Good afternoon, worl d!',13,10,'$'

.MODEL small

.STACK 100h

.DATA

TimePrompt DB 'Is it after 12 noon (Y/N)?$'

GoodMorningMessage DB 13,10,'Good morning, world!',

13,10,'$'

GoodAfternoonMessage DB 13,10,'Good afternoon, worl

d!',13,10,'$'

DefaultMessage DB 13,10,'Good day, world!',10,13,'$

'

.CODE

start:

mov ax, @data

mov ds, ax

mov dx, OFFSET TimePrompt

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, 0

int 21h

END start

1) Ask user to enter their name. What is your name? Eric

2) Use the name to replace world in the greeting message

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!