How to construct the machine code for backward conditional jump (e.g. JNZ ) for 8086 microprocessor ?
LOOP: MOV DL, [BX] (say this starts at 100C)
ADD AX,DX (this at 100E)
INC BX (1010)
DEC CL (1011)
JNZ LOOP (1013)
What will be the machine code of last line? machine code for JNZ is 75 and here I want to jump by 9 bytes backward ( I think so).
Jumps are based on the location after the jump instruction. Here you want to jump 9 bytes back and thus the encoding will be 75h,F7h