Diagnostics

Every message FantASM emits carries a numeric code and a level. This page is the complete reference.

Levels

LevelColourMeaning
InfoGreenSystem-level progress information (e.g. assembly passes).
MessageCyanUser messages from the !message directive.
WarningYellowNon-fatal issues that don’t stop assembly (e.g. truncations).
ErrorRedFatal issues that prevent successful assembly.
Fatal ErrorMagentaCritical system or environment failures.

Reference

Placeholders such as {file} or {cmd} are filled in with the offending value at assembly time.

CodeLevelMessageMeaning
1002ErrorInvalid character in labelLabels must start with a letter, _ or ., and contain only alphanumerics, _ and ..
1003ErrorUndefined label or constantA label/constant used in an expression was never defined.
1004ErrorFile not found: {file}The file wasn’t found in the current directory or any include path.
1005ErrorSyntax error [- {text}]Code doesn’t follow the expected syntax.
1006ErrorBad constant definitionAn EQU/= definition is malformed or missing a value.
1007ErrorInvalid register pairThe register pair isn’t valid for this instruction.
1008ErrorInvalid instruction [- {text}]Unrecognised mnemonic or operand combination.
1009WarningInteger out of rangeA value is outside the valid range for its context and will be truncated.
1010WarningAddress is out of range, the value has been truncatedAn address exceeds 65535 and was truncated to 16 bits.
1011WarningInteger has been truncated to 8 bitsA larger value was used where 8 bits were expected.
1012WarningInteger has been truncated to 16 bitsA larger value was used where 16 bits were expected.
1013ErrorAttempt to redefine label or constantA name is defined more than once.
1014ErrorUnexpected end of lineAn instruction/directive was cut short of its required parameters.
1015ErrorInvalid conditionAn invalid condition code in JR/JP/RET/CALL.
1016ErrorZ80n extended instructions are not enabledUse !target zxnext or !opt z80n=on.
1017ErrorUnexpected closing parenthesesA ) with no matching (.
1018ErrorUnclosed parenthesesA ( with no matching ).
1019ErrorCSpect pseudo ops are not enabledUse !opt cspect=on.
1020WarningInvalid assembler option: {opt}Unrecognised !opt or command-line option.
1021ErrorInvalid number or expressionA numeric expression failed to evaluate.
1022ErrorInvalid Hexadecimal stringA HEX string contains non-hex digits.
1023WarningBit number is out of range and will be truncatedA BIT/SET/RES index outside 0–7.
1024ErrorSource file previously includedINCLUDE re-included an already-included file.
1025WarningDiscarded extra characters at end of lineExtra characters followed a valid statement.
1026ErrorEncountered END without MACRO directiveEND/ENDM with no matching MACRO.
1027ErrorENDIF without IFENDIF with no matching IF/IFDEF/IFNDEF.
1028ErrorELSE without IFELSE with no matching IF.
1029ErrorInvalid or missing macro nameA MACRO is missing a name or the name is invalid.
1030ErrorComma expectedA separating comma between operands/parameters is missing.
1031ErrorInvalid or missing macro parameter nameA macro definition has an invalid parameter name.
1032ErrorMacros may not be nestedA macro was defined inside another macro.
1033ErrorIncorrect number of macro parametersA macro was called with the wrong argument count.
1034ErrorOnly local labels are permitted inside macrosUse local labels (.name) inside macros.
1035ErrorMacro already definedA macro name is already in use.
1036ErrorMaximum code size exceededGenerated code exceeds the configured maximum.
1037ErrorSizeOf cannot be determinedSIZEOF used on something whose size isn’t known yet.
1038ErrorString contains non-ascii characters [- {text}]A string has characters outside the ZX Spectrum mapping.
1039ErrorInvalid 8-bit registerAn 8-bit register was expected.
1040ErrorENUM name expectedAn ENUM is missing a name.
1041ErrorENDE without ENUMENDE with no matching ENUM.
1042ErrorEnum member name is invalidAn enum member name isn’t a valid label.
1043ErrorEnum step value cannot be zeroThe ENUM step must be non-zero.
1044ErrorSTRUCT name expectedA STRUCT is missing a name.
1045ErrorENDS without STRUCTENDS with no matching STRUCT.
1046ErrorSTRUCT member name is invalidA struct member name isn’t a valid label.
1047ErrorSTRUCT member size suffix is invalidA struct member size (db/dw…) is invalid or missing.
1048ErrorSTRUCT already definedA struct name is already in use.
1049ErrorInvalid address or bankAn invalid address/bank passed to BANK/ORG.
1050WarningInvalid directiveAn unrecognised !-prefixed directive.
1051InfoInfo messageSystem-level informational message (assembly progress).
1052ErrorUnknown SNA command: {cmd}Unrecognised !sna subcommand.
1053ErrorUnknown NEX command: {cmd}Unrecognised !nex subcommand.
1054ErrorExpected NEX command, found: {tok}!nex expected a subcommand.
1055ErrorExpected SNA command, found: {tok}!sna expected a subcommand.
1056MessageSource messageA message from the !message directive.
1057InfoShebang detected and ignored: {shebang}A #! first line was detected and ignored.