mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-23 14:30:48 +00:00
Update Architecture.md
This commit is contained in:
parent
8c967e6fe0
commit
d9a2298c76
@ -16,7 +16,7 @@ Function calls use the call stack to save the return address of the calling code
|
||||
#### The Local Frame Stack
|
||||
One of the biggest problems to overcome with the 6502 is its very small hardware stack. Algorithms that incorporate recursive procedure calls are very difficult or slow on the 6502. PLASMA takes the middle ground when implementing local frames; a frame pointer on the zero page is indirectly indexed by the Y register. Because the Y register is only eight bits, the local frame size is limited to 256 bytes. 256 bytes really is sufficient for all but the most complex of functions. With a little creative use of dynamic memory allocation, almost anything can be implemented without undue hassle. When a function with parameters is called, the first order of business is to allocate the frame, copy the parameters off the evaluation stack into local variables, and save a link to the previous frame. This is all done automatically with the ENTER opcode. The reverse takes place with the LEAVE opcode when the function exits. Functions that have neither parameters or local variables can forgoe the frame build/destroy process.
|
||||
|
||||
### The Byecodes
|
||||
### The Bytecodes
|
||||
The compact code representation comes through the use of opcodes closely matched to the PLASMA compiler. They are:
|
||||
|
||||
| OPCODE | Description
|
||||
|
Loading…
x
Reference in New Issue
Block a user