Menu

Jump tables

2022-03-18
2022-03-20
  • Peter Stone

    Peter Stone - 2022-03-18

    Hi All,
    Its been a while since I have been on here.
    Which is actually a good thing as I have been successfully using GCB now for 10 years or so.
    However I have run into an issue with a current code build.

    I upgraded to a later version of GCB recently and now a bit of code that used to work now fails at compile time.

    I was wondering if anyone has suggestions on how to fix/workaround.

    Essential I am trying to implement a good old fashioned jump table to create entry points between pieces of cade that are compiled separately. This is compiled on older versions.

    Here is the section of code:

    'Entry point for JUMP TABLE here
    asm org 0x0020
    DipJumpTable:
    XSysCopyString:
    Goto SYSCOPYSTRING
    XSysReadString:
    Goto SYSREADSTRING
    XSysCompEqual:
    Goto SYSCOMPEQUAL
    XSysCompEqual16:
    Goto SYSCOMPEQUAL16
    XFn_Instr:
    Goto FN_INSTR
    XHSerSend:
    Goto HSERSEND
    XDelay_MS:
    Goto DELAY_MS
    XDelay_S:
    Goto DELAY_S

    Here are the errors that are returned when compiling:

    WARNINGs / ERRORs reported by Great Cow BASIC (if Syntax Error, doubleclick on the errormessage below) <<<
    BootLoader-9-Dynamic-APN.gcb (132): Error: Reserved Words cannot be labels: HSERSEND
    BootLoader-9-Dynamic-APN.gcb (134): Error: Syntax Error
    BootLoader-9-Dynamic-APN.gcb (135): Error: Syntax Error

    Any help would be greatly appreciated.

    Cheers

    Peter.

     
  • Anobium

    Anobium - 2022-03-19

    The compiler looks like it preventing this type of operation. I would need example code to resolve.

     
    • Anobium

      Anobium - 2022-03-20

      Hopeully resolved in build 1098.

      The issue is that Peter previously used a version of the compiler from 2013. A lot has changed since then notable the syntax is stricter. So, his operation as now not permitted. But, all is not lost... Implemented LAXSYNTAX in an ini file to support lax syntax validation

      Example in use.ini, but, it could be any ini. This entry must be added manually - it is NOT managed by the PREFS EDITOR.

      [gcbasic]
      ..
      laxsyntax = y
      ..
      

      This disables reserved word inspection, permits use of reserved words in GOTO statement.

       
  • William Roth

    William Roth - 2022-03-20

    Deleted Post

    Looks like Evan and Peter worked behind the scenes to resolve.

     

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.