home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pcfonts / cp866.zip / KEYBRU4.ASM < prev    next >
Assembly Source File  |  1990-10-08  |  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 ya
  35.          db        051h,010h,'ƒ' ;Q is Ya
  36.          db        077h,011h,'ó' ;w is ve
  37.          db        057h,011h,'é' ;W is Ve
  38.          db        065h,012h,'Ñ' ;e is e
  39.          db        045h,012h,'à' ;E is E
  40.          db        072h,013h,'α' ;r is r
  41.          db        052h,013h,'É' ;R is R
  42.          db        074h,014h,'Γ' ;t is t
  43.          db        054h,014h,'Æ' ;T is T
  44.          db        079h,015h,'δ' ;y is y
  45.          db        059h,015h,'¢' ;Y is Y
  46.          db        075h,016h,'π' ;u is u
  47.          db        055h,016h,'ô' ;U is U
  48.          db        069h,017h,'¿' ;i is i
  49.          db        049h,017h,'ê' ;I is I
  50.          db        06Fh,018h,'«' ;o is o
  51.          db        04Fh,018h,'Ä' ;O is O
  52.          db        070h,019h,'»' ;p is p
  53.          db        050h,019h,'Å' ;P is P
  54.          db        05Bh,01Ah,'Φ' ;[ is sha
  55.          db        07Bh,01Ah,'ÿ' ;{ is Sha
  56.          db        05Dh,01Bh,'Θ' ;] is shcha
  57.          db        07Dh,01Bh,'Ö' ;} is Shcha
  58.          db        05Ch,02Bh,'φ' ;\ is rev e
  59.          db        07Ch,02Bh,'¥' ;| is Rev E
  60. ;
  61.          db        061h,01Eh,'á' ;a is a
  62.          db        041h,01Eh,'Ç' ;A is A
  63.          db        073h,01Fh,'ß' ;s is s
  64.          db        053h,01Fh,'æ' ;S is S
  65.          db        064h,020h,'ñ' ;d is d
  66.          db        044h,020h,'ä' ;D is D
  67.          db        066h,021h,'Σ' ;f is f
  68.          db        046h,021h,'ö' ;F is F
  69.          db        067h,022h,'ú' ;g is g
  70.          db        047h,022h,'â' ;G is G
  71.          db        068h,023h,'σ' ;h is h
  72.          db        048h,023h,'ò' ;H is H
  73.          db        06Ah,024h,'⌐' ;j is i kratkoe
  74.          db        04Ah,024h,'ë' ;J is I Kratkoe
  75.          db        06Bh,025h,'¬' ;k is k
  76.          db        04Bh,025h,'è' ;K is K
  77.          db        06Ch,026h,'½' ;l is l
  78.          db        04Ch,026h,'ï' ;L is L
  79.          db        03Bh,027h,'τ' ;; is ch
  80.          db        03Ah,027h,'ù' ;: is Ch
  81.          db        027h,028h,'Ω' ;' is hard
  82.          db        022h,028h,'Ü' ;" is Hard
  83.          db        060h,029h,'ε' ;` is yu
  84.          db        07Eh,029h,'₧' ;~ is Yu
  85. ;
  86.          db        07Ah,02Ch,'º' ;z is z
  87.          db        05Ah,02Ch,'ç' ;Z is Z
  88.          db        078h,02Dh,'∞' ;x is soft
  89.          db        058h,02Dh,'£' ;X is Soft
  90.          db        063h,02Eh,'µ' ;c is ts
  91.          db        043h,02Eh,'û' ;C is Ts
  92.          db        076h,02Fh,'ª' ;v is zh
  93.          db        056h,02Fh,'å' ;V is Zh
  94.          db        062h,030h,'í' ;b is b
  95.          db        042h,030h,'ü' ;B is B
  96.          db        06Eh,031h,'¡' ;n is n
  97.          db        04Eh,031h,'ì' ;N is N
  98.          db        06Dh,032h,'¼' ;m is m
  99.          db        04Dh,032h,'î' ;M is M
  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.