CSAPP 读书笔记3

本文详细介绍了从源代码到可执行文件的编译过程,包括预处理、编译、汇编及链接等步骤。同时深入探讨了IA32架构下的指令集特性,如条件码寄存器、浮点寄存器的功能,以及不同类型的操作数形式,并对move指令的限制进行了说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. Preprocessor -> compiler -> assembler -> linker
*.c -> *.s -> *.o -> *
2. Program Counter --> %EIP --> Indicate the address in memory that the next instruction to be executed.
3. Register
4. condition code registers
5. floating-point registers
6. Program memory contains:
1) executable machine code for the program
2) information required by OS
3) run-time stack
4) memory allocated by user
7. Disassembler -> inspect the content of machine code
unix> objdump -d code.o
8. Intel & ATT assembly format
1)Intel format omit the size designation
2)Intel format omit % in front of register names
3)Different way describing the locations in memory
4)Instructions with multipule operands list them in reverse order
9. Operand forms:
1) Immediate $0x15
2) Register R[Ea]
3) Abosulte
4) Indirect
5) Base + displacement
6) Indexed
7) Scaled indexed -> Imm + R[Eb] + R[Ei]*S
10. Effective address
11. IA32 impose that a move instruction can't have both operands refer to memory locations.
12. MOV -> MOVB, MOVW, MOVL
13. MOVS ->MOVSBW, MOVSBL, MOVSWL (SIGNED EXTEND)
14. MOVZ ->MOVZBS, MOVZBL, MOVZWL (ZERO EXTEND)
15. PUSHL, POPL
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值