Write a program to ask the user to enter number less than 5 5 using the below
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a program to ask the user to enter number less than 5 using the below code as a skeloton. If the user enters greater than 5, the program will loop to ask the user to enter the number less than 5 again until user enter the number less than 5. Display the number if the user enter number less than 5. The maximum attempts not more than 8 times. If the user did not enter the number less than 5 in 8 attempts, the program will prompt Fail at the screen.
.model small
.stack 100h
.data
val1 dw ?
msg1 db 'Data to be push : $' " id="MathJax-Element-18-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">' ;
msg2 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, msg1
mov ah,09h
int 21h
mov ah,2
mov dx,32H
int 21h
mov ax,32H
push ax
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21H
lea dx, msg1
mov ah,09h
int 21h
mov ah,2
mov dx,34H
int 21h
mov ax,34H
push ax
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21H
pop val1
lea dx, msg2
mov ah,09h
int 21h
mov ah,2 mov dx, val1
int 21h
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21H
lea dx, msg1
mov ah,09h
int 21h
mov ah,2
mov dx,36H
int 21h
mov ax,36H
push ax
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21H
pop val1
lea dx, msg2
mov ah,09h
int 21h
mov ah,2
mov dx, val1
int 21h
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21H
pop val1
lea dx, msg2
mov ah,09h
int 21h
mov ah,2
mov dx, val1
int 21h
mov ah,4ch
int 21h
end
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: