The SX/B compiler can trap several programming errors before generating the assembly output that is passed to the SASM assembler. The list below gives a description of the errors and guidance for correction.


Error 1 INVALID VARIABLE NAME
  You have used a variable name that is an SX/B or SASM reserved word.


Error 2 DUPLICATE VARIABLE NAME
  You have tried to allocate the same variable name more than once.


Error 3 VARIABLE EXCEEDS AVAILABLE RAM
  You have declared too many variables or the array is too large.


Error 4 CONSTANT EXPECTED
  The bit field value must be a constant.


Error 5 BYTE PARAMETER EXPECTED
  Many commands work only with BYTE parameters.


Error 6 INVALID UNARY OPERATOR
  You used a unary operator other than (negate) or ~ (bitwise NOT).


Error 7 INVALID REGISTER OPERATION
  Some SX registers are write-only, hence assignment is the only valid operation.


Error 8 INVALID PARAMETER
  You have used a parameter that is not valid.


Error 9 SYNTAX ERROR
  Command syntax not followed.


Error 10 INVALID NUMBER OF PARAMETERS
  You have given too few or too many parameters for the command.


Error 11 BYTE VARIABLE EXPECTED
  You have used a non-byte variable where a byte was expected.


Error 12 NOT A FOR CONTROL VARIABLE
  You have used NEXT with a variable what was not used in a previous FOR instruction.


Error 13 BIT VARIABLE EXPECTED
  You have used a non-bit variable where a bit variable is required.


Error 14 BAUDRATE IS TOO LOW
  Baudrates are limited by the FREQ setting. Use a higher baudrate or lower clock frequency.


Error 15 BAUDRATE IS TOO HIGH
  Baudrates are limited by the FREQ setting. Use a lower baudrate or higher clock frequency.


Error 16 UNKNOWN COMMAND
  Instruction used is not supported or is misspelled, or you have misspelled a variable name.


Error 17 COMMA EXPECTED
  In most cases you must separate parameters with a comma.


Error 18 EXPECTED A VALUE BETWEEN 0 AND 7
  Bit operations require a value from 0 to 7.


Error 19 BIT IS NOT A HARDWARE PIN
  Some commands operate only on hardware pins.


Error 20 BIT CONSTANT EXPECTED
  Expected 0 or 1.


Error 21 INTERRUPT MUST BE USED BEFORE PROGRAM
  Interrupt routine must be placed before the PROGRAM directive.


Error 22 FOR WITHOUT NEXT
  You have created a FOR loop without a corresponding NEXT, or you have misspelled the FOR control variable name.


Error 23 NEXT WITHOUT FOR
  You have used NEXT without a corresponding FOR, or you have misspelled the NEXT variable name.


Error 24 UNKNOWN VARIABLE NAME
  You have attempted to use an undeclared variable, or misspelled a variable name.


Error 25 TOO MANY SUBS DEFINED
  A maximum of 127 subroutines may be defined in any one program.


Error 26 ELSE OR ENDIF WITHOUT IF
  You have used ELSE or ENDIF without a corresponding IF.


Error 27 VARIABLE NOT IN CURRENT BANK
  The variable used is not accessible from the current bank.


Error 28 MUST BE A GLOBAL VARIABLE
  Some commands (BANK) require a variable that is located in the global RAM area. Place global variables at the beginning of the declaration section.


Error 29 LOOP WITHOUT DO
  You have used LOOP without a corresponding DO.


Error 30 EXIT NOT IN FOR...NEXT OR DO...LOOP
  The EXIT command must be used within a FOR...NEXT or a DO...LOOP construct.


Error 31 FREQUENCY DIFFERENT FROM DEVICE SETTING
  The clock speed you have specified with FREQ does not match the clock speed specified on the DEVICE> line. This only occurs when the device line specifies one of the internal clock speeds (OSC4MHZ, OSC1MHZ, OSC128KHZ, or OSC32KHZ)


Error 32 NOT ALLOWED ON THIS DEVICE
  Some commands (like TIMER1) only apply to the SX48/52 devices. If you attempt to use these commands on the SX28 you will receive this error.


Error 33 NO PROGRAM DIRECTIVE USED
  All SX/B programs must use the PROGRAM Label directive so that the SX knows where to start program execution.