Ad Space — Top Banner

?FC ERROR

Tandy / Radio Shack TRS-80

Severity: Minor

What Does This Error Mean?

?FC ERROR means Illegal Function Call — you passed an argument outside the valid range to a BASIC function or command. For example, CHR$(300) or POKE with an address beyond the valid range. Check the function's requirements and fix the input value.

Affected Models

  • TRS-80 Model I
  • TRS-80 Model II
  • TRS-80 Model III
  • TRS-80 Model 4
  • TRS-80 Color Computer (CoCo)
  • MAME TRS-80 emulator
  • trs80gp emulator

Common Causes

  • CHR$() with a value below 0 or above 255
  • POKE address outside valid memory range
  • MID$, LEFT$, or RIGHT$ with a negative length or start position
  • COLOR or SET command with an out-of-range value
  • Mathematical function given an invalid argument (e.g. SQR of a negative number)

How to Fix It

  1. Check the value you are passing to the function.

    Each function has a valid range: CHR$() accepts 0-255. SQR() only accepts non-negative numbers. MID$(A$, start, length) needs start >= 1 and length >= 0.

  2. Add a bounds check before the function call.

    Before CHR$(X), add: IF X < 0 OR X > 255 THEN PRINT "VALUE OUT OF RANGE" : STOP This catches the problem before it causes ?FC ERROR.

  3. Check that variables have not overflowed due to calculations.

    If a loop or formula produces a value outside the expected range, the function call at the end will fail. Add a PRINT statement before the failing line to see the actual value.

  4. For graphics commands (SET, RESET, COLOR): check coordinate and colour ranges.

    On the Model I/III, SET(X,Y) uses X from 0 to 127 and Y from 0 to 47. On the CoCo, PMODE graphics have different coordinate ranges depending on the mode.

Frequently Asked Questions

What does FC stand for in ?FC ERROR?

FC stands for Function Call. The full meaning is Illegal Function Call. The TRS-80 uses two-letter abbreviations for all error messages to save ROM space — ?SN for Syntax, ?OM for Out of Memory, ?FC for Function Call, and so on.

Are TRS-80 error codes the same on all models?

The Model I (Level II), Model III, and Model 4 share the same Microsoft BASIC error codes. The Color Computer also uses Microsoft BASIC but has additional graphics-related errors. Level I BASIC on the early Model I has a completely different, much simpler error system.