Search code examples
assemblymemoryx86global-variablescpu-architecture

x86 Assembly Programming (GAS Syntax): What reigsters are the variables defined in the data section stored in?


When I define the variables in the .data section such as the following:

.data
    a:
        .long 55

    b:
        .long 43

Which register(s) are a and b stored in (regarding the x86 computer architecture)?

enter image description here


Solution

  • None of them. They're stored in memory instead, and if you need them in a register, then you have to move their values there yourself.