So this is my code trying to display a menu that allow users to choose which product they are interested,
mov ah,1
int 21h
mov bh,al
sub bh,48
cmp bh,1
je Applewatch
cmp bh,2
je Iphone
cmp bh,3
je Airpod
cmp bh,4
je Macbook
cmp bh,5
je Ipad
cmp bh,6
je Imac
However, if a user entered a random character other than 1-6, the system will jump to the first choice. I wanted to make a validation that jump users back to making the choice again if receives invalid character and how can i achieve that? Sorry if this question sound duplicated but I'm new to assembly language 8086 as it is included in my current semester. Any help will be appreciated.
Aucun commentaire:
Enregistrer un commentaire