Jump to content

Glossary: Difference between revisions

Added stack-related stuff.
>Bbbbbbbbba
m (Bbbbbbbbba moved page User:Bbbbbbbbba/Glossary to Glossary: This glossary is still very incomplete, but hopefully we can add to it gradually; in the meantime, some pages might benefit from being able to link here.)
>Bbbbbbbbba
(Added stack-related stuff.)
Line 59:
:''See: [[unstable hybrid Pokémon]]''
:In Generation I and II, the second of two bytes determining the species of a Pokémon. It is the first byte of a Pokémon's main data. Also known as the "recipient" byte.
 
;{{Anchor|Stack}}'''Stack'''
:1. A data structure with a "last in, first out" semantic, supporting <code>push</code> and <code>pop</code> as the primary operations.
:2. Specifically, a hardware-implemented stack in the CPU. Notably, the instructions <code>call</code> and <code>ret</code> are implemented using this stack: <code>call</code> pushes the program counter to the stack as a "return address", and <code>ret</code> jumps to an address popped from the stack. The stack is also often used to save the value of registers that would be overwritten by some other computation, especially another function called.
 
;{{Anchor|Stack corruption}}'''Stack corruption'''
:Memory corruption in the [[#Stack|stack]] area. This kind of corruption is usually highly disruptive to the execution flow because it may easily change return addresses on the stack, causing <code>ret</code> instructions to jump to unintended addresses. As a result, it is likely to crash the game, but when controlled it can also be used for many exploits, including [[arbitrary code execution]].
 
;{{Anchor|Stack pointer}}'''Stack pointer'''
:A special-purpose register that points to the topmost entry of the [[#Stack|stack]]. In the GB CPU, the stack pointer is named <code>sp</code>, and it is decreased by 2 (since the stack entries are 2-byte numbers) for each <code>push</code>, and increased by 2 for each <code>pop</code>.
 
;{{Anchor|Terminator}}'''Terminator'''
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.