Tuesday, 15 April 2014

assembly - How do i store address in a register on x86 -



assembly - How do i store address in a register on x86 -

i have piece of code below:

.section .data myvar: .long 4,3,2,1 .section .text .globl _start _start: movl $0, %edi movl myvar(,%ed1,4), %eax movl $0, %ebx

i store address of lastly element of array "myvar" in ebx (which 1), how do ?

my mental compiler outputs intel syntax, not at&t's, should idea:

lea eax, myvar + 12

eax has address of '1' value.

assembly x86

No comments:

Post a Comment