Answer the question
In order to leave comments, you need to log in
Why doesn't the transfer of the array word to the register (gas syntax) work?
.data
arrayW: .word 5,10,15,20
.text
.globl _start
_start:
leaw arrayW, %si
movw (%si), %ax
pushl $0
subl $4, %esp
movl $1, %eax
int $0x80
.end
Answer the question
In order to leave comments, you need to log in
Why does not it work
leaw arrayW, %si movw (%si), %ax
leal arrayW, %esi
movw (%esi), %ax
$ gcc -m32 -static -nostartfiles load.s -o load
$ gdb ./load
(gdb) b _start
Breakpoint 1 at 0x8049000
(gdb) r
Starting program: /home/jcmvbkbc/tmp/toster/load
Breakpoint 1, 0x08049000 in _start ()
(gdb) si
0x08049006 in _start ()
(gdb)
0x08049009 in _start ()
(gdb) p/x $esi
$1 = 0x804a000
(gdb) p/x $ax
$2 = 0x5
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question