Y86 assembly global variables

前端 未结 1 1962
灰色年华
灰色年华 2021-01-25 04:58

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

相关标签:
1条回答
  • 2021-01-25 05:05

    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
    
    0 讨论(0)
提交回复
热议问题