Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emu8086 doesn't recognize my labels

I try to write an assembly code that determines if 28 is a perfect number or not. But I have a problem. When I run the code, emu8086 doesn't recognize my labels.
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 loop HERE instruction should run, emu8086 runs the first instruction (mov dl,1ch) of my code. What can I do? What is the problem?

Thanks in advance...

like image 520
Selin Gök Avatar asked Mar 10 '23 08:03

Selin Gök


1 Answers

Remove the blank space between the label name and the colon :

     space
       ▼
PERFECT :

It should be :

    no space
       ▼
PERFECT:
like image 156
Jose Manuel Abarca Rodríguez Avatar answered Mar 19 '23 12:03

Jose Manuel Abarca Rodríguez