next up previous contents
Next: 4.1.3 Results Up: 4.1 Experimental Address Counter Card Previous: 4.1.1 Detection of Valid Memory References

4.1.2 PC Timer-Tick Interrupt

 

The standard IBM compatible PC provides for an interrupt generated by an Intel 8253 or equivalent timer circuit 65536 times per hour, or about 18.2 times per second. Thus, every 55 ms, IRQ 0 causes a system interrupt and the CPU jumps to the associated system interrupt vector. In MS-DOS systems, the vector of interest is 0x1C, and at that location exists code which updates the system clock. The user can install code to be executed at each timer tick by replacing the address at interrupt vector 0x1C with the address of the user code, and at the end of the (short) user routine, jumping to the address that was previously in the vector. The code can be de-installed by replacing the original interrupt vector.

Note that the timer tick interrupt is maskable, and may be delayed or disabled through careful use of the 80x86 CLI and SEI (clear and set Interrupt bit) opcodes. It is for this reason that some programs which require high-accuracy timing (often using the 8253 timers) have a side-effect of slowing-down the DOS clock. The real time, of course, is restored on reboot by the battery-backed clock.



Scott E. Harrington
Sat Apr 29 18:56:25 EDT 1995