int CIn(int CounterNum, int *CountValue) { int TempByte, Register; int ReadLowByteMask1 = 0x20; /* RL1 | */ int ReadLowByteMask2 = 0xef; /* RL0 & */ int ReadHighByteMask1 = 0xdf; /* RL1 & */ int ReadHighByteMask2 = 0x10; /* RL0 | */ int CountValue1, CountValue2; switch (CounterNum) { case 1: Register = LOADREAD1; break; case 2: Register = LOADREAD2; break; case 3: Register = LOADREAD3; break; default: return(1); break; } TempByte = (0x3f | ReadLowByteMask1) & ReadLowByteMask2; outb(TempByte, CCONFIGPORT); CountValue1 = inb(Register); printf("The low value is --> %x.\n", CountValue1); TempByte = (0x3f & ReadHighByteMask1) | ReadHighByteMask2; outb(TempByte, CCONFIGPORT); CountValue2 = inb(Register); printf("The high value is --> %x.\n", CountValue2); return(1); }