3.3.8Read/Write 8-bit data Register
(Read/Write):wBase+0xc0/0xc4/0xc8/0xd0/0xd4/0xd8/
0xe0/0xe4/0xe8/0xf0/0xf4/0xf8/
Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
Note. Refer to Sec. 3.1 for more information about wBase.
There are twelve
outportb(wBase+0xc0,Val); | /* write to Port0 | */ |
Val=inportb(wBase+0xc0); | /* read from Port0 | */ |
outportb(wBase+0xcc,0x07); | /* set port0~port2 as D/O ports | */ |
outportb(wBase+0xc0,i1); | /* write to Port0 | */ |
outportb(wBase+0xc4,i2); | /* write to Port1 | */ |
outportb(wBase+0xc8,i3); | /* write to Port2 | */ |
outportb(wBase+0xec,0x04); | /* set Port6 & Port7 as D/I ports */ | |
| /* set Port8 as D/O port | */ |
j1=inportb(wBase+0xe0); | /* read Port6 | */ |
j2=inportb(wBase+0xe4); | /* read Port7 | */ |
outportb(wBase+0xe8,j3); | /* write to Port8 | */ |
NOTE: Make sure the I/O port configuration (DI or DO) before performing read/write to the data register. (Refer to sec. 3.3.7)