views:

178

answers:

2

Using objdump to understand a binary and I realize I'm not fluent enough in ASM syntax. What does the following notion mean?

xor    %al,-0x1(%edx,%ecx,1)

And while you're at it - what should I search for in order to find docs about such notions?

+3  A: 

This is an exclusive or with content of the low byte (%al) of the 'a' register and the content of the memory at the address which is the sum of the 32 bit wide registers 'd' (%edx), 'c' multiplied by 1 (%ecx,1) and -1. The result is written back to %al. In C

al ^= (char*)(edx+ecx*1 - 1);

You can lookup stuff like this at sandpile or in the intel/amd documentation.

drhirsch
+7  A: 

The parentheses are memory offsets:

-0x1(%edx,%ecx,1) (AT&T syntax) is equal to [edx+ecx*1-1] (Intel syntax)

Quick guide for AT&T assembly syntax (as per your request).

LiraNuna