I am trying to write assembly code that determines if 28 is an ideal number or not. But I have a problem. When I run the code, emu8086 does not recognize my tags.
For example, in this code:
mov dl,1ch
mov bl,00h ;sum
mov cl,1ch ;counter
dec cl
HERE : mov ax,00h
mov al,dl
div cl ;ax/dl ah=remainder
cmp ah,00h
je SUM ; if ah=0 jump the label SUM
loop HERE
mov dh,00h
cmp dl,bl
je PERFECT
hlt
SUM :
add bl,cl
jmp HERE
PERFECT :
mov dh,01
hlt
When the instruction is to be executed loop HERE, emu8086 runs the first command ( mov dl,1ch) of my code. What can I do? What is the problem?
Thanks in advance...
source
share