totalspectrum/spin2cpp

FIT directive for P1 Spin does not allow Boolean "AND" or "OR" operators

Ding-Batty opened this issue · 1 comments

I use FIT statements as compile-time asserts (the only way I know of to do so for all Spin compilers).

Here is a sample:

DAT
                ORG 1

  ' The COLORS_BASE_PIN must be either 0 or 9, because the code uses a
  ' MOVS or MOVD for the six color bits, for speed.
  ' Error means the COLORS_BASE_PIN was given an unspported value.
  ' For some reason FlexSpin doesn't like the "OR" operator:
  '   "error: syntax error, unexpected instruction"
  fit ||((COLORS_BASE_PIN == 0) OR (COLORS_BASE_PIN == 9))
  fit ||((COLORS_BASE_PIN == 0) + (COLORS_BASE_PIN == 9))

FlexSpin 6.8.0 will generate the failure for the first line, that contains the "OR", and not the second one. Neither PropTool 1.3.2 nor BST have any problem with it.

Full Example attached, for both "AND" and "OR"