Programming
106 – CIO Chip
VL-486-4 Reference Manual
// Should generate an Interrupt, with AAh in indexed register 1Fh
printf ("Check value of 'Current Vector Register' after sending 55h\n");
outportb(0xE7, 0x1F);
in_val1 = inportb(0xE7);
printf ("Output E7, 1Fh; returned value = %x\n", in_val1);
// Interrupt pending (IP) bit (bit5) of index register 09h should be set
printf("Check value of Port B command and status, is bit 5 set?\n");
outportb(0xE7, 0x09);
in_val1 = inportb(0xE7);
printf ("Output E7, 09h; returned value = %x\n", in_val1);
// To clear IP bit, write A0h to indexed register 09h
printf ("Write Port B Command and Status register, clear IP\n");
outportb(0xE7, 0x09);
//
outportb(0xE7, 0xA0);
outportb(0xE7, 0x09);
// Test if values are written to Z8536
in_val1 = inportb(0xE7);
printf ("Output E7, 09h and E7, A0h; returned value = %x\n", in_val1);
// Current vector register should be FF again
printf ("Check value of 'Current Vector Register' after clearing IP for port B\n");
outportb(0xE7, 0x1F);
in_val1 = inportb(0xE7);
printf ("Output E7, 1Fh; returned value = %x\n", in_val1);
/* ---------- End of test ----------- */
in_val1 = inportb(0xE7);
// put state machine into state 1
outportb(0xE7, 0x01);
// Disable ports A,B, & C
outportb(0xE7, 0x00);
}