Compiler/code generator: Difference between revisions
m
→{{header|ALGOL 68}}
(→{{header|ALGOL 68}}: Added some notes.) |
|||
Line 262:
Based on the Algol W sample. This generates .NET IL assembler code which can be compiled with the .NET ilasm assembler to generate an exe that can be run under Windows (and presumably Mono though I haven't tried that).
<br>
Apart from the namespace, class and method blocks surrounding the code, the main differences between IL and the task's assembly code are: no "compare-le", "compare-ge", "compare-ne", "prts", "prtc", "prti" and "not" instructions, symbolic labels are used and symbolic local variable names can be used. Some IL instructions have different names, e.g. "stloc" instead of "store". The "prt*" instructions are handled by calling the relevant System.Out.Print method. The compare and "not" instructions are handled by generating equivalent instruction sequences
<br>
As noted in the code, the generated IL is naive - the sample focuses on simplicity.
<lang algol68># RC Compiler code generator #
COMMENT
|