安装一个新的int 9中断例程,功能:在DOS下,按下“A”键后,除非不再松开,如果松开,就显示满屏幕的“A",其他的键照常处理。
提示,.按下一个键时产生的扫描码称为通码,松开一个键产生的扫描码称为断码。断码一通码十80h
assume cs:code stack segment db 128 dup (0) stack ends code segment start: mov ax,stack mov ss,ax mov sp,128 ;--------------------set adtess push cs pop ds mov si,offset newint9 mov ax,0 mov es,ax mov di,204h ;----------------copy newint9 code cli mov cx,offset newint9end-newint9 cld rep movsb sti ;--------------------set table cli mov ax,es:[4*9] mov es:[200h],ax mov ax,es:[4*9+2] mov es:[202h],ax mov word ptr es:[4*9],204h mov word ptr es:[4*9+2],0 sti cycle: mov ax,1000 jmp short cycle mov ax,4c00h int 21h ;------------------------- ;-------------------------- newint9: push ax push bx push cx push es in al,60h pushf call dword ptr cs:[200h] cmp al,1h+80h jne int9ret mov ax,0b800h mov es,ax mov bx,0 mov cx,2000 s: mov byte ptr es:[bx],'A' add bx,2 loop s int9ret: pop es pop cx pop bx pop ax iret newint9end:nop code ends end start