# 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:

- Software Requirements for Low Memory Detection
- 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:

1. Run your application from the Debugger on the machine with the low memory detection board.

2. Make sure you have the following windows open:

   - Terminal window
   - Disassembly window
   - Register window
   - Source window
3. If you can test all parts of your application with no problem, no additional action is necessary.

4. 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.

5. You can now note of the problem location for later correction and attempt to continue from the Debugger, repeating that process until you have found all instances of low memory access. In some cases, for example, if the access happens during a loop, you may have to fix one problem and recompile your application before you can continue.