Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我不初始化堆栈段,会发生什么?
在某些情况下会导致阅读错误吗?
当您调用软件中断(或进行任何调用)时,您的堆栈段寄存器最好具有有效值,因为int(or call) 指令需要一个有效堆栈来存储代码的返回地址。此外,被调用的子例程通常期望有一个有效的堆栈,它可以在其中push一些寄存器来完成它的工作。
int
call
push
事实上,您的堆栈段寄存器最好始终具有有效值,否则一旦发生第一个周期性中断,一切都会崩溃并烧毁。