i am trying to learn assembly using TASM . How do i make the below program terminate . i.e jump to final: after entering wrong key say 3 times ??
.model small
.data
msg1 db "- - - Enter y - - -",0dh,0ah,'$'
msg2 db 0dh,0ah, "..Correct...Good luck ..",0dh,0ah,'$'
msg3 db "- - - try again - - -",0dh,0ah,'$'
.code
start:
mov ax, seg msg1
mov ds,ax
mov dx,offset msg1
mov ah, 09h
int 21h
;
mov ah,01h
int 21h
;
mov bl,al
cmp bl,'y'
je good
cmp bl,'y'
jne wrong
good:
mov ax, seg msg2
mov ds,ax
mov dx,offset msg2
mov ah, 09h
int 21h
jmp final
;
wrong:
mov ax, seg msg3
mov ds,ax
mov dx,offset msg3
mov ah, 09h
int 21h
jmp start
;
final:
mov ax, 4c00h
int 21h
end start