Can someone explain to me what this program does and how things change in it
.data
x: .long 15
.text
.global main
main:
movl $0, %eax
movl %eax, x
movl x, %ebx
mov $1, %eax
mov $0, %ebx
int $0x80
when I run it in the terminal it gives this
eax 0x5655618d 1448436109
ecx 0x33def597 870249879
edx 0xffffd100 -12032
ebx 0xf7fa4000 -134594560
esp 0xffffd0dc 0xffffd0dc
ebp 0xf7ffd020 0xf7ffd020 <_rtld_global>
esi 0xffffd194 -11884
edi 0xf7ffcb80 -134231168
eip 0x5655618d 0x5655618d <main>
eflags 0x246 [ PF ZF IF ]
cs 0x23 35
ss 0x2b 43
ds 0x2b 43
es 0x2b 43
fs 0x0 0
gs 0x63 99
I don't rly understand how values change when using the mov function.
movcopies the value from the register or memory address on the left to the register or memory address on the right. For example:After this sequence of instructions, both
%eaxand%ebxcontain 5.For a labeled address like
xin your example, since you have 15 at that address, that's the value that you'll load from there: