Menu

Myvar=0 asm code is not same as Myvar = 0x00

bell
2007-03-30
2013-05-30
  • bell

    bell - 2007-03-30

    Not a bug really but:

    Myvar = 0
    compiles to:
    clrf    MYVAR

    while

    Myvar = 0x00
    compiles to:
    movlw    0X00
    movwf    MYVAR

     
    • bell

      bell - 2007-03-30

      BTW... this is not true for word variables which uses clrf regardless if you set them to 0, 0x00 or 0x0000, so it's only byte vars that generate unnecessary code.

       

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.