e01.org

Zero page

The zero page or base page is the block of memory at the very beginning of a computer's address space; that is, the page whose starting address is zero. The size of a page depends on the context, and the significance of zero page memory versus higher addressed memory is highly dependent on machine architecture. For example, the Motorola 6800 and MOS Technology 6502 processor families treat the first 256 bytes of memory specially, whereas many other processors do not. Unlike more modern hardware, in the 1970s computer RAM speed was similar to that of CPUs. Thus it made sense to have few registers and use the main memory as an extended pool of extra registers. In machines with a relatively wide 16-bit address bus and comparatively narrow 8-bit data bus, calculating an address in memory could take several cycles. The zero page's one-byte address was smaller and therefore faster to read and calculate than other locations, making the zero page useful for high-performance code. Zero page...

The zero page or base page is the block of memory at the very beginning of a computer's address space; that is, the page whose starting address is zero. The size of a page depends on the context, and the significance of zero page memory versus higher addressed memory is highly dependent on machine architecture. For example, the Motorola 6800 and MOS Technology 6502 processor families treat the first 256 bytes of memory specially, whereas many other processors do not. Unlike more modern hardware, in the 1970s computer RAM speed was similar to that of CPUs. Thus it made sense to have few registers and use the main memory as an extended pool of extra registers. In machines with a relatively wide 16-bit address bus and comparatively narrow 8-bit data bus, calculating an address in memory could take several cycles. The zero page's one-byte address was smaller and therefore faster to read and calculate than other locations, making the zero page useful for high-performance code. Zero page addressing now has mostly historical significance, since the developments in integrated circuit technology have made adding more registers to a CPU less expensive and CPU operations much faster than RAM accesses. LDA $12 ; zero page addressing LDA $0012 ; absolute addressing In 6502 assembly language, the above two instructions both accomplish the same thing: they load the value of memory location $12 into the .A (accumulator) register ( $ is Motorola/MOS Technology assembly language notation for a hexadecimal number). However, the first instruction is only two bytes long and requires three clock cycles to complete. The second instruction is three bytes in length and requires four clock cycles to execute. This difference in execution time could become significant in repetitive code. Some processors, such as the Motorola 6809 and the aforementioned WDC 65C816, implement a “direct page register” ( DP ) that tells the processor the starting address in RAM of what is considered to be zero page. In this context, zero page addressing is notional; the actual access would not be to the physical zero page if DP is loaded with some address other than $00 (or $0000 in the case of the 65C816).

References

  1. ^ "4.1 Crossing Page Boundaries". MCS-4 Assembly Language Programming Manual - The INTELLEC 4 Microcomputer System Programming Manual (PDF) (Preliminary ed.). Santa Clara, California, USA: Intel Corporation . December 1973. pp. 2-4, 2-14, 3-41, 4-1. MCS-030-1273-1. Archived (PDF) from the original on 2020-03-01 . Retrieved 2020-03-02 . […] certain instructions function differently when located in the last byte (or bytes) of a page than when located elsewhere. […] Two addresses are on the same page if the highest order hexadecimal digit of their addresses are equal. […] If the JIN instruction is located in the last location of a page in memory, the highest 4 bits of the program counter are incremented by one, causing control to be transferred to the corresponding location on the next page. […] If […] the JIN had been located at address 255 decimal (0FF hexadecimai), control would have been transferred to address 115 hexadecimal, not 015 hexadecimal. This is dangerous programming practice, and should be avoided whenever possible. […] programs are held in either ROM or program RAM, both of which are divided into pages. Each page consists of 256 8-bit locations. Addresses 0 through 255 comprise the first page, 256-511 comprise the second page, and so on. In general, it is good programming practice to never allow program flow to cross a page boundary except by using a JUN or JMS instruction. […] Wikipedia revision 1323008045, retrieved 2026-11-20 · 1583103600.0
  2. ^ Sjödin, Tomas; Jonsson, Johan (2006). Student Papers in Computer Architecture (PDF) . Umeå, Sweden. p. 29. S2CID 14355431 . Archived from the original (PDF) on 2019-03-09 . Retrieved 2019-08-21 . {{ cite book }} : CS1 maint: location missing publisher ( link ) Wikipedia revision 1323008045, retrieved 2026-11-20 · 1566342000.0
  3. ^ "ARM 'security hole' is ofla cousin" . drobe.co.uk. 2007-04-24. Archived from the original on 2011-05-14 . Retrieved 2008-10-22 . Wikipedia revision 1323008045, retrieved 2026-11-20 · 1224630000.0
  4. ^ "Managing Virtual Memory" . Microsoft . 2014-12-05 . Retrieved 2014-12-05 . Wikipedia revision 1323008045, retrieved 2026-11-20 · 1417734000.0
  5. Zero page. https://en.wikipedia.org/w/index.php?oldid=1323008045 · 1795438144.7002156
source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Zero page". 1763518280. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1323008045

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·