Ad Space — Top Banner

Memory full

Amstrad Amstrad CPC

Severity: Moderate

What Does This Error Mean?

Memory full on the Amstrad CPC means your BASIC program has used all available RAM. The CPC 464 has 64KB total but only about 42KB is available for BASIC programs after the system, screen memory, and firmware take their share. Shorten your program or reduce data to free memory.

Affected Models

  • Amstrad CPC 464
  • Amstrad CPC 664
  • Amstrad CPC 6128
  • Amstrad CPC Plus
  • WinAPE emulator
  • Arnold emulator

Common Causes

  • Program code too large for available memory
  • Large arrays or many string variables consuming RAM
  • Screen mode using more memory than necessary (MODE 0 uses most)
  • Machine code or data loaded into BASIC's memory area
  • HIMEM set too low, reducing available BASIC space

How to Fix It

  1. Type PRINT FRE(0) to check available free memory.

    FRE(0) shows remaining bytes. If the number is very small, your program is at the limit.

  2. Remove REM statements and shorten variable names.

    REM lines and long variable names all use memory. Removing comments can free a surprising amount of space on a 64KB machine.

  3. Use MODE 2 (80-column) to save screen memory.

    MODE 0 (20 columns, 16 colours) uses 16KB for screen memory. MODE 1 (40 columns, 4 colours) also uses 16KB. MODE 2 (80 columns, 2 colours) uses 16KB too — but you can reclaim screen memory with HIMEM if your program does not need graphics.

  4. Use SYMBOL AFTER 256 to reclaim character definition memory.

    By default, the CPC reserves memory for redefining character shapes. SYMBOL AFTER 256 tells the system you will not redefine any characters, freeing about 2KB.

  5. On the CPC 6128: use bank switching to store data in the extra 64KB.

    The CPC 6128 has 128KB but BASIC can only use 64KB directly. You can use OUT commands or firmware calls to bank-switch the extra 64KB for data storage.

Frequently Asked Questions

How much memory is available for BASIC on the Amstrad CPC?

The CPC 464 and 664 have about 42KB free for BASIC programs after the operating system, firmware, and screen memory. The CPC 6128 has the same 42KB for BASIC in the main bank, plus 64KB of banked memory accessible through system calls.

Why did Amstrad choose 64KB when the Commodore 64 also had 64KB?

64KB was the maximum the Z80 CPU could directly address. Both machines used the same memory limit, but the CPC gave more free RAM to BASIC (42KB vs 38KB) because Locomotive BASIC and the CPC firmware were more efficiently designed.