INTERNET
 :
  |    

/

, . /

1 | 2

←  
1 2 

.MODEL TINY

.CODE

.STARTUP

.286

LOCALS

JUMPS

jmp Install

; RSHIFT scan code

RSHIFT_SCAN EQU 36h

FLAGS record inRussian:1,shiftPressed:1,keyPressed:1,reserved:6

iFlags FLAGS <0, 0, 0, 0>

STable db 'pH'

Hook09 proc far ;p int 09h

push ax

push bx

push cx

push di

push ds

push es

mov ax,cs ; p

mov ds,ax

in al,60h

mov ah,al

cmp al,RSHIFT_SCAN

je gotShift ; pp

test al,80h

jnz KeyUp ; ?

test [iFlags], MASK inRussian

jz OldHook09 ; , p p

push ax

mov ax,40h

mov es,ax ; es = BIOS

pop ax

cmp al,34h ; p

jg OldHook09 ; don't know what it is

cmp al,2Ch

jl check2

sub al,2Ch

add al,23

jmp short Translate

check2:

cmp al,28h

jg OldHook09

cmp al,1Eh

jl check3

sub al,1Eh

add al,12

jmp short Translate

check3:

cmp al,1Bh

jg OldHook09

cmp al,10h

jl OldHook09

sub al,10h ; , al =

Translate:

or [iFlags], MASK keyPressed

mov ah,es:[17h] ; shift

test ah,11b

jz lowerKey ; -

add al,32 ;

lowerKey:

mov cx,es:[1Ah] ; p p (30-60)

mov bx,es:[1Ch] ;

cmp cx,60

je h_End

inc cx

inc cx

cmp cx,bx

je Quit

jmp short insSymb

h_End:

cmp bx,30

je Quit

insSymb:

mov di, offset STable ; di =

mov ah,0 ; ax =

add di,ax

mov al,[di] ; al =

mov es:[bx],al ; p p (int 16h)

cmp bx,60

jne nextStep

mov bx,28

nextStep:

inc bx

inc bx

mov es:[1Ch],bx ;

jmp short Quit ; , pp

gotShift:

or [iFlags], MASK shiftPressed ; shift

and [iFlags], NOT MASK keyPressed ; ------------

jmp short OldHook09

KeyUp:

and al,7Fh ; p

cmp al,RSHIFT_SCAN

jne OldHook09 ; shift - p p

test [iFlags], MASK keyPressed

jnz throwShift ; - p shift

test [iFlags], MASK inRussian

jz switchRussian ; - p

and [iFlags], NOT MASK inRussian ;

jmp short OldHook09

switchRussian:

or [iFlags], MASK inRussian

jmp short OldHook09

throwShift:

and [iFlags], NOT MASK shiftPressed ; p p shift

OldHook09:

pop es

pop ds

pop di

pop cx

pop bx

pop ax

db 0EAh ; far jump

OldHandler09 dd ? ; jump xxxx:yyyy

Quit:

in al,61h ; p pp p

mov ah,al ; pp p . .

or al,80h

out 61h,al

xchg ah,al

out 61h,al

mov al,20h

out 20h,al

pop es

pop ds

pop di

pop cx

pop bx

pop ax

iret

Hook09 endp

Hook10 proc far

cmp ah,00h ; p

jne @@Quit ; ? p p p p

cmp al,2 ; p 2 3 ?

je @@myHook ; - p

cmp al,3

jne @@Quit

@@myHook:

call iBIOS ; p p

push ax

push cx

push ds

push si

mov ax,cs

mov ds,ax

mov al,0

mov cl,0FFh

mov ch,16

mov si, offset NewFont

call LoadFont ; p

pop si

pop ds

pop cx

pop ax

iret

@@Quit:

call iBIOS

iret

Hook10 endp

iBIOS proc

pushf

db 09Ah ; far call

OldHandler10 dd ?

ret

iBIOS endp

;Ŀ

; Load Font

;

; p pp 堠

; p . p,

; "p" pࠠ

; :

; AL - p p ࠠ

; CL - ⠠

; CH - pp ࠠ

; DS:SI - p p⠠

; : 򠠠

; p pp: 򠠠

;

LoadFont proc

pushf

push ax

push cx

push dx

push si

push di

push es

mov di,0A000h

mov es,di

xor ah,ah

imul di,ax,20h

push ds

push si

mov si,cs

mov ds,si

lea si,WRITE_ON

push cx

call SetMode

pop cx

pop si

pop ds

mov dl,ch

xor ch,ch

xor dh,dh

@@All_symbols:

push cx

mov ax,di

mov cx,dx

shr cx,1 ; cx /= 2

rep movsw

mov di,ax

add di,20h

pop cx

loop @@All_symbols

lea si,WRITE_OFF

call SetMode

pop es

pop di

pop si

←  
1 2 


Copyright © 2005—2007 «RefStore.Ru»