XC-BASIC
XC-BASIC copied to clipboard
ON BIT GOTO/GOSUB
Idea: ON .. GOTO/GOSUB should support situations where we want to check if individual bits are set and jump to the Nth label when the Nth bit is set. for example:
ON BIT %00000001 GOTO label0, label1, label2 ...
would jump to label0 whereas
ON BIT %00000100 GOTO label0, label1, label2 ...
would jump to label2.
Not sure what happens if more than one bits are set, I guess bit checking would stop at the first match (the least significant bit that's set).
Edit: ON BIT 0 GOTO label0, label1 ...
should jump to the label0 whereas ON BIT %00000001 GOTO label0, label1...
to label1, etc..