home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pcfonts / cp866.zip / KEYBRU1.ASM < prev    next >
Assembly Source File  |  1990-09-05  |  6KB  |  171 lines

  1. ;this dirty hack is a int 16 replacement
  2. ;russian is on if 0:417 has 10 on (scroll lock)
  3. ;we don't change the scan code when replacing al
  4.  
  5. cseg     segment
  6.          assume    cs:cseg,ds:cseg
  7. zero:
  8.          org       100h
  9. entry:   jmp       start
  10.  
  11. ;
  12. trtab    equ       $
  13. ;Soviet keyboards have 2 extra keys (just like IBM European keyboards).
  14. ;We leave the shifted values of the top row unchanged US (!,@,#,...,+)
  15. ;but replace the Alt-values to make up for the keys used for letters.
  16. ;This is not 100% GOST, but is better for our users.
  17. ;Alpha layout is GOST
  18.  
  19. ;First row:
  20.          db        000h,078h,'≡' ;alt-1 is Number acronym (ligature)
  21.          db        000h,079h,'²' ;alt-2 is Section
  22.          db        000h,07Ah,'/' ;alt-3 is /
  23.          db        000h,07Bh,'"' ;alt-4 is "
  24.          db        000h,07Ch,':' ;alt-5 is :
  25.          db        000h,07Dh,',' ;alt-6 is ,
  26.          db        000h,07Eh,'.' ;alt-7 is .
  27.          db        000h,07Fh,';' ;alt-8 is ;
  28.          db        000h,080h,'?' ;alt-9 is ?
  29.          db        000h,081h,'ò' ;alt-0 is currency symbol
  30.          db        000h,082h,'<' ;alt-- is <
  31.          db        000h,083h,'>' ;alt-= is >
  32.  
  33. ;Second row:
  34.          db        071h,010h,'┘' ;q is i short
  35.          db        051h,010h,'╣' ;Q is I short
  36.          db        077h,011h,'µ' ;w is ts
  37.          db        057h,011h,'╞' ;W is TS
  38.          db        065h,012h,'π' ;e is u
  39.          db        045h,012h,'├' ;E is U
  40.          db        072h,013h,'┌' ;r is k
  41.          db        052h,013h,'║' ;R is K
  42.          db        074h,014h,'╒' ;t is e
  43.          db        054h,014h,'╡' ;T is E
  44.          db        079h,015h,'▌' ;y is n
  45.          db        059h,015h,'╜' ;Y is N
  46.          db        075h,016h,'╙' ;u is g
  47.          db        055h,016h,'│' ;U is G
  48.          db        069h,017h,'Φ' ;i is sh
  49.          db        049h,017h,'╚' ;I is SH
  50.          db        06Fh,018h,'Θ' ;o is shch
  51.          db        04Fh,018h,'╔' ;O is SHCH
  52.          db        070h,019h,'╫' ;p is z
  53.          db        050h,019h,'╖' ;P is Z
  54.          db        05Bh,01Ah,'σ' ;[ is h
  55.          db        07Bh,01Ah,'┼' ;{ is H
  56.          db        05Dh,01Bh,'Ω' ;] is hard
  57.          db        07Dh,01Bh,'╩' ;} is Hard
  58. ;
  59.          db        061h,01Eh,'Σ' ;a is f
  60.          db        041h,01Eh,'─' ;A is F
  61.          db        073h,01Fh,'δ' ;s is y
  62.          db        053h,01Fh,'╦' ;S is Y
  63.          db        064h,020h,'╥' ;d is v
  64.          db        044h,020h,'▓' ;D is V
  65.          db        066h,021h,'╨' ;f is a
  66.          db        046h,021h,'░' ;F is A
  67.          db        067h,022h,'▀' ;g is p
  68.          db        047h,022h,'┐' ;G is P
  69.          db        068h,023h,'α' ;h is r
  70.          db        048h,023h,'└' ;H is R
  71.          db        06Ah,024h,'▐' ;j is o
  72.          db        04Ah,024h,'╛' ;J is O
  73.          db        06Bh,025h,'█' ;k is l
  74.          db        04Bh,025h,'╗' ;K is L
  75.          db        06Ch,026h,'╘' ;l is d
  76.          db        04Ch,026h,'┤' ;L is D
  77.          db        03Bh,027h,'╓' ;; is zh
  78.          db        03Ah,027h,'╢' ;: is ZH
  79.          db        027h,028h,'φ' ;' is e rev
  80.          db        022h,028h,'═' ;" is E rev
  81. ;
  82.          db        07Ah,02Ch,'∩' ;z is ya
  83.          db        05Ah,02Ch,'╧' ;Z is YA
  84.          db        078h,02Dh,'τ' ;x is ch
  85.          db        058h,02Dh,'╟' ;X is CH
  86.          db        063h,02Eh,'ß' ;c is s
  87.          db        043h,02Eh,'┴' ;C is S
  88.          db        076h,02Fh,'▄' ;v is m
  89.          db        056h,02Fh,'╝' ;V is M
  90.          db        062h,030h,'╪' ;b is i
  91.          db        042h,030h,'╕' ;B is I
  92.          db        06Eh,031h,'Γ' ;n is t
  93.          db        04Eh,031h,'┬' ;N is T
  94.          db        06Dh,032h,'∞' ;m is soft
  95.          db        04Dh,032h,'╠' ;M is Soft
  96.          db        02Ch,033h,'╤' ;, is b
  97.          db        03Ch,033h,'▒' ;< is B
  98.          db        02Eh,034h,'ε' ;. is yu
  99.          db        03Eh,034h,'╬' ;> is YU
  100.          db        02Fh,035h,'±' ;/ is yo
  101.          db        03Fh,035h,'í' ;? is YO
  102. trtabl   equ       ($-trtab)/3
  103.  
  104. inah    db      ? ;ah we called with
  105.  
  106. newi16:
  107.         mov     cs:inah,ah
  108.         pushf
  109.         db      09ah ;far call
  110. oldi16  dw      0,0
  111.         pushf
  112.         push    bx
  113.         mov     bl,cs:inah
  114.         cmp     bl,2
  115.         jb      yes
  116.         cmp     bl,10h
  117.         jb      no
  118.         cmp     bl,12h
  119.         jae     no
  120. yes:
  121.         push    ds
  122.         xor     bx,bx
  123.         mov     ds,bx
  124.         test    byte ptr ds:[417h],10h
  125.         pop     ds
  126.         jz      no ;only when scroll lock is lit
  127.         push    cx
  128.         push    ds
  129.         push    cs
  130.         pop     ds
  131.         mov     bx,offset trtab
  132.         mov     cx,trtabl
  133. scan:   cmp     ax,ds:[bx]
  134.         jnz     scann
  135.         mov     al,ds:[bx+2]
  136.         cmp     al,0e0h ;α
  137.         jnz     scanx
  138.         xor     ah,ah
  139.         jmp     short scanx
  140. scann:  add     bx,3
  141.         loop    scan
  142. scanx:
  143.         pop     ds
  144.         pop     cx
  145. no:
  146.         pop     bx
  147.         popf
  148.         db      0cah ;retf 2
  149.         dw      2
  150.  
  151. start:  xor     ax,ax
  152.         mov     ds,ax
  153.         mov     ax,offset newi16
  154.         xchg    ax,ds:[16h*4]
  155.         mov     cs:oldi16,ax
  156.         mov     ax,cs
  157.         xchg    ax,ds:[16h*4+2]
  158.         mov     cs:oldi16+2,ax
  159.         push    cs
  160.         pop     ds
  161.         mov     dx,offset msg
  162.         mov     ah,9
  163.         int     21h
  164.         mov     dx,(start-zero+15)/16
  165.         mov     ax,3100h
  166.         int     21h
  167. msg     db      'Russian keyboard driver loaded. Hot key is Scroll Lock=▒█┌Å┐α┌α'
  168.         db      13,10,'$'
  169.  cseg    ends
  170.         end       entry
  171.