Hello David, and/or Mervyn,
DK> .CODE
DK> SaveSS dw 0
DK> SaveSP dw 0
DK> SaveBP dw 0
DK> SafeInt2Eh:
DK> MOV CS:[SaveSS], SS
DK> MOV CS:[SaveSP], SP
DK> MOV CS:[SaveBP], BP
DK> INT 2Eh
DK> CLI ; make sure the restoration of the registers is uninterrupted
DK> MOV SP, CS:[SaveSP]
DK> MOV SS, CS:[SaveSS]
DK> MOV BP, CS:[SaveBP]
DK> STI ; registers restored, so interrupts OK
DK> RET
Why is it not just as important to CLI and STI when saving the registers?
Kind regards, Barry
--- Terminate 4.00/Pro
---------------
* Origin: EBO-BBS A'dam +31-20-6002828 (2:280/901.42)
|