[英]How to disable interrupts for one instruction?
是的,使用MOV
加載SS
將禁止下一條指令的外部中斷。 這是指令集引用所說的:
使用MOV指令加載SS寄存器會禁止所有中斷,直到執行下一條指令為止。 此操作允許在發生中斷之前使用下一條指令(MOV ESP,堆棧指針值)將堆棧指針加載到ESP寄存器中。
這段代碼片段可以解決這個問題:
pushf
pop ax
and ax, FDFFh
push ax
popf ;This disables interrupts, You didn't use "CLI"
; Here IF is clear
sti
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.