I am struggling to get global variables to work correctly for my Y86 assignment. Unfortunately the only examples we were provided with are in IA-32 assembly. I have searched f
irmovl
as the name says is immediate to register.
You want mrmovl
as that is memory to register.
As for the syntax, since y86 does support displacement, I would expect mrmovl x, %edx
to work. You say it doesn't, as a workaround you could use 2 instructions:
irmovl x, %edx # load address
mrmovl (%edx), %edx # fetch value