Is there a way to specify to GPC, or for GPC to specify to AS, to reference Object fields (variables) using the stack rather than registers? The reason I ask is because my libs won't work as intended when variables are referenced via clobbered registers. I'm weary of making these variables globals because I intend to make them thread safe (somehow) eventually and owuld like each instance to have its own copy of the variables. Thanks in advance!
See ya! Orlando Llanes
"Meine Damen und Herren, Elvis hat soeben das Gebaeude verlassen!"
"Look out fo' flyeeng feet" O__/ a010111t@bc.seflin.org /|____. O <__. /> / \ ____________|_________ http://ourworld.compuserve.com/homepages/Monkey414
According to Orlando Llanes:
Is there a way to specify to GPC, or for GPC to specify to AS, to
reference Object fields (variables) using the stack rather than registers?
Object fields are stored in memory - usually on the heap - and not in registers. Perhaps you are referring to parameter passing, especially passing the implicit `Self' parameter through the stack rather than a register? Normally, GPC should behave according to your needs.
What about the following: Write a dummy for your asm routine in a Pascal unit and compile it with -S, so you can see how GPC passes the parameters and can do it in a similar - but of course much better ;-) way.
Hope this helps,
Peter
Frank: Sorry 'bout my rambling :} What I want to do is to reference all the variables declared in an object via the stack.
Peter: I did dump a -S, but the problem is that the prolog code sets a couple of registers to the address of the Self parameter, then later on in my routine, when I try to access the variable, it points to an invalid location in memory, because the register that was set with the address is now pointing into space (my routine modifies all of the registers).
Thanks for the info Frank and Peter! I decided to use globals to make copies of important variables so that I can access them directly with no need for registers. I was just wondering if there was a way around it :}
See ya! Orlando Llanes
"Meine Damen und Herren, Elvis hat soeben das Gebaeude verlassen!"
"Look out fo' flyeeng feet" O__/ a010111t@bc.seflin.org /|____. O <__. /> / \ ____________|_________ http://ourworld.compuserve.com/homepages/Monkey414