====== Accessing Low Memory ====== ---- ==== What is it: ==== Accessing the low area of memory reserved for the system in inappropriate ways. This often, but not always, involves using the return value of a system or user function as the base address for a structure without checking whether that value was NULL. ==== Why it's bad: ==== Even though titles that access low memory may run without errors on the current 3DO player, they may not work on future hardware for two reasons: Hardware provided by different manufacturers may return different values upon low memory access. Even if a title accidentally makes the right decision based on the value returned from low memory on current hardware, the value returned from low memory will be different on future hardware. Future hardware or operating system releases may not allow low memory access at all. ==== What to do ==== Check your title for low memory access using a 3DO Station with a low memory board installed. ===== Example and Discussion ===== This section discusses: * [[:documentation:development:opera:pf25:ppgfldr:smmfldr:gspfldr:#xref34618|Software Requirements for Low Memory Detection]] * [[:documentation:development:opera:pf25:ppgfldr:smmfldr:gspfldr:#xref19366|The Detection Process]] ==== Software Requirements for Low Memory Detection ==== To detect and remove low memory pointers, you need the following: * A version of your application. You can work with a development version, a cdrom.image file, or a CD-ROM. * The symbols file for your program. You need this file to more easily understand where your program contains pointers to low memory. * The 3DO Debugger 1.9b5 or later. * The 3DO operating system 1.3.1 or later. ==== The Detection Process ==== With all required files available, go through the following steps:
If the program accesses low memory, it aborts at the area responsible with the following message:
''%%3DO Debug: Abort (Dat) = PC@address%%''
where ''%%address%%'' is the point in the program where the problem occurred.
If you now look at the Disassembly window and Register window, you are likely to find that the title stopped at a Register 0.
If you look at the Source window, you are likely to find an error return value. In most cases, that means you have to modify your source code to check for NULL.