在中断驻留程序中不能用int 21h吗
一个简单的中断驻留程序修改9号中断多打一个O,我发现如果把
mov dl,'O'
mov ah,2
int 21h
改为
mov ah,0Eh
int 10h
mov al,'O'
就没问题,难道在中断驻留程序中不能用int 21h吗
INT_VECTOR=9h
cseg segment
assume cs:cseg,ds:cseg
org 100h ;this line could be deleted for EXE,only for COM
begin:
jmp install
kbsave dd ?
newint9 proc near
sti ; 开中断, enable high level IRQ interrupt
push ax
push bx
push cx
push dx
push si
push di
push ds
push es
pushf
call dword ptr cs:kbsave ;EXCUTE OLD INT 9
mov dl,'o'
mov ah,2
int 21h
exit:
pop es
pop ds
pop di
pop si
pop dx
pop cx
pop bx
pop ax
iret
newint9 endp
install proc near
xor ax,ax
mov es,ax
mov ax,word ptr es:[INT_VECTOR*4] ;save old int 9 vector
mov word ptr cs:kbsave,ax
mov ax,word ptr es:[INT_VECTOR*4+2]
mov word ptr cs:kbsave+2,ax
xor ax,ax
mov es,ax
mov ax,offset newint9 ;set new int 9 vector
mov word ptr es:[INT_VECTOR*4],ax
mov word ptr es:[INT_VECTOR*4+2],cs
MOV AX,3100H
LEA DX,install
ADD DX,100h ;must include PSP for EXE, as PSP!=CS for EXE
;but this line could be deleted for COM
MOV CL,4
SHR DX,CL ;convert byte to paragraph
INC DX ;consideration of the remainder
INT 21h
;mov DX,OFFSET INSTALL
;INT 27H
install endp
cseg ends
end begin
mov dl,'O'
mov ah,2
int 21h
改为
mov ah,0Eh
int 10h
mov al,'O'
就没问题,难道在中断驻留程序中不能用int 21h吗
INT_VECTOR=9h
cseg segment
assume cs:cseg,ds:cseg
org 100h ;this line could be deleted for EXE,only for COM
begin:
jmp install
kbsave dd ?
newint9 proc near
sti ; 开中断, enable high level IRQ interrupt
push ax
push bx
push cx
push dx
push si
push di
push ds
push es
pushf
call dword ptr cs:kbsave ;EXCUTE OLD INT 9
mov dl,'o'
mov ah,2
int 21h
exit:
pop es
pop ds
pop di
pop si
pop dx
pop cx
pop bx
pop ax
iret
newint9 endp
install proc near
xor ax,ax
mov es,ax
mov ax,word ptr es:[INT_VECTOR*4] ;save old int 9 vector
mov word ptr cs:kbsave,ax
mov ax,word ptr es:[INT_VECTOR*4+2]
mov word ptr cs:kbsave+2,ax
xor ax,ax
mov es,ax
mov ax,offset newint9 ;set new int 9 vector
mov word ptr es:[INT_VECTOR*4],ax
mov word ptr es:[INT_VECTOR*4+2],cs
MOV AX,3100H
LEA DX,install
ADD DX,100h ;must include PSP for EXE, as PSP!=CS for EXE
;but this line could be deleted for COM
MOV CL,4
SHR DX,CL ;convert byte to paragraph
INC DX ;consideration of the remainder
INT 21h
;mov DX,OFFSET INSTALL
;INT 27H
install endp
cseg ends
end begin
...全文
相关推荐
汇编语言--新增INT21H的功能
新增INT 21H的0D1H、0D2H、0D2H、0D4H、0D5H号功能,将寄存器BX的值分别以二进制数、八进制数、十进制无符号数、十进制有符号数、十六进制数形式显示出来(4~6)
汇编int 21h和int 16h调用详解
dos中断,软件中断,很详细,希望对你有帮助 int 16是一个软件中断,可以用来获取按键信息 int 21是dos软中断指令,所以对应的是计算机中断硬件
INT 21H 功能调用一览表
时,有以下几个基本步骤: 1、 将调用参数装入指定的寄存器中; 2、 如需功能号,把它装入AH; 3、 如需子功能号,把它装入AL; 4、 按中断号调用DOS或BIOS中断; 5、 检查返回参数是否正确。
int21h的详细功能描述
收集了详细的int 21h中断的功能,里面包含一个word和几张截图,两个收集互相补充,达到了最大的效果,弥补了书籍中的介绍不详细的缺点
INT-21H功能列表
该资源列出了int-21h的全部功能列表,供开发人员查阅调用


