| CS306 | Processing Systems and Structures | J. W. Lockwood |
| IN AL,61h |
|
MOV DX, 1234h IN AL,DX |
| OUT 61h,AL |
|
MOV DX, 1234h OUT DX,AL |
| Port | Description |
|---|---|
| 40h | Channel 0 Count Register |
| 41h | Channel 1 Count Register |
| 42h | Channel 2 Count Register |
| 43h | Timer Control (See Below) |
| Bits | Description |
|---|---|
| 7,6 | Channel ID (00,01,10) |
| 5,4 | 00: latch count for reading 01: Read/Load high byte 10: Read/Load low byte 11: Read/Load low byte then high byte |
| 3,2,1 | Count Mode (011=Square Wave) |
| 0 | Count Method: 0=Binary, 1=BCD |
|
MOV AL,10110110b OUT 43h,AL |
|
IN AL,61h OR AL,00000011b OUT 61h,AL |
|
OUT 42h, AL MOV AL,AH OUT 42h, AL |
| Signal(s) | Input/ Output | Notes |
|---|---|---|
| Data[7:0] | Bidirectional | Byte-wide data bus |
| Strobe | To device | Write signal |
| Busy | From device | Don't send more data |
| Ack | From device | Acknowledge (interrupt signal) |
| Initialize | To device | Initialize external device |
| Out of Paper | From device | Status signal |
| Device | Data Port |
Status Port |
Control Port |
|---|---|---|---|
| LPT0: | 3BCh | 3BDh | 3BEh |
| LPT1: | 378h | 379h | 37Ah |
| LPT2: | 278h | 279h | 27Ah |
| Bit | Description |
|---|---|
| 7-5 | Unused |
| 4 | IRQ Enable |
| 3 | Select [inverted] |
| 2 | /Initialize |
| 1 | AutoFeed [inverted] |
| 0 | Strobe [inverted] |
| Bit | Description |
|---|---|
| 7 | /Busy [inverted] |
| 6 | Ack |
| 5 | Out-of-Paper |
| 4 | Selected |
| 3 | I/O Error |
| 2-0 | Unused |
| Bit | Pin Number | Description |
|---|---|---|
| 7 | 14 | Joystick B: Button 2 |
| 6 | 10 | Joystick B: Button 1 |
| 5 | 7 | Joystick A: Button 2 |
| 4 | 2 | Joystick A: Button 1 |
| 3 | 13 | Joystick B: Y-Coordinate |
| 2 | 11 | Joystick B: X-Coordinate |
| 1 | 6 | Joystick A: Y-Coordinate |
| 0 | 3 | Joystick A: X-Coordinate |