Consider the following C function:
<c> int *traverse(int vec[], int lim) {
int *ptr = vec + lim - 1, ix = lim - 2; while (ix >= 0) { ptr = (vec[ix] > *ptr) ? vec + ix : ptr; ix--; } return ptr;
} </c>
The Postfix code for the above function is as follows:
Postfix code |
---|
{{{2}}} |
To compile the Postfix code directly, pf2asm can be used:
pf2asm traverse.pf yasm -felf traverse.asm