GN_Ptm, Convert (and display) internal time to an ASCII string

Register parameters

RST 20H, DEFW $0C09
IN:
     HL = 0, 1, 2, not allowed
     HL > 255, source pointer
     DE = 0, output result to stream IX
     DE = 1, output result to filter IX
     DE = 2, not allowed
     DE > 255, output result at (DE)

     A0 = 1, display leading zeroes
     A1 = 1, output leading spaces
     A2 = 1, output trailing spaces
     A3 = 0, always 0
     A4 = 1, display centiseconds (only if A5 = 1)
     A5 = 1, display seconds
     A6 = 1, military format (ie. no delimiters)
     A7 = 1, force AM/PM (as opposed to 24 hour format)

OUT, if call successful:
     Fc = 0
     DE = points to character after result (if DE(in) > 255)

OUT, if call failed:
     Fc = 1
     A = error code:
          RC_ROOM ($07), there is not enough room to convert time

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

Bugs

Will fail if source or destination pointers are in segment 2.

Related calls

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

web analytics