home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Unsorted BBS Collection
/
thegreatunsorted.tar
/
thegreatunsorted
/
programming
/
misc_programming
/
8042_io.spc
< prev
next >
Wrap
Text File
|
1990-01-08
|
2KB
|
55 lines
----------------------------------------------------------------------------
Send Command to 8042 Programming Sequence and Timing Consideration
Programming:
- wait 8042 input buffer empty
- send command to 8042 input buffer (write to port 60h or 64h)
- wait 8042 input buffer empty to ensure that 8042 accepted the command
Note:
1. To read port 64h means to get status from the 8042 controller.
2. To write port 60h means to send command to the keyboard.
3. To write port 64h means to send command to the 8042 controller.
4. In general, the time-out value of waiting 8042 input buffer empty is
set to the maximum as follow:
XOR CX,CX
INRCK1: IN AL,64H
AND AL,2
LOOPNZ INRCK1
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Receive Data from 8042 Programming Sequence and Timing Consideration
Programming:
- wait 8042 output buffer full
- receive data from 8042 output buffer (read from port 60h)
Note:
1. To read port 64h means to get status from the 8042 controller.
2. To read port 60h means to receive data from the 8042 controller or the
keybord.
3. In general, the time-out value of waiting 8042 output buffer full is
set to the maximum as follow:
MOV AH,6
OTRCK: XOR CX,CX
INRCK: IN AL,64H
AND AL,1
JNZ ONRET
LOOP INRCK
DEC AH
JNZ OTRCK
ONRET:
4. The time-out value of waiting 8042 output buffer full is longer than
the time-out value of waiting 8042 input buffer empty because some data
will be responsed slowly by the 8042 controller.
5. In INT 9 service routine, it is not necessary to wait 8042 output
buffer full for receiving data, because once the 8042 output buffer
full, IRQ 1 will be invoked automatically.
----------------------------------------------------------------------------