2020年6月14日 星期日

[X86] Real Mode


參考來源:
Intel 64 and IA-32 Architectures Software Developer Manuals
AMD64 Architecture Programmer's Manual
The Intel Microprocessors by Barry B.Brey

相關文章:
Protected Mode

Real Mode下是透過segment registeroffset register來定址。
定址方式為:
segment register * 10h + offset register

以CS (code segment)和IP (Instruction pointer)為例,processor以這樣的組合來取得執行
指令的位址。這樣的組合通常寫作CS:IP或者CS:EIP,IP/EIP根據當下的執行 operation mode。

若CS=1400H且IP/EIP=1200H,則processor執行指令位址就是:
1400H * 10H + 1200H = 15200H

另一種組合為Stack,Stack使用SS:SP(SS:ESP)和SS:BP(SS:EBP)來定址。

若SS=2000H且BP=3000H,則Stack的記憶題位址為:
2000H * 10H + 3000H = 23000H

由於此定址方式的限制,在Real Mode下只能定址到1MB (20 bits)以下的記憶體。

沒有留言:

張貼留言