code segment
assume cs:code,ds:code,es:code
org 100h
start: jmp set09h
lockkey equ 1
subaddr dw key_on
pointer dw ?
counter db ?
keyword db 11h,15h,19h
key_len equ $-keyword
old09h dd ?
new09h proc near
push ax
push si
push ds
push es
push cs
pop ds
mov ax,0040h
mov es,ax
in al,60h
test al,80h
jnz bios09h
jmp word ptr subaddr
bios09h:pop es
pop ds
pop si
pop ax
sti
jmp cs:dword ptr old09h
key_on: test byte ptr es:[0017h],08h
jz bios09h
mov subaddr,offset key_off
mov pointer,offset keyword
exit: in al,61h
push ax
or al,80h
out 61h,al
pop ax
out 61h,al
mov al,20h
out 20h,al
pop es
pop ds
pop si
pop ax
iret
key_off:mov si,pointer
cmp al,[si]
jnz error
inc pointer
dec counter
jnz exit
mov subaddr,offset key_on
jmp bios09h
error: cmp si,offset keyword
jz exit
mov pointer,offset keyword
mov counter,key_len
jmp key_off
new09h endp
set09h: cli
push cs
pop ds
mov ax,3509h
int 21h
mov si,offset old09h
mov [si],bx
mov [si+2],es
mov dx,offset new09h
mov ax,2509h
int 21h
mov dx,offset set09h
add dx,260
int 27h
code ends
end
mov ax,3509h
int 21h
mov si,offset old09h
mov [si],bx
mov [si+2],es
mov dx,offsetnew09h
mov ax,2509h
int 21h
assume cs:code,ds:code,es:code
org 100h
start: jmp set09h
lockkey equ 1
subaddr dw key_on
pointer dw ?
counter db ?
keyword db 11h,15h,19h
key_len equ $-keyword
old09h dd ?
new09h proc near
push ax
push si
push ds
push es
push cs
pop ds
mov ax,0040h
mov es,ax
in al,60h
test al,80h
jnz bios09h
jmp word ptr subaddr
bios09h:pop es
pop ds
pop si
pop ax
sti
jmp cs:dword ptr old09h
key_on: test byte ptr es:[0017h],08h
jz bios09h
mov subaddr,offset key_off
mov pointer,offset keyword
exit: in al,61h
push ax
or al,80h
out 61h,al
pop ax
out 61h,al
mov al,20h
out 20h,al
pop es
pop ds
pop si
pop ax
iret
key_off:mov si,pointer
cmp al,[si]
jnz error
inc pointer
dec counter
jnz exit
mov subaddr,offset key_on
jmp bios09h
error: cmp si,offset keyword
jz exit
mov pointer,offset keyword
mov counter,key_len
jmp key_off
new09h endp
set09h: cli
push cs
pop ds
mov ax,3509h
int 21h
mov si,offset old09h
mov [si],bx
mov [si+2],es
mov dx,offset new09h
mov ax,2509h
int 21h
mov dx,offset set09h
add dx,260
int 27h
code ends
end
mov ax,3509h
int 21h
mov si,offset old09h
mov [si],bx
mov [si+2],es
mov dx,offsetnew09h
mov ax,2509h
int 21h