Contents
Page-10
Prev
Next
Page+10
Index
Code Generation for Statements
The function genc(code) generates
code for a statement. There are
only a few kinds of statements:
- PROGN
For each argument statement, generate code.
- :=
Generate the right-hand side into a register using
genarith. Then store the register into the location
specified by the left-hand side.
- GOTO
Generate a Jump (branch) to the label number.
- LABEL
Generate a Label with the label number.
- IF
(IF c p1 p2) can be compiled as:
IF c GOTO L1;
p2; GOTO L2; L1: p1; L2:
Optimizations are discussed later.
- FUNCALL
Compile short intrinsic functions in-line. For others,
generate subroutine calls.