possible bug?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

possible bug?

kostya3312
Hi
In my program from ch4 (R0*R1=R2) assembler sets strange address 17 instead label LOOP (address must be 6) ...

    @R1
    D=M
    @i
    M=D
    @R2
    M=0
(lOOP)    <--- label must refer to 6        
    @i
    D=M
    @END
    D;JEQ
    @R0
    D=M
    @R2
    M=M+D
    @i
    M=M-1
    @LOOP  <----- but in assembler i see here 0000000000010001, i.e. 17 (???)
    0;JMP
(END)
    @END
    0;JMP
Reply | Threaded
Open this post in threaded view
|

Re: possible bug?

cadet1620
Administrator
Symbols in Hack are case sensitive.

Your label (lOOP) starts with lowercase but @LOOP starts with upper case.
Since there is no (LOOP) in the program, the assembler allocates a new RAM variable for LOOP giving it RAM address 17.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: possible bug?

kostya3312
Oh, thanks a lot! I was inattentive.
Reply | Threaded
Open this post in threaded view
|

Re: possible bug?

joeroot35689876543
In reply to this post by cadet1620
This bug is very common for almost all user and that because of Virus or ransomware, But if you want to fix this bug then contact to Norton Antivirus Customer Service, they always ready to helps you.