PgrAm
Experienced Member
I'm messing with different ways to get high resolution timing in DOS, only now did I just realize you can simply read the counter from the PIT (good example here). However I don't need THAT much resolution (ticks at approximately 1.19 MHz), so I figure I'll just read the high byte from the timer giving me a rate of 4661 ticks per second which is good enough for me. The PIT allows you to change the mode to allow reading the high byte only as per this article, which leads to my question.
Is it safe to change the timer mode to read the high byte only and then re-enable interrupts while this change is in place? Does DOS assume that the timer is in access mode 3 (Highbyte/lowbyte) and that no program changes this? You know cause if I changed the read mode and then DOS code expecting the read mode to be different ran inside an interrupt there's no telling what would happen.
So does anybody know if DOS cares what read mode the timer is in and if so what mode does it set/expect it to be?
Is it safe to change the timer mode to read the high byte only and then re-enable interrupts while this change is in place? Does DOS assume that the timer is in access mode 3 (Highbyte/lowbyte) and that no program changes this? You know cause if I changed the read mode and then DOS code expecting the read mode to be different ran inside an interrupt there's no telling what would happen.
So does anybody know if DOS cares what read mode the timer is in and if so what mode does it set/expect it to be?