|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code
stack segment
db 128 dup(0)
stack ends
code segment
;----------installation--------
start: mov ax,stack
mov ss,ax
mov sp,128
push cs
pop ds
mov si,offset my_int9 ;ds:si = cs:offset my_int9
mov ax,0
mov es,ax
mov di,200h ;es:di=0:200h
mov cx,offset tail - offset my_int9
rep movsb ;installing....
mov bx,offset adr
push es:[9*4]
pop cs:[bx]
push es:[9*4+2]
pop cs:[bx+2] ;store cs:ip of old int9
cli
mov es:[9*4],word ptr 200h
mov es:[9*4+2],word ptr 0 ;locate my_int9
sti
mov ax,4c00h
int 21h
;----------my_int9-----------------
my_int9: jmp go
adr dw 0,0 ;cs:ip of old int9
go: push ax
push es
push cx
push bx
push di
in al,60h
pushf
mov bx,offset adr
call dword ptr cs:[bx] ;call int9
cmp al,3bh
jnz int9ret
mov ax,0b800h
mov es,ax
mov di,1
mov cx,80*25
color: inc byte ptr es:[di]
add di,2
loop color
int9ret: pop di
pop bx
pop cx
pop es
pop ax
iret
tail: nop
code ends
end start
|
|