Code Generation: Difference between revisions

From Wiki**3

(New page: == Topics == * Interpretation: syntax-directed and based on abstract syntax tree. * Code generation: syntax-directed and based on abstract syntax tree. == The Postfix Machine == SL0 - si...)
 
(Redirected page to ist:Code Generation)
 
(50 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Topics ==
#REDIRECT [[ist:Code Generation]]
* Interpretation: syntax-directed and based on abstract syntax tree.
* Code generation: syntax-directed and based on abstract syntax tree.
 
== The Postfix Machine ==
 
SL0 - single stack, large stack, 0 (data) register machine.
 
Three special purpose registers: IP (instruction pointer), for jumps and function calls; FP (frame pointer), the basis of the frame pointer for each function; SP (stack pointer), keeps track of the top of the stack.
 
The stack grows in the direction of lower addresses.
 
Almost all operations use the stack as input and output (exceptions are PUSH and POP, for returning values from functions in accordance with CDecl), and instructions that use either immediate arguments or arguments in global memory (i.e., with explicit named addressing).
 
== Basic Structures (code) ==
 
=== While Cycles ===
 
=== "Break" and "Continue" Instructions ===
 
=== If-Then and If-Then-Else Instructions ===
 
== Basic Structures (data) ==
 
=== Functions ===
 
=== Global (permanent) variables ===
 
We include in this category C-like "static" function variables (the only difference is that they are not accessed with their explicit names, but rather with a automatic symbol table-based name).
 
=== Local variables ===
 
[[category:Compilers]]
[[actegory:Teaching]]

Latest revision as of 18:18, 6 December 2018