문제

Been working on an assembly assignment, and for the most part I understand assembly pretty well. Or well at least well enough for this assignment. But this mov statement is tripping me up. I would really appreciate if someone could just explain how this mov statement is manipulating the register values.

mov (%ebx,%eax,4),%eax

P.S. I wasnt able to find this specific type of mov statement by basic searches, so I appologize if I just missed it and am re asking questions.

도움이 되었습니까?

해결책

The complete memory addressing mode format in AT&T assembly is:

offset(base, index, width)

So for your case:

offset = 0
base = ebx
index = eax
width = 4

Meaning that the instruction is something like:

eax = *(uint32_t *)((uint8_t *)ebx + eax * 4 + 0)

In a C-like pseudocode.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top