簡體   English   中英

如何設置堆棧段

[英]How to set the Stack segment

有人可以幫助您了解如何為操作系統設置堆棧。

據我了解,SS將由“程序員”設置為1024(1k),然后將SP移到它的頂部,對嗎?

我在MikeOS教程上找到了以下內容,不確定將544添加到07c0將如何添加4k緩沖區

bootloader_start:

    mov ax, 07C0h           ; Set up 4K of stack space above buffer

    add ax, 544         ; 8k buffer = 512 paragraphs + 32 paragraphs 

這是我用來設置堆棧段的代碼。

; NASM syntax
xor ax, ax ; or set ax to whatever segment you wish
mov ss, ax ; IIRC, you can't just go mov ss, 0
mov sp, 0xF000 ; or set sp to whatever you wish

我認為我不必將堆棧放在那里。 只要不覆蓋系統數據,就可以將其放在任意位置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM