Here is my assembly lang program.
mov dh,0
C: sub bl,cl
mov al,bl
mov ah,0
mov bh,2
div bh
cmp ah,0
je A
mov al,cl
mov ah,0
mov bh,2
div bh
A:
mov al,cl
add dh,al
add bl,cl
add cl,1
cmp cl,bl
jle C
I am trying to convert it to x86 Hexadecimal.
I am using a Intel 86v simulator to run this.
8A 1E 0B 01
8A 0E 0C 01
EB 00 02 "Jumps the next 2 bytes which are the one that run the program"
14 0E "These are to two value that run the program CL=14 BL=OE"
C6 C6 00 "Sets Dh=0"
2A D9 "jump Location C: is at the start of this instruction"
8A C3
C6 C4 00
C6 C7 02
F6 F7
80 FC 00 "Compares Ah to 0
74 0A "This is the jump to label A if =0"
8A C1
C6 C4 00
C6 C7 02
F6 F7
8A C1 "Jump location A is here"
02 F0
02 D9
80 C1 01
3A CB
7E D6 "This is jump back up to C which is at the top almost like a loop.
I think this is where my problem is i think the value d6 is wrong
but it needs to be the number of bytes i need to jump to get back to the top.
This is the error message i get.
The NTVDM CPU has encountered an illegal instruction.
CS:1243 IP:0111 OP:d9 8a c3 c6 c4 Choose close to terminate the application.
I really need help fixing this is hope you understand my problem.