I am trying to understand how the assembly language works for a micro-computer architecture class, and I keep facing different syntaxes in examples:
sub $48, %esp
mov %eax, 32(%esp)
What do these codes mean? What is the 32 operand an addition to the esp register?
Thats not Intel syntax, its AT&T syntax, also called GAS syntax.
the
$prefix is for immediates (constants), and the%prefix is for registers (they are required1).For more about AT&T syntax, see also the
[att]tag wiki.1 Unless the
noprefixoption is specified, see here & here. But usuallynoprefixis only used with.intel_syntax noprefix, to get MASM-like syntax.