You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Watched your presentation about assembly usage,
and dived into trying this stuff, most of it works
for me, but I have some problem:
I want to move SB - Static Base pointer
like this
MOVQ SB R1
but I get: illegal use of pseudo-register.... The same I have
with FP and PC and only SP "moves" well Now I know
I can access the data by var1+0(SB) but I want the actuall
address for further analysis.
Can you help here?
Thanks.
The text was updated successfully, but these errors were encountered:
SB isn't a real register and doesn't have a value (in Go assembly). Rather it is used to as a symbol to represent the base address for global variables. On amd64 (and I think most of the other architectures at this point) global variables will actually be accessed using relative addressing.
In general the pseudo (fake) registers (SB, FP, PC and in some circumstances SP) are used by the assembler to calculate addresses/offsets. There isn't any code in the assembler to materialize any of them directly except SP (a real register), which is why your moves fail. They are only usable in specific situations (with a variable for SB, an offset and a variable for FP, and with an instruction offset for PC).
Hi Michael,
Watched your presentation about assembly usage,
and dived into trying this stuff, most of it works
for me, but I have some problem:
I want to move SB - Static Base pointer
like this
but I get:
illegal use of pseudo-register...
. The same I havewith
FP
andPC
and onlySP
"moves" well Now I knowI can access the data by var1+0(SB) but I want the actuall
address for further analysis.
Can you help here?
Thanks.
The text was updated successfully, but these errors were encountered: