我在爲TSR製作TSR com文件時遇到了麻煩。它應該在第21箇中斷處設置一個新的處理程序,終止並保持常駐。新的處理程序應該將控制權轉移給舊的中斷21h處理程序。我保存它的中斷向量,但不知道如何正確調用它。這裏是一個程序:在DOS上組裝(TASM),在int 21h上使用新的處理程序創建TSR
.model tiny
.data
old_int21h dw ?, ?
.code
org 100h
start:
;saving old interrupt vector
mov ax, 3521h
int 21h
mov [old_int21h], bx
mov [old_int21h + 2], es
;setting new interrupt vector
cli
push ds
push cs
pop ds
lea dx, myint21h
mov ax, 2521h
int 21h
pop ds
sti
; TSR
lea dx, start
int 27h
myint21h proc
; doing something
; want to transfer control to an old interrupt 21h handler here. How?
iret
myint21h endp
end start
哪個DOS的版本? – 2013-02-27 18:43:39
使用dosbox與DOS v.5.00 – gukoff 2013-02-27 18:48:52