??? 01/28/05 20:26 Read: times |
#86052 - not assembler but int Responding to: ???'s previous message |
Reading FF by replacing with 00 can never cause an overflow !!!
This is the meaning of the XCH instruction. And thus assembler was needed to do so. The way you have coded it is totally irrelevant, it will still fail if an interrupt with higher priority is executing a certain number of instruction cycles before the T0 int is executed. Obviously, when reading a timer at an int (and no other higher priority int delaying the execution) the TL will always be at some low value and thus the carry fro TL to TH will not take place during the execution of the read. Thus, if no higher prt is long enough you can read the timer in its interrupt without stopping - I would never rely on that. Whether you do it with C, assembler, mov or xch is irrelevant. Erik |