Q:

Translating cmp in assembly

I'm new to assembly and ran accross the following ling:
cmp 0x2c(%esp),%esi

It's clearly trying to compare, but I don't know what 0x2c(%esp) is. I'm using GDB, so a command to access that value would be helpful. The next line sees if the two values are equal.

A:

I'm not familiar with your assembler's syntax, but I'd gather it is comparing the contents of register ESI with the contents of the memory location at (stack pointer + 2C hex)

A:

This is at&t syntax. You can switch gdb to intel syntax using set disassembly-flavor intel to get more readable code. You can examine the value using for example x/d $esp+0x2c.

