Direct Page: Difference between revisions
Runic Rain (talk | contribs) mNo edit summary |
(→Reference: pluralize) |
||
(18 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
The '''Direct Page''' is much like the [[zeropage]] on the 6502, but can be moved around to anywhere within the first 64K [[bank]]. | The '''Direct Page''' (DP) is much like the [[zeropage]] on the 6502, but can be moved around to anywhere within the first 64K [[bank]]. | ||
It is technically, as its namesake, the 256 bytes accessible via '''Direct Page Addressing''', and has special handling of wrapping behavior. | It is technically, as its namesake, the 256 bytes accessible via '''Direct Page Addressing''', and has special handling of wrapping behavior. | ||
Colloquial usage of this term will invariably refer to the '''Direct Page Register''' itself and by extension the group of Direct addressing modes it affects, due to the other addressing modes not being limited to 256 bytes. | Colloquial usage of this term will invariably refer to the '''[[Direct Page Register]]''' itself and by extension the group of Direct addressing modes it affects, due to the other addressing modes not being limited to 256 bytes. | ||
The wrapping behavior will ''always'' confine it to Bank 0, but if in emulation | The wrapping behavior will ''always'' confine it to Bank 0, but if in [[emulation mode]] will also confine it to the [[zeropage]] when both DL and DH are zero or a single bank 0 page when DL is zero (see case A of [2]). | ||
The direct page may overlap the [[stack]].<sup>[4]</sup> | |||
There are two ways to relocate the direct page:<sup>[1]</sup> | |||
* [[PLD]] - pulling the new location off the stack | |||
* [[TCD]] - using the accumulator's value as the new location | |||
It is possible to relocate the direct page even in emulation mode, and instructions that used [[zero page addressing]] on the 6502 will still add the value of the direct page register in when computing the effective address. Unfortunately TXD, TYD, and TSD do not exist. Neither do TDX or TDY. | |||
[[File:dp.png]] | |||
On the [[SPC700]], the direct page can only be in one of two places: either coincident with page zero or page one. | On the [[SPC700]], the direct page can only be in one of two places: either coincident with page zero or page one. | ||
Line 8: | Line 19: | ||
=== See Also === | === See Also === | ||
* [[PHD]] | * [[PHD]] | ||
* [[TDC]] | * [[TDC]] | ||
* [[Direct Page Flag]] | * [[Direct Page Flag]] | ||
Line 16: | Line 25: | ||
* [[Uppermost Page]] | * [[Uppermost Page]] | ||
=== | === References === | ||
# [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/198 page 198] | |||
# Clark, Bruce. [[6502 Reference]] 5.1.1, http://www.6502.org/tutorials/65c816opcodes.html#5.1.1 | |||
# Clark, Bruce. [[6502 Reference]] 5.1.2, http://www.6502.org/tutorials/65c816opcodes.html#5.1.2 | |||
# https://wilsonminesco.com/816myths | |||
[[Category:ASM]] | [[Category:ASM]] | ||
[[Category:65c816 additions]] | [[Category:65c816 additions]] |
Latest revision as of 04:54, 24 September 2024
The Direct Page (DP) is much like the zeropage on the 6502, but can be moved around to anywhere within the first 64K bank. It is technically, as its namesake, the 256 bytes accessible via Direct Page Addressing, and has special handling of wrapping behavior. Colloquial usage of this term will invariably refer to the Direct Page Register itself and by extension the group of Direct addressing modes it affects, due to the other addressing modes not being limited to 256 bytes. The wrapping behavior will always confine it to Bank 0, but if in emulation mode will also confine it to the zeropage when both DL and DH are zero or a single bank 0 page when DL is zero (see case A of [2]).
The direct page may overlap the stack.[4]
There are two ways to relocate the direct page:[1]
- PLD - pulling the new location off the stack
- TCD - using the accumulator's value as the new location
It is possible to relocate the direct page even in emulation mode, and instructions that used zero page addressing on the 6502 will still add the value of the direct page register in when computing the effective address. Unfortunately TXD, TYD, and TSD do not exist. Neither do TDX or TDY.
On the SPC700, the direct page can only be in one of two places: either coincident with page zero or page one.
See Also
References
- Eyes & Lichty, page 198
- Clark, Bruce. 6502 Reference 5.1.1, http://www.6502.org/tutorials/65c816opcodes.html#5.1.1
- Clark, Bruce. 6502 Reference 5.1.2, http://www.6502.org/tutorials/65c816opcodes.html#5.1.2
- https://wilsonminesco.com/816myths