Menu

Unknown opcode "clr" ( with pic )

Santiago
2011-02-07
2013-05-30
  • Santiago

    Santiago - 2011-02-07

    Using pic16f876a i have this line in the .asm:

    clr SysTemp2_H

    Having a look to gcbasic.bas, i found the error coming from line 3276, in FUNCTION CompileCalcLogic ( last update yesterday ) :

    CurrLine = LinkedListInsert(CurrLine, " clr" + AV + "_H")

    I changed to this:

    CurrLine = LinkedListInsert(CurrLine, " clrf " + AV + "_H")

    Not sure if this is correct, but the "clr" comes from there.

    But is something weird, that asm code comes from this basic code:

                if ctrl_output = 1 and pant_blink = 1 then 
                    locate 1,15
                    PRINT "*"
                End if
    

    Just from the "and"

    but i only have the problem depending on the previous code…
    Here i don't have the error:

    locate 1,8
                PRINT amp1 : PRINT " mA"
                if ctrl_output = 1 and pant_blink = 1 then 
                    locate 1,15
                    PRINT "*"
                End if
    

    And here i have the error:

    locate 1,8
                if amp1 < 1000 then PRINT "0"
                if amp1 < 100  then PRINT "0"
                if amp1 < 10   then PRINT "0"
                PRINT amp1 : PRINT " mA"
                if ctrl_output = 1 and pant_blink = 1 then 
                    locate 1,15
                    PRINT "*"
                End if
    

    Regards.

     
  • lou

    lou - 2011-07-16

    I'm having the same issue with this "clr" opcode; but I can't find the source.  It only happens when I use signed integer math.

     
  • Hugh Considine

    Hugh Considine - 2011-07-19

    There were a few bugs in the logic operator code. There was the typo arcachofo mentioned above, plus a couple of missing Ifs that were sometimes trying to put AVR code on PICs or PIC code onto AVRs, and a problem with the XOR operator in GCBASIC's assembler on 18F PICs.

    Hopefully these are all fixed by the update at http://gcbasic.sourceforge.net/newfiles/update.zip

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.