Tasm Assembly Code - Terminating a Repeating Program

1.2k views Asked by At

In this assembly program code, I'd like to keep entering 'Y'/Yes in the input, and after atleast 3 times of Yes/Y, the program will terminate itself or will jump to endmain, how do I do it?

I'd want this display:

Do you want to try again?: Y
Do you want to try again?: Y
Do you want to try again?: Y
*then the program stops after 3tries*

not this

Do you want to try again?: Y
Do you want to try again?: Y
Do you want to try again?: Y
Do you want to try again?: Y
Do you want to try again?: Y
Do you want to try again?: Y
Do you want to try again?: Y
Do you want to try again?: Y
Do you want to try again?: Y
infinity++
*x_x*

.

.model small
.stack
.data
a db 10, 13, "Do you want to Try again? Y/N $"


.code
org 0100h
main:

mov ax, @data
mov ds, ax

dsply:
mov ah, 9
lea dx, a
int 21h
mov ah, 1
int 21h
mov cl, al

cmp cl, 'Y'
je dsply
cmp cl, 'N'
je endmain


endmain:
mov ah, 4ch
int 21h
end main

Any suggestions?

0

There are 0 answers