Addressing a compilation record

x86 / AMD64 assembly instructions are two major styles Intel assembler and AT & T assembler, are in the Microsoft Windows / Visual C ++ with the GNU / Gas uses (Gas can also use the Intel assembly style):

project Intel style AT & T style
Operation sequence number Preceding destination operand Source operand front
register AS Plus a prefix%
Immediate AS Plus $ prefix
Hexadecimal number immediately With the suffix B and H respectively represent binary hexadecimal to hexadecimal letter prefix to the beginning of the 0 0x prefix
Access memory length representation Prefix BYTE PTR, WORD PTR, DWORD PTR and QWORD PTR represents byte, word, doubleword, quadword, and Suffix b, w, l, q represents a byte, word, doubleword, quadword, and
Reference value of a global or static variable var [where] where
Reference address global or static variable var where $ each
Refers to a local variable Based on need stack pointer (RSP)
Absolute addressing [imm] imm
Indirect addressing [reg] (%reg)
Base address relative addressing [reg +imm] imm(%reg)
Indexed addressing [base+index] (base,index)
Indexed addressing imm[base+index] imm(base,index)
The proportion of indexed addressing imm[base + index * scale ] imm(base, index, scale)
1,2,4,8 scale which is only a number (1 is an ordinary write omitted Indexed)
Code comments Single-line comments with; + annotation content. For example: mov rax, rdx; this is a comment
note Here imm is immediate, base and index registers as, scale telescopic amount

Guess you like

Origin www.cnblogs.com/songyaqi/p/12075155.html