0

因此,在我跳入大会的过程中,我已经在这个实模式二进制文件中“完成”了一件事..

这是从 9FB00->90000 准备一个堆栈。我遵循的指南假设我了解细分市场,我希望我能得到关于 9000->90000 的解释。

 [BITS 16]
 [ORG 0x7C00]

 jmp 0x0:Start

 Start:
 cli
 ;<<<ZONE IN QUESTION>>>
 mov AX,0x9000
 mov SS,AX
 ;<<<ZONE IN QUESTION>>>
 mov SP,0xFB00
 sti

 cli
 hlt

 times 510 - ($ - $$) db 0 ;nasmgasm
 dw 0xAA55
4

1 回答 1

1

x86 registers in real mode include the normal set of processor registers, and an additional set of segment registers, all of which are 16 bits long. To extend the address space beyond 64kb the segment registers are offset 4 bits from the other address registers, and the final address is calculated by adding the address register (the Stack Pointer in your case) to the segment register (SS for your question)

Thus you get:

SS = 9000    ; offset 4 bits
SP =  FB00
     =====
     9FB00  ; Final address in actual memory space.

This is extended considerably once you leave real mode as 32-bit registers become available.

于 2013-10-20T03:30:29.490 回答