4
votes

What are the letters in gcc-inline assembly for %esp and %ebp? I understand that:

a = eax 
b =ebx 
c = ecx 
d = edx 
S = esi 
D = edi 
I = constant value (0 to 31). 
1

1 Answers

6
votes

There's a list in the manual for the gcc machine constraints (see under the : Intel 386 section). The gory details (typically more up to date than the manual) are found in the i386/constraints.md file.

However - for good reasons, namely stack coherency, %ebp and %esp cannot be used as constraints. They cannot be specified as inputs or outputs in extended asm syntax. This may also extend to %ebx in some cases - specifically, when generating position-independent code, e.g., with the (i386 SysV) ELF ABI.

You can still manipulate these registers in the asm block explicitly, of course.