Memory address

The 6502 microprocessor has access to 65,536 memory locations. Each location is numbered from 1 to 65,536, however, they are almost always referred to in hexadecimal : $0000 to $FFFF. You can think of each memory location as a box that has an "address". By referring to the address, you can tell the 6502 to do things with the contents of the boxes. Each box can contain a number between 0 and 255, or $00 to $FF in hex.

The first 256 bytes of the 6502 memory are known as the zero page because all of their addresses could drop the first two bytes and be referred to only by their last. This saves one byte when referring to an address on the zero page, making it prime real estate.

Everything that the 6502 has access to is memory maped. This means that various parts of the memory are read and written to by other parts of the computer, and the 6502 communicates with them by checking the memory. For example — a joystick's button could be mapped to one memory location. To check if the button is pressed, the 6502 doesn't check the gamepad, it checks the memory address that it is mapped to.

Addressing

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.