Menu

Setting bits higher than bit 7 gives no error

2007-03-27
2013-05-30
  • Nobody/Anonymous

    Example:

    dim test as word
    test.15 = 1

    Compiles to:
    ;Set aside memory locations for variables
    TEST    equ    32
    TEST_H    equ    33
    <-->
    ;Start of the main program
        bsf    TEST, 15

    No warning and it even assembles (with gputils) to a hex without error.

    I assume the correct asm should be:
        bsf    TEST_H, 7

    A workaround is of course to rewrite the basic code to:
    test_h.7 = 1

    But it would be nice if the compiler handled it OR at least warned you.

     
    • Hugh Considine

      Hugh Considine - 2007-03-28

      All fixed, thanks for letting me know. GCBASIC will now handle it automatically.

      http://gcbasic.sourceforge.net/newfiles/update.zip

       
    • Nobody/Anonymous

      Excellent... just tried it and it works as expected.

       

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.