Code Generation/Example 4
From Wiki**3
< Code Generation
The Original Code
Consider the following C function:
<c> extern int printf(const char *format, ...); int printlist(int lo, int hi) {
int ix = lo;
while (ix < hi) {
printf("%d\n", ix);
ix++;
}
return ix;
} </c>
Postfix Code
The Postfix code for the above function is as follows:
| Postfix code |
|---|
| {{{2}}} |
Compiling and Running
To compile the Postfix code directly, pf2asm can be used:
- pf2asm while.pf
- yasm -felf while.asm