home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
pcfonts
/
cp866.zip
/
KEYBRU4.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-10-08
|
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