home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / COMM / MISC / SRC26_2.ZIP / SRC / KEYDRVPC.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-06-23  |  1.8 KB  |  92 lines

  1.     name    keydrvpc
  2. ;
  3. ; keydrvpc.asm: hterm key board driver for IBM-PC
  4. ;
  5. ; Author: HIRANO Satoshi
  6. ;
  7. ; (C) 1989  Halca Computer Science Laboratory TM
  8. ;           University of Tokyo
  9. ;
  10. ; Edition History:
  11. ; 2.2 89/05/16 Halca.Hirano V2.2 distribution
  12. ; 2.3 89/06/20 Halca.Hirano rename from xkeypc.asm
  13. ; 2.4 89/07/02 Halca.Hirano add strPut() for string putting to CRT
  14. ; 2.5 89/07/27 Halca.Hirano far
  15. ;    ---- V2.4.0 distribution ----
  16. ; 2.6 90/06/22 Tominaga@titech force to enable interrupt at returning
  17. ;    from inputKey() against ATOK's mischief
  18. ;
  19. ; $Header: keydrvpc.asv  1.5  90/06/23 03:19:04  hirano  Exp $
  20.  
  21. _TEXT    segment byte public 'CODE'
  22. _TEXT     ends
  23.     assume    cs:_TEXT
  24. _TEXT    segment
  25.     public    _inputKey
  26. _inputKey proc far
  27.     mov    ah,1
  28.     int    016h
  29.     jnz    _ink2
  30.     mov    ax,-1
  31.     jmp _ink3
  32. _ink2:    mov    ah,0
  33.     int    16h
  34. _ink3:
  35. ; to override someone's arbitrary disabling of hardware interrupts
  36.     sti        ; sometimes ATOK disables interrupt!
  37.     ret
  38. _inputKey endp
  39.  
  40.     public    _checkBIOSKey
  41. _checkBIOSKey proc far
  42.     mov    ah,1
  43.     int    016h            ; ? got
  44.     jnz    _inb2            ; bra if so
  45.     mov    ax,0            ; return no
  46.     ret
  47. _inb2:    mov    ax,1            ; return yes
  48.     ret
  49. _checkBIOSKey endp
  50.  
  51. ;
  52. ; strPut(page, n, x, y, str)
  53. ;
  54. ; in:
  55. ;    page    page number
  56. ;    n    number of chars
  57. ;    x    cursor x
  58. ;    y    cursor y
  59. ;    str    far pointer to string
  60. ; note: cursor position does not change
  61. ;
  62.     public    _strPut
  63. _strPut proc    far
  64.     push    bp
  65.     mov    bp,sp
  66.     push    bx
  67.     push    cx
  68.     push    dx
  69.     push    es
  70.     mov    ah,13h            ; string write code
  71.     mov    al,2            ; char, attr write
  72.     mov    cx,[10+bp]
  73.     mov    dh,ch            ; x
  74.     mov    cx,[12+bp]
  75.     mov    dl,cl            ; y
  76.     mov    cx,[8+bp]        ; number of chars
  77.     mov    bx,[6+bp]        ; page number
  78.     mov    bl,0            ; attribute (not used)
  79.     mov    bp,[14+bp]        ; far pointer to str
  80.     push    ds
  81.     pop    es            ; make it far pointer
  82.     int    010h            ; call bios
  83.     pop    es
  84.     pop    dx
  85.     pop    cx
  86.     pop    bx
  87.     pop    bp
  88.     ret
  89. _strPut endp
  90. _TEXT    ends
  91.     end
  92.