In my ongoing quest to understand the possibilities (and possible limitations) of parrot, here's another one. ;-)
How close a mapping can there be between regular (x86 in this example) assembly (as generated by c-compilation) and pasm?
I can't figure out if the stack ops can approximate this kind of thing.


Issues I don't understand are inline in the assembly.

-------------------test.c---------------------
int main(){
int i=5;
i++;
}
-----------------test.s------------
main:
pushl %ebp
movl %esp, %ebp
subl $8, %esp ; Is there a stack pointer to move?
andl $-16, %esp
movl $0, %eax
subl %eax, %esp
movl $5, -4(%ebp) ; Is there any analogue to bit/byte sized offsets?
leal -4(%ebp), %eax ; Or is the granularity strictly at the "item" level?
incl (%eax) ; can you modify an element on the stack in place?
leave
ret



-Tupshin


Reply via email to