home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
pcfonts
/
cp866.zip
/
KEYBRU2.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-09-15
|
6KB
|
171 lines
;this dirty hack is a int 16 replacement
;russian is on if 0:417 has 10 on (scroll lock)
;we don't change the scan code when replacing al
cseg segment
assume cs:cseg,ds:cseg
zero:
org 100h
entry: jmp start
;
trtab equ $
;Soviet keyboards have 2 extra keys (just like IBM European keyboards).
;We leave the shifted values of the top row unchanged US (!,@,#,...,+)
;but replace the Alt-values to make up for the keys used for letters.
;This is not 100% GOST, but is better for our users.
;Alpha layout is GOST
;First row:
db 000h,078h,'≡' ;alt-1 is Number acronym (ligature)
db 000h,079h,'²' ;alt-2 is Section
db 000h,07Ah,'/' ;alt-3 is /
db 000h,07Bh,'"' ;alt-4 is "
db 000h,07Ch,':' ;alt-5 is :
db 000h,07Dh,',' ;alt-6 is ,
db 000h,07Eh,'.' ;alt-7 is .
db 000h,07Fh,';' ;alt-8 is ;
db 000h,080h,'?' ;alt-9 is ?
db 000h,081h,'ò' ;alt-0 is currency symbol
db 000h,082h,'<' ;alt-- is <
db 000h,083h,'>' ;alt-= is >
;Second row:
db 071h,010h,'∩' ;q is ya
db 051h,010h,'╧' ;Q is Ya
db 077h,011h,'╥' ;w is ve
db 057h,011h,'▓' ;W is Ve
db 065h,012h,'╒' ;e is e
db 045h,012h,'╡' ;E is E
db 072h,013h,'α' ;r is r
db 052h,013h,'└' ;R is R
db 074h,014h,'Γ' ;t is t
db 054h,014h,'┬' ;T is T
db 079h,015h,'δ' ;y is y
db 059h,015h,'╦' ;Y is Y
db 075h,016h,'π' ;u is u
db 055h,016h,'├' ;U is U
db 069h,017h,'╪' ;i is i
db 049h,017h,'╕' ;I is I
db 06Fh,018h,'▐' ;o is o
db 04Fh,018h,'╛' ;O is O
db 070h,019h,'▀' ;p is p
db 050h,019h,'┐' ;P is P
db 05Bh,01Ah,'Φ' ;[ is sha
db 07Bh,01Ah,'╚' ;{ is Sha
db 05Dh,01Bh,'Θ' ;] is shcha
db 07Dh,01Bh,'╔' ;} is Shcha
db 05Ch,02Bh,'φ' ;\ is rev e
db 07Ch,02Bh,'═' ;| is Rev E
;
db 061h,01Eh,'╨' ;a is a
db 041h,01Eh,'░' ;A is A
db 073h,01Fh,'ß' ;s is s
db 053h,01Fh,'┴' ;S is S
db 064h,020h,'╘' ;d is d
db 044h,020h,'┤' ;D is D
db 066h,021h,'Σ' ;f is f
db 046h,021h,'─' ;F is F
db 067h,022h,'╙' ;g is g
db 047h,022h,'│' ;G is G
db 068h,023h,'σ' ;h is h
db 048h,023h,'┼' ;H is H
db 06Ah,024h,'┘' ;j is i kratkoe
db 04Ah,024h,'╣' ;J is I Kratkoe
db 06Bh,025h,'┌' ;k is k
db 04Bh,025h,'║' ;K is K
db 06Ch,026h,'█' ;l is l
db 04Ch,026h,'╗' ;L is L
db 03Bh,027h,'τ' ;; is ch
db 03Ah,027h,'╟' ;: is Ch
db 027h,028h,'Ω' ;' is hard
db 022h,028h,'╩' ;" is Hard
db 060h,029h,'ε' ;` is yu
db 07Eh,029h,'╬' ;~ is Yu
;
db 07Ah,02Ch,'╫' ;z is z
db 05Ah,02Ch,'╖' ;Z is Z
db 078h,02Dh,'∞' ;x is soft
db 058h,02Dh,'╠' ;X is Soft
db 063h,02Eh,'µ' ;c is ts
db 043h,02Eh,'╞' ;C is Ts
db 076h,02Fh,'╓' ;v is zh
db 056h,02Fh,'╢' ;V is Zh
db 062h,030h,'╤' ;b is b
db 042h,030h,'▒' ;B is B
db 06Eh,031h,'▌' ;n is n
db 04Eh,031h,'╜' ;N is N
db 06Dh,032h,'▄' ;m is m
db 04Dh,032h,'╝' ;M is M
; db 02Fh,035h,'±' ;/ is yo
; db 03Fh,035h,'í' ;? is YO
trtabl equ ($-trtab)/3
inah db ? ;ah we called with
newi16:
mov cs:inah,ah
pushf
db 09ah ;far call
oldi16 dw 0,0
pushf
push bx
mov bl,cs:inah
cmp bl,2
jb yes
cmp bl,10h
jb no
cmp bl,12h
jae no
yes:
push ds
xor bx,bx
mov ds,bx
test byte ptr ds:[417h],10h
pop ds
jz no ;only when scroll lock is lit
push cx
push ds
push cs
pop ds
mov bx,offset trtab
mov cx,trtabl
scan: cmp ax,ds:[bx]
jnz scann
mov al,ds:[bx+2]
cmp al,0e0h ;α
jnz scanx
xor ah,ah
jmp short scanx
scann: add bx,3
loop scan
scanx:
pop ds
pop cx
no:
pop bx
popf
db 0cah ;retf 2
dw 2
start: xor ax,ax
mov ds,ax
mov ax,offset newi16
xchg ax,ds:[16h*4]
mov cs:oldi16,ax
mov ax,cs
xchg ax,ds:[16h*4+2]
mov cs:oldi16+2,ax
push cs
pop ds
mov dx,offset msg
mov ah,9
int 21h
mov dx,(start-zero+15)/16
mov ax,3100h
int 21h
msg db 'Russian keyboard driver loaded. Hot key is Scroll Lock=▒█┌Å┐α┌α'
db 13,10,'$'
cseg ends
end entry