实验
安装新的int 9 中断例程
安装一个新的int 9中断例程,功能:在DOS下,按下“A”键后,除非不松开,如果松开,就显示满屏幕的“A”,其他的键照常处理。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| assume cs:code
code segment start: sli mov ax, cs mov ds, ax mov si, offset int9
mov ax, 0 mov es, ax mov di, 204h
mov cx, offset int9_end - offset int9 cld
rep movsb
mov ax, es:[9*4] mov es:[200h], ax mov ax, es:[9*4+2] mov es:[202h], ax
mov word ptr es:[9*4], 204h mov word ptr es:[9*4+2], 0 sti
mov ax, 4c00h int 21h
----------------------int9------------------------- int9: push ds push ax push cx push si
in al, 60h pushf call dword ptr cs:[200h]
cmp al, 1eh+80h jne int9_ok
mov ax, 0b800h mov ds, ax mov si, 0 mov cx, 2000
print_char: mov byte ptr [si], 'A' add si, 2 loop print_char
int9_ok: pop si pop cx pop ax pop ds iret
int9_end: nop
code ends end start
|