Error Messages

The SB-Assembler is just another program that tries to understand the commands you give it. It will not always succeed in understanding you. That's why I've added some error messages to warn you that there is something wrong in your source files.
Please note that the SB-Assembler can only warn you for syntax errors, value errors, and non-existing properties. It can't warn you for logical errors in your program. A program that does not report any errors is not necessarily a working program! It only tells you that the program obeyed to the rules of the SB-Assembler.

There are two main types of errors, fatal and non-fatal errors. Fatal errors are so severe that it's no use to continue the assembly process. The SB-Assembler will report such an error and quit immediately.
Non-fatal errors are still errors that would prevent your program from working correctly, but they are not serious enough to quit the assembly process at once. The SB-Assembler will not start pass 2 of the assembly process if errors are found in your program during pass 1. No code will be generated if pass 2 is not started and the previous code file is unchanged. If an error occurs during pass 2 some code may have been generated and a previous code file will be overwritten. Due to the error(s) found it is not very likely that the resulting code file will work correctly.

Errors are always sent to the screen. But if there are too many errors you may no longer see the first error messages, which have long gone off the top of the screen. Errors are also listed in the list file, if you have opened one during assembly. And finally you can send all errors to an error file using the .EF directive.

Version 3 of the SB-Assembler also supports warnings. Warnings are not errors, and therefore are no show stoppers like errors are. A program, which produced one or more warnings, will possibly be all right, but may need some attention from you.

There is a standard list of error messages originating from the SB-Assembler itself. Some Cross Overlays may add some specific error messages to the standard list. Details about Cross specific errors can be found in the description of the particular Cross Overlay.
Version 2 and version 3 of the SB-Assembler have their own set of error messages. Therefore you will see them listed here in separate chapters.

Error messages (Version 3)

Each error message is preceded by the text *** Error: or *** Fatal Error:, which will tell you what type of error it is. Basically any error in the list below can be either a fatal or a non fatal error, depending on the place where the error occurred.

Assembler and cross versions are not compatible

Somehow you have mixed up some of the program files in the assembler package. Download the latest package from this web site and install it again.
By the way, this is a fatal error.

Bad opcode error

There was some kind of error detected in the instruction field (mnemonic or directive).
A misspelled mnemonic or directive may cause this error. Or it could be caused by loading a wrong Cross Overlay.

Bad operand error

There was some kind of error detected in the operand field (parameters). Consult the description of the mnemonic or directive to learn the rules of the operands in question.
A missing comma to separate operands may also cause this error to appear.

Can't open .BI file

Can't open the binary include file. Are you sure it exists?

Can't open source file

A source file could not be opened. It probably doesn't exist in the location you have specified. This is obviously a fatal error.

Can't write to binary files

The .TW directive can't write plain text to binary target files (files of type BIN and HEX).

Can't write to files

One or more files can't be written to. Maybe the file or the entire file system is read only.

Cross overlay not found

This is always a fatal error. You are using the .CR directive to load a cross overlay which does not exist. This is probably a typo, or the particular Cross Overlay really doesn't exist.

Division by 0

An expression tried to divide a number by 0, which is not allowed in math.

Empty string

No text was found between two delimiters, resulting in an empty string, which is not allowed.

Extra definition error

An attempt is made to give an already existing label a different value than the first time it was declared using this assembly run. Label values are constants and can not be changed any more.

Forward reference not allowed

You are trying to use a label's value before the label is actually defined. Most of the time this is perfectly legal. However, there are times where this is not allowed. And this is such a time.

Illegal binary digit

The assembler expected to find a binary digit but found a character which was not 0 or 1.

Illegal decimal digit

The assembler expected to find a decimal digit but found a character which was not 0..9.

Illegal delimiter

You are trying to use a character to start a string constant which is not a legal delimiter.

Illegal directive

The directive you are using here is not allowed at this moment. This may happen to some directives which are not allowed within a Macro definition for instance.

Illegal format in binary file

The format of the binary include file you are trying to read is not recognized.

Illegal hex digit

The assembler expected to find a hex digit but found a character which was not 0..9 or A..F.

Illegal label declaration

You try to declare a label on a program line containing a directive which does not allow labels to be defined. The label field of such a program line should be empty.

Illegal label name

You have made some error in naming a label. A label may start with a letter A to Z, a dot . , or a colon : . As of Version 3.01 a label name may also start with an underscore. Furthermore it may contain the letters A to Z, the digits 0 to 9, a dot . , or an under score character _ . Only during definition a label may contain a colon : at the end of the name.

Illegal macro name

You have made some error in naming a Macro. A Macro name may start with a letter A to Z. As of Version 3.01 a macro name may also start with an underscore. Furthermore it may contain the letters A to Z, the digits 0 to 9, a dot . , or an under score character _ .

Illegal octal digit

The assembler expected to find an octal digit but found a character which was not 0..7.

Label field is empty

The label field can not be empty for the .EQ and .SE directives.

Label is not a constant

You try to redefine a label's value automatically or by using the .EQ directive that originally was declared using the .SE directive. Once a label is declared as a variable it cannot be changed to a constant any more.

Label is not a variable

You try to redefine a label's value using the .SE directive that originally was declared automatically or by using the .EQ directive. Once a label is declared as a constant it cannot be changed to a variable any more.

Macro does not exist

You tried to expand a non existing Macro. The instruction field started with a > symbol.

Missing .DO

The SB-Assembler finds a program line containing the .EL or .FI directive, while no pending .DO is active.

Missing global label

You tried to use a local label without providing a global label in your program first. Local labels are always tied to a preceding global label.
This error is also reported after the definition of a Macro or the first declaration of a variable by using the .SE directive.

Missing macro name

The .MA directive was found on this line, but you failed to provide a name for that Macro.

No Cross Assembler loaded

A mnemonic was found in the instruction field, but no Cross Overlay was loaded yet. This is always a fatal error. Use the .CR directive before the first line containing a processor instruction.

No macro expanding

The .XM directive was found outside a Macro expansion. The .XM directive can only be used from within a Macro definition.

Operand expected

The SB-Assembler expected to find an operand in the operand field, but none was found.

Orphaned .EC directive found

The .EC directive was found without a preceding .CO directive. Probably you forgot to remove it after removing the .CO directive.

Orphaned .EM directive found

The .EM directive was found without a preceding .MA directive. You can't end a non existent Macro definition.

Out of range

An operand appears to be outside its allowable range. Please refer to the operand details in the description of the directive or mnemonic.

Overflow error

A constant number in any of the available radixes (not an expression!) was larger than 32 bits. Values larger than $FFFFFFFF result in this error message.

RAM memory can't have a target file

It is not possible to write code/data to the RAM memory segment. Therefore it is no use to assign a target file to the RAM memory segment.

Recursive opening of source file is not allowed

You try to open a new include file with the same name as the current include file. This could cause an infinite loop. This is always a fatal error.

String not terminated

The end of the program line was reached while the assembler expected to find a closing delimiter somewhere. You must terminate a literal string with the same delimiter as you started it with.

Symbol table not in sync between passes

Labels appear to have different values in pass 1 and pass 2, which is not a good sign. You may have done something wrong with conditional assembly which includes the pass parameter ? .
If you haven't used conditional assembly using the pass parameter then there is probably a bug in the Cross Overlay causing a different number of bytes generated in pass 1 and pass 2. Please let me know if you get this one.

Undefined label

You get this error during pass 2 if you use a label which was never declared during pass 1. This error is not reported during pass 1 because the label could be forward referenced.

Unknown directive

The instruction field started with a dot, but doesn't contain a legal directive name.

Unknown error occurred

That's odd, an error occurred and I don't know what caused it. Please let me know if you get this one.

User error

This is the default message for user raised errors. You can raise a user error with the .ER directive.

Value expected

The SB-Assembler expected to find a value in the operand field, but could not find one.

Warnings (Version 3)

Address in target file wrapped back

The address counter of the target file reached the end and wrapped back to $0000. This is not considered an error, but it probably requires some of your attention.

Extra parameters ignored

You provided more parameters to a directive or instruction than expected. The extra given parameters are ignored. But you may have to take a look at your code to see if the parameters which were expected are indeed the ones you have given.

Had to close target file because of new org

The .OR directive was found while a non formatted target file was open and not empty any more. Non formatted target files don't contain address information and therefore have to be closed when you change the program counter. If you don't open a new target file after this warning all subsequent target code will get lost.

Symbol file already open. Extra Symbol file ignored

You can only open one Symbol file. Opening more than one is not allowed. Only the first opened Symbol file is active, all others are ignored.

Target Address confusion

Apparently you have just loaded a new Cross overlay, which uses a different instruction size, at a moment where the program pointer and the target pointer are no longer in sync. If this happens the SB-Assembler can't figure out what the relationship between these two pointers is going to be. It is highly unlikely that the target address will be what you want it to be now. Therefore it is advised to use the .OR directive, just before the .CR directive in order to set both pointers to the same value, which will avoid this warning.
Then, after loading the multi-byte per instruction Cross Overlay you'll have to do another .OR to make sure the Target Address gets double the value as the Program Pointer.

Unknown warning occurred

That's odd, a warning was generated and I don't know what caused it. Please let me know if you get this one.

User warning

This is the default message for user raised warnings. You can raise a user warning with the .ER directive.

Writing code outside of code memory

You try to use processor instructions in an EEPROM or RAM segment. Processor instructions are only allowed in CODE segment. See the .SM directive for details about the three memory segments.
This warning is usually given only once per assembly run.

Error messages (Version 2)

*** Access denied error

The system does not allow you to create, alter or erase a particular file. Perhaps the file is read only or in use by another program. This one is always fatal.

*** Bad operand error

There was some kind of error detected in the operand field (parameters). Consult the description of the mnemonic or directive to learn the rules of the operands in question.
A missing comma to separate operands may also cause this error to appear. Or perhaps you typed a space behind the comma which is not allowed for commas that should separate operands.

*** Bad symbol error

The label name in the label field does not obey to the rules. Perhaps the label name started with something else than a letter from A to Z, an underscore, a dot, or a colon?

*** Binary format error

An error was found in the formatting of a Binary Include file. All records should be formatted according to the file format in use.

*** Checksum error

A checksum error was found while the assembler was reading a Binary Include file. Maybe the file is corrupted.

*** Divide by 0 error

An expression tried to divide a number by 0, which is not allowed in math.

*** .DO nested too deep error

Congratulations! You've broken the world record of foolishness. You have nested more than 255 .DO directives! Obviously you have outsmarted the SB-Assembler.

*** Empty string error

There were no characters found in the string that was delimited by 2 adjacent delimiters. Empty strings are not allowed.

*** Error file already open error

You tried to open a second error file using the .ER directive. Only one error file can be opened during an assembly run.

*** Extra definition error

An attempt is made to give an already existing label a different value than the first time it was declared during this assembly run. Label values are constants and can not be changed any more.

*** Extra Macro definition error

You try to define a macro with the .MA directive with the same name as an already existing macro. Choose a different name for one of the macro definitions.

*** File not found error

The SB-Assembler tried to open a file, but could not find it in the current or indicated directory.

*** Illegal address error

Every processor's program counter (PC) is limited. You tried to save instructions beyond its range if you get this error.

*** Illegal declaration error

You tried to create a label in the symbol table during pass 2. This is a little too late. All labels must be declared at the end of pass 1.

*** Illegal directive in Macro error

You've used one of the forbidden directives from within a macro definition. This error is given during the definition of the macro, between the .MA and .EM directives.
This is a list of all illegal directives from within a macro definition:   .MA, .IN, .CH, .BI, .EN, .CO and .EC .

*** Illegal forward reference error

You tried to use the value of a label that was not defined yet. This is OK in most situations, but not in all.

*** Illegal hex digit error

The .BI or .HS directives report this error when they stumble over a character other than a hexadecimal digit. Legal hexadecimal digits are the numbers 0 to 9 and the letters A to F.

*** Illegal label declaration error

You try to declare a label on a program line containing the .EL or .FI directives. The label field of such program lines should remain empty.

*** Illegal mnemonic error

The maximum length of mnemonics in the SB-Assembler is 10 characters. You typed more than 10 characters so it can't possibly be a mnemonic.

*** Illegal or missing Macro name error

You try to define a Macro using the .MA directive. But the SB-Assembler could not find a legal macro name on that line. Macro names should start with a letter from A to Z. The macro name is expected in the label field, or optionally in the operand field.

*** Incompatible Cross Overlay version number error

The SB-Assembler tried to use an out dated Cross Overlay. I try to keep overlay files backwards compatible as much as I can. But this is not always possible for major release changes. Download the latest version of the SB-Assembler if you get this error message.

*** Label not a constant error

You try to redefine a label's value automatically or by using the .EQ directive that originally was declared using the .SE directive.
Once a label is declared as a variable it cannot be changed to a constant any more.

*** Label not a variable error

You try to redefine a label's value by using the .SE directive that originally was declared automatically or by using the .EQ directive.
Once a label is declared as a constant it cannot be changed to a variable any more.

*** Macro definition not terminated error

The end of the source file was encountered during the definition of a Macro. Macro definitions can not span multiple source files.

*** Missing .DO error

The SB-Assembler finds a program line containing the .EL or .FI directive, while no pending .DO is active.

*** Missing .MA directive error

The SB-Assembler finds the .EM directive in your program while you were not defining a macro with the .MA directive.

*** Missing file name error

The directive you used expected to find a file name in the operand field. Give it a break and provide for one.

*** Missing global label error

You tried to define a Local label while you never declared a Global label yet. This error is also reported directly after the definition of a macro or the first declaration of a variable by using the .SE directive. You should declare at least one Global label before you can use Local labels again.

*** Missing hex string error

No, or no legal string of hexadecimal bytes was found in the operand field of the .HS directive.

*** Missing label error

The directive expected to find a label name in the label field, but couldn't find one.

*** Missing or illegal file name error

The directive requires a file name in the operand field. No file name, or a file name that is not MS-DOS compatible was given.

*** Nested include error

You tried to open a new .INclude file or .BInary include file from within an other .INclude file. Include file nesting is not allowed with the SB-Assembler.

*** No comment block error

The .EC directive was encountered without a matching .CO directive.

*** No Cross Assembler overlay loaded error

The SB-Assembler tried to decipher a mnemonic while there was no Cross Overlay loaded into the SB-Assembler. Please use the .CR directive to load the appropriate Cross Overlay.

*** No Macro expanding error

The .XM directive was found outside a macro expansion. The .XM directive can only be used from within a macro definition.

*** Not implemented in MS-DOS version error

The .TA directive can not be used on a PC because the SB-Assembler can't produce 8086 code.

*** Open error

The SB-Assembler did not succeed in opening an important file, for various reasons.

*** Operand expected error

The SB-Assembler expected to find an operand in the operand field, but could not find one.

*** Overflow error

A constant number in any of the available radixes (not an expression!) was larger than 32 bits. Values larger than $FFFFFFFF result in this error message.
Please note that expressions will never generate an Overflow Error!

*** Path not found error

The path you provided was not found while accessing an important file.

*** Range error

The expression in the operand field produced a number out of the expected range. Please consult the particular directive or mnemonic that caused this error and check the allowed range.

*** Read error

An MS-DOS read error was reported to the SB-Assembler when accessing a file. Probably you have a damaged disk.

*** String not terminated error

You did not terminate the string with the same delimiter you started the string with.

*** Symbol file already open error

The .SF directive tried to open a symbol table for the 2nd time in your program, which is not allowed.

*** Symbol table full error

Although the SB-Assembler has very modest memory requirements you managed to fill the whole free MS-DOS conventional memory below 640k. If you're running under windows and have your DOS based text editor running in the same dos box you better start your editor in a separate dos box to leave more memory free for the SB-Assembler.

*** Target address out of range error

Your program has grown to a size that can't be handled by the current target file format any more. Please use a different format or resize or relocate your program

*** Undefined label error

This error is reported during pass 2 if you used a label that was never declared during pass 1. This error is not reported during pass 1 because the label could be forward referenced.

*** Undefined Macro error

You tried to expand a macro that was not declared. Perhaps you miss-typed its name. Macros can't be forward referenced!

*** Unknown directive error

The instruction field started with a dot, but doesn't contain a legal directive name.

*** Unknown file format error

The .BI directive was fed with a file that did not contain data according to the selected file format.

*** User error

This error was forced by the .ER directive.

*** Value expected error

The SB-Assembler expected to find a value in the operand field, but could not find one.

Error Levels (Version 3)

A program can produce an error level, which can be used by a calling script to act upon when the program exits. Version 3 of the SB-Assembler can exit with one of the following exit levels:

0 Exit without errors
1 One or more non-fatal errors found during pass 1
2 One or more non-fatal errors found during pass 2
4 Assembly quit by user
5 The program terminated because of a fatal error
6 Fatal error. Wrong Python version is used.

Error Levels (Version 2)

Every MS-Dos program will report an error level to the system when it exits. This error level could be used in a batch file to act appropriately to different exit reasons.
The SB-Assembler generates the following error levels:

00 Exit without errors
01 One or more non-fatal errors found during pass 1
02 One or more non-fatal errors found during pass 2
03 Syntax error found on command line, or help was requested
04 The user stopped the SB-Assembler with the ESC key
05 The program terminated because of a fatal error
06 Out of memory
07 DOS version is too old