1.Register names are prefixed by %. That is, if eax has to be used, it should be used as %eax.
2.In any instruction, source comes first and destination follows. This differs from Intel syntax, where source comes after destination.
3. An immediate operand is specified by using $.
4. Any indirect references to memory are done by using ( ).
5.GCC provides the special construct "asm" for inline assembly, which has the following format:
asm ( assembler template
: output operands (optional)
: input operands (optional)
: list of clobbered registers (optional)
);
6.a %eax
b %ebx
c %ecx
d %edx
S %esi
D %edi
7.Memory operand constraint(m)
When the operands are in the memory, any operations performed on them will occur directly in
the memory location, as opposed to register constraints, which first store the value in a
register to be modified and then write it back to the memory location. But register constraints
are usually used only when they are absolutely necessary for an instruction or they significantly
speed up the process. Memory constraints can be used most efficiently in cases where a C
variable needs to be updated inside "asm" and you really don't want to use a register to hold
its value.
没有评论:
发表评论