Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagenone
titleRST 20H, DEFW $2009
IN:
     A = 0MT_CVT ($00), convertConvert source to time to elapse:
     BHL = source time days
     CDE = source time centiseconds/ticks

     A = 1 MT_UBT ($01), Update base time (used over reset):
     BHL = Additionaladditional offset in minutes.
     C = offset in seconds.

   OUT, if A(in) = 0 and successful:
     = MT_UPT ($02), Read uptime

OUT, if A(in) = MT_CVT
	 Fc = 0, success
     	BHL = minutes still to elapse
     	C = seconds still to elapse (only when minutes < 0)
     	A = centiseconds still to elapse
 OUT,   if A(in)Fc = 1:, failure
    - 	A OUT, if call failed:
     Fc = 1
     A = error code:
= RC_FAIL ($16), time given to routine has already elapsed

Registers changed after return:
     ....DE../IXIY same
     AFBC..HL/.... different

OUT, RC_FAILif A($16in), time= givenMT_UBT
to	 routineFc has= already0, elapsed.always

Registers changed after return:
     A.BCDEHL/IXIY same
     .F....../IXIY same
     AFBCDEHL/.... different 

Notes

.... different

OUT, if A(in) = MT_UPT
	 Fc = 0, always
	 DE = days since latest hard reset
	 H = hours, L = minutes and C = seconds

Notes

  • MT_CVT : Operating system uses this call to determine when an alarm has to be triggered by calculating difference between alarm time and current time.
  • MT_UBT : Applications should not use this call
with A(in) = 1
  • , the system
uses the call in this way
  • to
help
  • maintain the time over soft reset.
The call's function is to indicate how much time there is to elapse between the time given and the current time. This routine subtracts a small offset from the difference between wanted time and current time to allow for the routine processing overhead
  • It adjusts the base time because hardware timers are reset.
  • MT_UPT : Uptime is the operating system running time since latest hard reset. Uptime is preserved over soft reset.

Related calls

GN_Gmt, get (read) machine time in internal format
GN_Gtm, convert an ASCII string to a time in internal format
GN_Pmt, put (set) machine time
GN_Ptm, write internal time as ASCII string
GN_Sdo, send date and time to standard output
OS_Dly, delay a given period