You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

C64 Mini BASIC编程遇“? Out of data error in 60”错误求助

Fixing the "? Out of data error in 60" in Your C64 Mini Duel Program

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

  1. Recover the missing DATA statements
    The original "Duel" program from 60 Commodore 64 Programming Projects includes a long list of DATA lines 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.

  2. Add the DATA lines to your program
    Insert the full set of DATA statements 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 each DATA line contains comma-separated integers between 0 and 255 (valid C64 byte values).

  3. Verify the count matches
    Double-check that the number of values in your DATA lines 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).

  4. Check for C64 Mini compatibility
    The C64 Mini's BASIC should handle standard C64 code fine, but ensure none of the DATA values 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

火山引擎 最新活动