From d9a2298c7619103739e85b63d1d6a0bc72e5384c Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Thu, 12 Jun 2014 22:36:24 -0700 Subject: [PATCH] Update Architecture.md --- doc/Architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Architecture.md b/doc/Architecture.md index 644b17c..2f1183f 100644 --- a/doc/Architecture.md +++ b/doc/Architecture.md @@ -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