20-bit addressing for the 6502
Posted: Fri Dec 05, 2014 8:06 pm
Today I came across a description of the Apple III's memory system, and found that in addition to a fairly conventional banking system to expand memory beyond 64k, it also offers
- relocatable page zero and stack (both relocations are coupled)
- (zp),y accesses can fetch a third pointer byte from a specific page to offer 24-bit addressing (only 20 bits implemented)
The extra byte of pointer fetch doesn't cost an extra cycle, because the RAM is organised to fetch related pairs of bytes already, for purposes of video output.
Although the address mangling must cost some time in each access, the 1981-era system is only running at 2MHz so no extra cycles are needed.
More detail can be found at
http://apple3.org/Documents/Magazines/A ... ssing.html
and
https://archive.org/stream/apple3_Info_ ... 0/mode/2up
https://archive.org/stream/BankSwitchRa ... /mode/2up
(as seen in our mos6502 post this week archived here. And the slightly upstream article here.)
(Acorn did something similar in their in-house Turbo second processor, but took an extra cycle for the fetch of the third pointer byte:
viewtopic.php?f=4&t=1465
)
Edit: link rot!
- relocatable page zero and stack (both relocations are coupled)
- (zp),y accesses can fetch a third pointer byte from a specific page to offer 24-bit addressing (only 20 bits implemented)
The extra byte of pointer fetch doesn't cost an extra cycle, because the RAM is organised to fetch related pairs of bytes already, for purposes of video output.
Although the address mangling must cost some time in each access, the 1981-era system is only running at 2MHz so no extra cycles are needed.
More detail can be found at
http://apple3.org/Documents/Magazines/A ... ssing.html
and
https://archive.org/stream/apple3_Info_ ... 0/mode/2up
https://archive.org/stream/BankSwitchRa ... /mode/2up
(as seen in our mos6502 post this week archived here. And the slightly upstream article here.)
(Acorn did something similar in their in-house Turbo second processor, but took an extra cycle for the fetch of the third pointer byte:
viewtopic.php?f=4&t=1465
)
Edit: link rot!