Code: Select all
LD HL,$E006
LD C,(HL)
Code: Select all
LD HL,$E006
LD C,(HL)
LD B,(HL)
Indeed, the MONITOR code shows such assembly lines, so I change to:The 8253 provides a special READ operation (read on the fly) that transfers the contents of the counter into a temporary storage and lets the CPU to read the data from the register. The timer continues to count down. To latch the current counter value a special mode control word is issued to the timer. The control word for latch {...} uses only from MSB of the control word rest we don’t cares. Bits 7&6 (SC1&SC0) select the counter to be read and bits 3 and 4 (RL1&RL0) are set to 00 to indicate a latching instruction. After the count has been latched, either or both of the bytes can be read.
Code: Select all
LD HL,$E007 // $E007: latch counter #2
LD (HL),$80
DEC HL // $E006: read counter #2
LD C,(HL)
LD B,(HL)
The main reason I want it so badly, is because I want to use counter #2 to count BLANK numbers as an equivalent way to determine how much CPU percent is used since we cannot change the border color as usually done on other computers.
Unless someone would be able to tell me the solution, I think I keep a 8-bit counter #2 in two-BLNK unit. Less precise but still enough to get a CPU usage percent.