Zero page

Zero page

The zero page is the series of memory addresses at the absolute 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 MOS Technology 6502 processor treats the first 256 bytes of memory specially, whereas many other processors do not.

The actual size of zero page in bytes is determined by the microprocessor design and in older designs, is often equal to the largest value that can be referenced by the processor's indexing registers. For example, the aforementioned 6502's index registers' size is 8 bits and the page size is 256 bytes. Therefore, zero page extends from address 0 to address 255.

In early computers, including the PDP-8, the zero page had a special fast addressing mode, which facilitated its use for temporary storage of data and compensated for the relative shortage of CPU registers. The PDP-8 had only one register, so zero page addressing was essential.

Possibly unimaginable by computer users after the 1980s, computer RAM used to be faster than or as fast as the CPU during the 1970s. Thus it made sense to have few registers and use the main memory as an extended pool of extra registers. Since each memory location within the zero page of a 16-bit address bus computer may be addressed by a single byte, it was faster, in 8-bit data bus machines, to access such a location rather than a non-zero page location.

For example, the MOS Technology 6502 has only one general purpose register (the accumulator). As a result, it used the zero page extensively. Many instructions are coded differently for zero page and non-zero page addresses:

LDA $00 ; zero page LDA $0000 ; non-zero page

The above two instructions both accomplish the same thing: they load the value of memory location $00 into the .A register (accumulator). 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. Obviously, the difference in execution time could significantly improve performance in repetitive 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 have made CPU operations much faster than RAM accesses. Some computer architectures still reserve the beginning of address space for other purposes, though; for instance, the Intel x86 systems reserve the first 512 words of address space for the interrupt table if it runs in realmode.

In fact, quite contrary to the zero page's original preferential use, some modern operating systems such as Linux and Microsoft Windows actually make the zero page inaccessible to trap uses of NULL pointers. This is useful, as NULL pointers are the method used to represent the value of a reference that points to nothing. Since code operating on a reference will be written assuming it that the reference actually refers to some valid structure or value, catching the case where the reference points to nothing is of use since it is a sure sign of a bug.

CP/M

In 8-bit CP/M, the zero page is used for communication between the running program and the operating system. See Zero page (CP/M) for more information.

References

* Bray, Andrew C., Dickens, Adrian C. and Holmes BA, Mark A. (1983 - third edition). "The Advanced User Guide for the BBC Microcomputer". The Cambridge Microcomputer Centre. ISBN 0-946827-00-1


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Zero Page — Zero Page,   ein Bereich von 256 Byte Umfang, der sich bei verschiedenen Mikroprozessoren, z. B. 6502 oder 6510, am Anfang des Adressbereichs befand. Dieser Bereich konnte von dem Prozessor besonders schnell angesprochen werden und wurde daher… …   Universal-Lexikon

  • Zero page (CP/M) — The Zero Page (or Base Page) is a data structure used in CP/M systems for programs to communicate with the operating system. In 8 bit CP/M versions it is located in the first 256 bytes of memory, hence its name.The equivalent structure in MS DOS… …   Wikipedia

  • Zéro — Pour les articles homonymes, voir Zéro (homonymie). Le chiffre zéro (de l’italien zero, dérivé de l’arabe sifr, d’abord transcrit zefiro en italien) est un symbole marquant une position vide dans l’écriture des nombres en notation positionnelle.… …   Wikipédia en Français

  • Zéro (homonymie) — Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom. Sur les autres projets Wikimedia : « Zéro (homonymie) », sur le Wiktionnaire (dictionnaire universel) Sommaire …   Wikipédia en Français

  • Zero — Zéro (homonymie) Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom …   Wikipédia en Français

  • Zero (homonymie) — Zéro (homonymie) Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom …   Wikipédia en Français

  • Zero-knowledge web application — Zero knowledge web applications are a special kind of online services that were defined and introduced by the development team at [http://www.clipperz.com Clipperz] in 2006. They dubbed their online password manager the first zero knowledge web… …   Wikipedia

  • Zéro absolu — Cet article concerne une notion de physique. Pour la bande dessinée, voir Zéro absolu (bande dessinée). Pour les articles homonymes, voir Zéro (homonymie) et Absolu. Le zéro absolu est la température la plus basse qui puisse exister dans l… …   Wikipédia en Français

  • Zero Halliburton — was originally a metal fabrication company called Zierold Company, which in 1946 changed its name to Zero Corporation. In 1952 Zero, which until then had no relation to Halliburton, bought the luggage division of Halliburton, the Texas oilfield… …   Wikipedia

  • Zero d'Akutan — Pour les articles homonymes, voir Akutan. Le Zero d Akutan inspecté par des militaires sur l île Akutan le 11 juillet  …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”