home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
pcfonts
/
cp866.zip
/
KEYBRU1.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-09-05
|
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 i short
db 051h,010h,'╣' ;Q is I short
db 077h,011h,'µ' ;w is ts
db 057h,011h,'╞' ;W is TS
db 065h,012h,'π' ;e is u
db 045h,012h,'├' ;E is U
db 072h,013h,'┌' ;r is k
db 052h,013h,'║' ;R is K
db 074h,014h,'╒' ;t is e
db 054h,014h,'╡' ;T is E
db 079h,015h,'▌' ;y is n
db 059h,015h,'╜' ;Y is N
db 075h,016h,'╙' ;u is g
db 055h,016h,'│' ;U is G
db 069h,017h,'Φ' ;i is sh
db 049h,017h,'╚' ;I is SH
db 06Fh,018h,'Θ' ;o is shch
db 04Fh,018h,'╔' ;O is SHCH
db 070h,019h,'╫' ;p is z
db 050h,019h,'╖' ;P is Z
db 05Bh,01Ah,'σ' ;[ is h
db 07Bh,01Ah,'┼' ;{ is H
db 05Dh,01Bh,'Ω' ;] is hard
db 07Dh,01Bh,'╩' ;} is Hard
;
db 061h,01Eh,'Σ' ;a is f
db 041h,01Eh,'─' ;A is F
db 073h,01Fh,'δ' ;s is y
db 053h,01Fh,'╦' ;S is Y
db 064h,020h,'╥' ;d is v
db 044h,020h,'▓' ;D is V
db 066h,021h,'╨' ;f is a
db 046h,021h,'░' ;F is A
db 067h,022h,'▀' ;g is p
db 047h,022h,'┐' ;G is P
db 068h,023h,'α' ;h is r
db 048h,023h,'└' ;H is R
db 06Ah,024h,'▐' ;j is o
db 04Ah,024h,'╛' ;J is O
db 06Bh,025h,'█' ;k is l
db 04Bh,025h,'╗' ;K is L
db 06Ch,026h,'╘' ;l is d
db 04Ch,026h,'┤' ;L is D
db 03Bh,027h,'╓' ;; is zh
db 03Ah,027h,'╢' ;: is ZH
db 027h,028h,'φ' ;' is e rev
db 022h,028h,'═' ;" is E rev
;
db 07Ah,02Ch,'∩' ;z is ya
db 05Ah,02Ch,'╧' ;Z is YA
db 078h,02Dh,'τ' ;x is ch
db 058h,02Dh,'╟' ;X is CH
db 063h,02Eh,'ß' ;c is s
db 043h,02Eh,'┴' ;C is S
db 076h,02Fh,'▄' ;v is m
db 056h,02Fh,'╝' ;V is M
db 062h,030h,'╪' ;b is i
db 042h,030h,'╕' ;B is I
db 06Eh,031h,'Γ' ;n is t
db 04Eh,031h,'┬' ;N is T
db 06Dh,032h,'∞' ;m is soft
db 04Dh,032h,'╠' ;M is Soft
db 02Ch,033h,'╤' ;, is b
db 03Ch,033h,'▒' ;< is B
db 02Eh,034h,'ε' ;. is yu
db 03Eh,034h,'╬' ;> is YU
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