Question: Write a program to ask the user to enter number less than 5 5 using the below code as a skeloton. If the user enters

Write a program to ask the user to enter number less than 55 using the below code as a skeloton. If the user enters greater than 5,5, the program will loop to ask the user to enter the number less than 55 again until user enter the number less than 5.5. Display the number if the user enter number less than 5.5. The maximum attempts not more than 88 times. If the user did not enter the number less than 55 in 88 attempts, the program will prompt Fail at the screen.
..model small
..stack 100100h
..data
val11 dw ??
msg11 db 'Data to be push : $'" id="MathJax-Element-18-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">'' ;
msg22 db 'Data from pop : $'" id="MathJax-Element-20-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">'' ;
..code
mov ax,,@data
mov ds,,ax
lea dx,, msg11
mov ah,09,09h
int 2121h
mov ah,2,2
mov dx,32,32H
int 2121h
mov ax,32,32H
push ax
mov ah,2,2
mov dl,0,0dh
int 2121h
mov dl,0,0ah
int 2121H
lea dx,, msg11
mov ah,09,09h
int 2121h
mov ah,2,2
mov dx,34,34H
int 2121h
mov ax,34,34H
push ax
mov ah,2,2
mov dl,0,0dh
int 2121h
mov dl,0,0ah
int 2121H
pop val11
lea dx,, msg22
mov ah,09,09h
int 2121h
mov ah,2,2 mov dx,, val11
int 2121h
mov ah,2,2
mov dl,0,0dh
int 2121h
mov dl,0,0ah
int 2121H
lea dx,, msg11
mov ah,09,09h
int 2121h
mov ah,2,2
mov dx,36,36H
int 2121h
mov ax,36,36H
push ax
mov ah,2,2
mov dl,0,0dh
int 2121h
mov dl,0,0ah
int 2121H
pop val11
lea dx,, msg22
mov ah,09,09h
int 2121h
mov ah,2,2
mov dx,, val11
int 2121h
mov ah,2,2
mov dl,0,0dh
int 2121h
mov dl,0,0ah
int 2121H
pop val11
lea dx,, msg22
mov ah,09,09h
int 2121h
mov ah,2,2
mov dx,, val11
int 2121h
mov ah,4,4ch
int 2121h
end

Step by Step Solution

3.39 Rating (140 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the code implementing the required functionality model small stack 100h data prompt db Enter a number less than 55 failMsg db Fail num dw To store the users input maxAttempts db 8 Maximum allowe... View full answer

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 Programming Questions!