In the below intel assembly code, I use a cmp (compare) instruction before a conditional jump, but for below code, it should not jump but it does & prints the string.
What is going wrong.(Flat assembler, Win-7 x32).
ORG 100h
USE16
mov ah, 09
mov dx, message
cmp ah, 10d
je condjmp
condjmp:
int 21h
mov ah,01
int 21h
mov ah,4ch
int 21h
message db 'conditional jump', 0Ah, '$'
The jump goes to a label that is immediately following the jmp instruction, so it does not matter if the jump is taken or not, you always end up at the label.