Calculator Community > Calculator C
[TIGCC] Key Testing Too Fast?
Ranman:
Here is a decent sleep function that is can be used on both real and VTI.
The IsVTI() ASM function was written by Julien Muchembled, I found it on the TIGCC Headquarters message board a while back. The Sleep() function is code that I wrote. It basically puts the calc's CPU into an idle state for the specified number of milliseconds. Hence, it saves battery power -- which is a good thing!
The 68K Assembly code needed...
c1-->CODE ec1
|=============================================================================
| VTI detection routine (by Julien Muchembled)
|
| this routine utilizes a bug in VTI: you can set even non-existing flags in
| the status register and query them later!
|=============================================================================
| C prototype:
| short IsVTI(void);
.data
.globl IsVTI
.even
IsVTI:
DJ Omnimaga:
so I assume it should be used for delays instead of like a for/while/repeat loop right? Good stuff to know
Ranman:
QuoteBegin-xlibman+Aug 13 2006, 06:12 PM-->QUOTE (xlibman @ Aug 13 2006, 06:12 PM) so I assume it should be used for delays instead of like a for/while/repeat loop right? Good stuff to know
Yes.
A for/while loop used simply for a time delay without idling the CPU is just a waste of battery power. ;)
DJ Omnimaga:
I am wondering if there is that kind of stuff on the z80 models
Navigation
[0] Message Index
[*] Previous page
Go to full version