I'm having problems in my cmp commands. No matter what result I may pass, the program ignores the cmp result and runs all parts of my code. Can anyone help me please?
;tipo de bandeira mov ah, 40h mov bx, 1 mov cx, 24 mov dx, bandeira int 21h ;linha mov ah, 40h mov bx, 1 mov cx, 1 mov dx, linha int 21h ;input e confirmação do tipo de bandeira mov ah, 3Fh mov bx, 00 mov cx, 1 mov dx, tipoBandeira int 21h ;clear feed mov ah, 3Fh mov bx, 00 mov cx, 2 mov dx, crlf int 21h cmp[tipoBandeira],01 je T1 cmp[tipoBandeira],02 je T2 T1: mov ah, 40h mov bx, 1 mov cx, 08 mov dx, quad int 21h T2: mov ah, 40h mov bx, 1 mov cx, 11 mov dx, rect int 21h I'm pretty new to assembly, and I have a pretty lousy teacher that awnsers all our questions with "use google", ignoring that there are a lot of assembly types and that it really isn't a straight-forward language.
je T2if the condition is failed the code execution continues so that will run yourT1. Also, afterT1the code continues intoT2. You should add some unconditional jump to avoid the fall-through. Draw a flowchart if that helps.