ICS5 PA
PA1-1 24.5.30
又开始了ICS之旅,这次又给自己下了一个难度,找到了汪亮老师讲解的ICS 5!
target
第一课的目标是修正一个register错误声明
insteresting
- 中途网易源Bad Gateway 502了,更换清华源,学会了
:%s/163/tuna/g
非常爽! - 又学了几个终端快捷键
- 想到了用
ccache
加速我的PA
problems
union
和struct
的区别?
unioin
在同一个内存空间中存储不同的数据类型。
struct
则是同时存储不同的数据类型。- 为什么要用
union
?阅读i386手册
2.3.1 General Registers
As Figure 2-5 shows, the low-order word of each of these eight registers has a separate name and can be treated as a unit. This feature is useful for handling 16-bit data items and for compatibility with the 8086 and 80286 processors. The word registers are named AX, BX, CX, DX, BP, SP, SI, and DI.
对于CPU来说,可以把AH AX AL看成单独的单元,拆分成小块。所以它们是共用关系。
PA1-2 ALU 24.6.5
target
实现ALU中的各类运算,包括设置标志位
knowledge
Appendix C
Name | Function |
---|---|
CF | Carry Flag ── Set on high-order bit carry or borrow; cleared otherwise. |
PF | Parity Flag ── Set if low-order eight bits of result contain an even number of 1 bits; cleared otherwise. |
ZF | Zero Flag ── Set if result is zero; cleared otherwise. |
SF | Sign Flag ── Set equal to high-order bit of result (0 is positive, 1 if negative). |
OF |
Overflow Flag ── Set if result is too large a positive number or too small a negative number (excluding sign-bit) to fit in destination operand; cleared otherwise. |