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
|
CODE segment 'CODE'
assume cs:CODE
org 100h
begin: jmp install
add9 dd ?
col db 0
vect9 proc far
call teste
jmp cs:add9
vect9 endp
teste proc near
push ax
push dx
push bx
mov ah,02h
mov bh,0
mov dl,0
mov dh,cs:col
int 10h
inc cs:col
inc cs:col
pop bx
pop ax
pop dx
ret
teste endp
install:
mov ax,cs ;load ds
mov ds,ax
mov ax,3509 ;get current vector 9
int 21h ;and save it
mov word ptr cs:add9,bx ;offset
mov word ptr cs:add9+2,es ;segment
mov ax,2509h
mov dx,offset vect9
int 21h
mov ax, ds:[2Ch] ; Release environment.
mov es, ax
mov ah, 49h
int 21h
mov dx, offset install ; Find paragraphs
shr dx, 1 ; Divide by 16.
shr dx, 1
shr dx, 1
shr dx, 1
inc dx ; Add one to be sure.
mov ax, 3100h ; Set TSR
int 21h
CODE ENDS
end begin |
Partager