Specifications

Table Of Contents
old_handler = getvect(0x72); /* Hardwired for IRQ10 */
/* Install out new interrupt handler */
setvect(0x72,int_handler);
/* Clear the transition count values and enable the falling edge
interrupts.
*/
for(x=1; x<25; x++)
{
int_counts[x] = 0; /* Clear the counts */
enab_int(x,FALLING); /* Enable the falling edge interrupts */
}
/* Unmask the interrupt controller */
outportb(0xa1,(inportb(0xa1) & 0xfb)); /* Unmask IRQ 10 */
/* Reenable interrupts */
enable();
/* Set up the display */
clrscr(); /* Clear the Text Screen */
for(x=1; x<25; x++)
{
gotoxy(1,x);
printf("Bit Number %02d ",x);
}
/* We will continuously print the transition totals until a
key is pressed */
/* All of the processing of the transition interrupts, including
updating the counts is done in the background when an interrupt
occurs.
*/
while(!kbhit())
{
for(x=1; x < 25; x++)
{
gotoxy(16,x);
printf("%05u",int_counts[x]);
}
}
getch();
/* Disable interrupts while we restore things */
disable();
/* Mask off the interrupt at the interrupt controller */