CSAPP

3.3 Data Formats 数据格式

Intel uses the term “word” to refer to a 16-bit data type .

Size of C data types in x86-64

C decalaration Intel data type Assembly-code suffix Size(bytes)
char byte b 1
short word w 2
int double word l 4
long quad word q 8
char * quad word q 8
float single precision s 4
double double precision l 8

3.4 Acssessing Information

访问寄存器从低位到高位因为操作数的大小,能访问的bit数也不同。

64 register 意思 备注
%rax return value
%rbx callee saved
%rcx 4th argument
%rdx 3rd argument
%rsi 2nd argument
%rdi 1nd argument
%rbp callee saved
%rsp stack point
%r8 5th argument
%r9 6th argument
%r10 callee saved
%r11 callee saved
%r12 callee saved
%r13 callee saved
%r14 callee saved
%r15 callee saved