Diagnostics
Every message FantASM emits carries a numeric code and a level. This page is the complete reference.
Levels
| Level | Colour | Meaning |
|---|---|---|
| Info | Green | System-level progress information (e.g. assembly passes). |
| Message | Cyan | User messages from the !message directive. |
| Warning | Yellow | Non-fatal issues that don’t stop assembly (e.g. truncations). |
| Error | Red | Fatal issues that prevent successful assembly. |
| Fatal Error | Magenta | Critical system or environment failures. |
Reference
Placeholders such as {file} or {cmd} are filled in with the offending value at assembly time.
| Code | Level | Message | Meaning |
|---|---|---|---|
| 1002 | Error | Invalid character in label | Labels must start with a letter, _ or ., and contain only alphanumerics, _ and .. |
| 1003 | Error | Undefined label or constant | A label/constant used in an expression was never defined. |
| 1004 | Error | File not found: {file} | The file wasn’t found in the current directory or any include path. |
| 1005 | Error | Syntax error [- {text}] | Code doesn’t follow the expected syntax. |
| 1006 | Error | Bad constant definition | An EQU/= definition is malformed or missing a value. |
| 1007 | Error | Invalid register pair | The register pair isn’t valid for this instruction. |
| 1008 | Error | Invalid instruction [- {text}] | Unrecognised mnemonic or operand combination. |
| 1009 | Warning | Integer out of range | A value is outside the valid range for its context and will be truncated. |
| 1010 | Warning | Address is out of range, the value has been truncated | An address exceeds 65535 and was truncated to 16 bits. |
| 1011 | Warning | Integer has been truncated to 8 bits | A larger value was used where 8 bits were expected. |
| 1012 | Warning | Integer has been truncated to 16 bits | A larger value was used where 16 bits were expected. |
| 1013 | Error | Attempt to redefine label or constant | A name is defined more than once. |
| 1014 | Error | Unexpected end of line | An instruction/directive was cut short of its required parameters. |
| 1015 | Error | Invalid condition | An invalid condition code in JR/JP/RET/CALL. |
| 1016 | Error | Z80n extended instructions are not enabled | Use !target zxnext or !opt z80n=on. |
| 1017 | Error | Unexpected closing parentheses | A ) with no matching (. |
| 1018 | Error | Unclosed parentheses | A ( with no matching ). |
| 1019 | Error | CSpect pseudo ops are not enabled | Use !opt cspect=on. |
| 1020 | Warning | Invalid assembler option: {opt} | Unrecognised !opt or command-line option. |
| 1021 | Error | Invalid number or expression | A numeric expression failed to evaluate. |
| 1022 | Error | Invalid Hexadecimal string | A HEX string contains non-hex digits. |
| 1023 | Warning | Bit number is out of range and will be truncated | A BIT/SET/RES index outside 0–7. |
| 1024 | Error | Source file previously included | INCLUDE re-included an already-included file. |
| 1025 | Warning | Discarded extra characters at end of line | Extra characters followed a valid statement. |
| 1026 | Error | Encountered END without MACRO directive | END/ENDM with no matching MACRO. |
| 1027 | Error | ENDIF without IF | ENDIF with no matching IF/IFDEF/IFNDEF. |
| 1028 | Error | ELSE without IF | ELSE with no matching IF. |
| 1029 | Error | Invalid or missing macro name | A MACRO is missing a name or the name is invalid. |
| 1030 | Error | Comma expected | A separating comma between operands/parameters is missing. |
| 1031 | Error | Invalid or missing macro parameter name | A macro definition has an invalid parameter name. |
| 1032 | Error | Macros may not be nested | A macro was defined inside another macro. |
| 1033 | Error | Incorrect number of macro parameters | A macro was called with the wrong argument count. |
| 1034 | Error | Only local labels are permitted inside macros | Use local labels (.name) inside macros. |
| 1035 | Error | Macro already defined | A macro name is already in use. |
| 1036 | Error | Maximum code size exceeded | Generated code exceeds the configured maximum. |
| 1037 | Error | SizeOf cannot be determined | SIZEOF used on something whose size isn’t known yet. |
| 1038 | Error | String contains non-ascii characters [- {text}] | A string has characters outside the ZX Spectrum mapping. |
| 1039 | Error | Invalid 8-bit register | An 8-bit register was expected. |
| 1040 | Error | ENUM name expected | An ENUM is missing a name. |
| 1041 | Error | ENDE without ENUM | ENDE with no matching ENUM. |
| 1042 | Error | Enum member name is invalid | An enum member name isn’t a valid label. |
| 1043 | Error | Enum step value cannot be zero | The ENUM step must be non-zero. |
| 1044 | Error | STRUCT name expected | A STRUCT is missing a name. |
| 1045 | Error | ENDS without STRUCT | ENDS with no matching STRUCT. |
| 1046 | Error | STRUCT member name is invalid | A struct member name isn’t a valid label. |
| 1047 | Error | STRUCT member size suffix is invalid | A struct member size (db/dw…) is invalid or missing. |
| 1048 | Error | STRUCT already defined | A struct name is already in use. |
| 1049 | Error | Invalid address or bank | An invalid address/bank passed to BANK/ORG. |
| 1050 | Warning | Invalid directive | An unrecognised !-prefixed directive. |
| 1051 | Info | Info message | System-level informational message (assembly progress). |
| 1052 | Error | Unknown SNA command: {cmd} | Unrecognised !sna subcommand. |
| 1053 | Error | Unknown NEX command: {cmd} | Unrecognised !nex subcommand. |
| 1054 | Error | Expected NEX command, found: {tok} | !nex expected a subcommand. |
| 1055 | Error | Expected SNA command, found: {tok} | !sna expected a subcommand. |
| 1056 | Message | Source message | A message from the !message directive. |
| 1057 | Info | Shebang detected and ignored: {shebang} | A #! first line was detected and ignored. |