C64 Mini BASIC编程遇“? Out of data error in 60”错误求助
Let's break down what's causing this error and how to fix it quickly:
Why You're Seeing This Error
The ? Out of data error in Commodore BASIC means your program is trying to READ more values than exist in your DATA statements. Looking at your code:
- Line 50 runs a loop 30 times, each time reading a value with
READ A - Line 60 runs a loop 104 times (15247 - 15144 + 1 = 104), also using
READ A
That's a total of 134 values your program expects to read—but right now, there are no DATA lines anywhere in your code to supply those values. The program hits line 60, tries to read the remaining values, and can't find them, hence the error.
Step-by-Step Fixes
Recover the missing DATA statements
The original "Duel" program from 60 Commodore 64 Programming Projects includes a long list ofDATAlines that define the custom characters and game data you're trying to load in lines 50 and 60. You likely missed copying these lines from the book.Add the DATA lines to your program
Insert the full set ofDATAstatements at the end of your program (use a high line number like 1000 to keep them organized). For reference, the total number of values needed is 134—make sure eachDATAline contains comma-separated integers between 0 and 255 (valid C64 byte values).Verify the count matches
Double-check that the number of values in yourDATAlines adds up to 134. If you have fewer, you'll get the same error; if you have extra, the program will ignore the excess (but it's still good practice to match exactly).Check for C64 Mini compatibility
The C64 Mini's BASIC should handle standard C64 code fine, but ensure none of theDATAvalues are outside the 0-255 range, and that the memory pokes (like lines 10, 40, 50, 60) target valid C64 memory addresses (which they do in your code).
Quick Tip
If you can't locate the exact DATA lines from the book, you can search for the full "Duel" Commodore 64 BASIC code to get the missing entries—just make sure you're adhering to the book's copyright guidelines when doing so.
内容的提问来源于stack exchange,提问作者Selma123




