Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Applied links to System Call Reference API's

...

Times are internally represented as unsigned 3-byte integers representing the number of 10ms (1/100 of a second) intervals since the start of the day. Routines exist to convert between this format and an ASCII string, again with various options. Further routines are provided to read or set the machine time and date. The available routines are as follows, their specifications can be found in "System Calls Reference":

GN_

...

Gdt      convert

...

an

...

ASCII

...

string

...

to

...

an

...

internal

...

date
GN_

...

Pdt      convert

...

an

...

internal

...

date

...

to

...

an

...

ASCII

...

string
GN_

...

Die      convert

...

from

...

internal

...

to

...

external

...

format
GN_

...

Dei      convert

...

from

...

external

...

to

...

internal

...

format
GN_

...

Gmd      fetch

...

current

...

machine

...

date
GN_

...

Pmd      set

...

current

...

machine

...

date

GN_

...

Gtm      convert

...

an

...

ASCII

...

string

...

to

...

an

...

internal

...

time
GN_

...

Ptm      convert

...

an

...

internal

...

time

...

to

...

an

...

ASCII

...

string
GN_

...

Gmt      fetch

...

current

...

machine

...

time
GN_

...

Pmt      set

...

current

...

machine

...

time
GN_

...

Msc      convert

...

real

...

time

...

to

...

elapsed

...

time
GN_

...

Sdo      output

...

date

...

and

...

time

...

to

...

standard

...

output

 
Code Block
languagenone
titleExample
include "time.def"                  ; time & date call definitions
include "stdio.def"                 ; standard I/O call definitions

; simple example to display the current date 
; assumes IY points to at least 30 bytes of available memory 
; this memory should not lie in segment 2 

            push iy
            pop  de                 ; buffer for date
            oz   GN_Gmd             ; get machine date
                                    ; DE = DE(in) + 3
            push iy
            pop  hl                 ; source date
            ld   a, 240             ; century output, C = interfield delimiter
            ld   b, 15              ; expanded day and month (no AD/BC)
            ld   c, '.'             ; interfield delimiter
            oz   GN_Pdt             ; put date in ASCII format
            xor  a
            ld   (de),a             ; null-terminate ASCII string
            push iy
            pop  hl
            inc  hl
            inc  hl                 ; adjust string buffer address
            inc  hl                 ; of converted string
            oz   GN_Sop             ; write string to std. output
            oz   GN_Nln             ; new line
            ret