Muten Roshi
Muten Roshi

Reputation: 513

assembler addressing in AT&T

Can anyone explain what this line means:

mov %esi,0x4(%edi)

the second parameter is the destiny. does it mean, my target is the address %edi incremented with 4?

Upvotes: 0

Views: 44

Answers (1)

maverik
maverik

Reputation: 5586

This moves the contents of the register esi to address stored in edi + 4 (bytes). Pseudo-C:

uint32_t* p = %edi;
p[1] = %esi; // Note subscript '1'. This is the same as p + 4

Upvotes: 3

Related Questions