home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / misc_programming / 8042_io.spc < prev    next >
Text File  |  1990-01-08  |  2KB  |  55 lines

  1. ----------------------------------------------------------------------------
  2.      Send Command to 8042 Programming Sequence and Timing Consideration
  3.  
  4. Programming:
  5.     - wait 8042 input buffer empty 
  6.     - send command to 8042 input buffer (write to port 60h or 64h)
  7.     - wait 8042 input buffer empty to ensure that 8042 accepted the command
  8.  
  9. Note:
  10.  1. To read port 64h means to get status from the 8042 controller.
  11.  2. To write port 60h means to send command to the keyboard.
  12.  3. To write port 64h means to send command to the 8042 controller.
  13.  4. In general, the time-out value of waiting 8042 input buffer empty is
  14.     set to the maximum as follow:
  15.  
  16.                      XOR     CX,CX
  17.      INRCK1:         IN      AL,64H
  18.                      AND     AL,2
  19.                      LOOPNZ  INRCK1
  20. ----------------------------------------------------------------------------
  21. ----------------------------------------------------------------------------
  22.      Receive Data from 8042 Programming Sequence and Timing Consideration
  23.  
  24. Programming:
  25.     - wait 8042 output buffer full
  26.     - receive data from 8042 output buffer (read from port 60h)
  27.  
  28. Note:
  29.  1. To read port 64h means to get status from the 8042 controller.
  30.  2. To read port 60h means to receive data from the 8042 controller or the
  31.     keybord.
  32.  3. In general, the time-out value of waiting 8042 output buffer full is
  33.     set to the maximum as follow:
  34.  
  35.                      MOV     AH,6
  36.      OTRCK:          XOR     CX,CX
  37.      INRCK:          IN      AL,64H
  38.                      AND     AL,1
  39.                      JNZ     ONRET
  40.                      LOOP    INRCK
  41.                      DEC     AH
  42.                      JNZ     OTRCK
  43.      ONRET:
  44.  
  45.  4. The time-out value of waiting 8042 output buffer full is longer than
  46.     the time-out value of waiting 8042 input buffer empty because some data
  47.     will be responsed slowly by the 8042 controller.
  48.  
  49.  5. In INT 9 service routine, it is not necessary to wait 8042 output
  50.     buffer full for receiving data, because once the 8042 output buffer
  51.     full, IRQ 1 will be invoked automatically.
  52. ----------------------------------------------------------------------------
  53.  
  54.  
  55.