home *** CD-ROM | disk | FTP | other *** search
- ; PROGRAM: TCLOCK
- ; AUTHOR: Al Hawley
- ; VERSION: 1.1
- ; DATE: 12/29/89
- ; Version Author: Al Hawley (aeh)
- ; PREVIOUS VERSIONS: 12/30/88
-
- ; This program determines which operating system is present and
- ; which clock drivers (if any) are available. It reads the
- ; system clock and transfers the time to the WYSE-60 terminal
- ; clock whose time is displayed on the terminals status line.
- ; The program reads as standard clocks, the Date/Time services
- ; provided by ZSDOS, ZDDOS, CPM+(CP/M 3.0), DateStamper, and a
- ; user supplied RTC which meets certain interface standards.
- ; An example of such a clock interface is included in BIOCLK.
-
- VERS EQU 11
- ; Added the BIOCLK module by means of which a user can provide
- ; for use of a 'non-standard' Real-Time-Clock.
-
- ;Externals, Entry Points, and definitions here
-
- .request gtosd
- ext gt_osd,rdclk,time,ascidt
- .request bioclk
- ext rdbclk
- .request z3lib,syslib
- ext z3init,epstr,cout
-
- include sysdef
-
- ; Start of Program
- module: jp start
- db 'Z3ENV' ;This is a ZCPR3 Utility
- db 1 ;External Environment Descriptor
- z3eadr: dw 0 ;gets filled in by Z33/4 or Z3INST
- dw module ;reserved for type 3/4 env use
-
- ;======================================================
-
- ; Configuration Parameters for program defaults
- db 'xxxxxxxx' ;PROGRAM ID STRING for configuration data
- ds 1,0 ;allow for up to 8 char plus null terminator
- ; Configuration Data here
-
- ;======================================================
-
- ; Start of Program
- start: ; Initialize ZCPR3 Environment
- ld hl,(z3eadr) ;pt to ZCPR3 environment
- call z3init ;initialize the ZCPR3 Env and the VLIB Env
- ld a,h
- or l
- ld (z3flag),a ;if 0, not Z3. if NZ, then Z3 is present
- ld (stack),sp ; save callers stack
- ld sp,stack ; set local stack
-
- call gt_osd ;Check OS, get clock data structure addr.
- jr c,mainx ;abort if unrecognized OS
- jr nz,dotime ;nz=valid clock found
- ;A system clock is not defined. If a user supplied clock
- ;is provided, then its address and the byte to be passed
- ;in C or A must be installed at (HL)+5 and (HL)+4, respectively
- ;before a call to TIME or RDCLK.
- call rdbclk ;read bios clock, ret HL->std DT buf
- call ascidt ;convert BCD Date/Time to formatted ASCII
- ;ret hl-> yy/mm/dd_hh:mm:ss
- xor a ;make Z to skip the TIME call
- dotime: call nz,time ;read standard clocks
- ;ret hl-> yy/mm/dd_hh:mm:ss
- ld (dtstr),hl ;save pointer to formatted Date/Time
- ld bc,9 ;offset to hh
- add hl,bc
- ld de,newtim
- ldi
- ldi
- inc hl ;skip the colon
- ldi
- ldi
-
- ;display the date/time on the screen.
- ld hl,(dtstr) ;hl -> formatted Date/Time
- call epstr
- ;do this last, because it ties up the terminal for
- ;a second or so.
- ld hl,setterm
- call epstr ;send setup string to terminal
- mainx: ld sp,(stack)
- ret
-
- ;------------------------------------------------
-
- setterm:
- db esc,'c8' ;Wyse60 lead in to set terminal clock
- newtim: db '1200' ;hhmm
- db 0 ;string terminator
- dtstr: ds 2 ;->formatted asci d/t string
-
- z3flag: ds 1
- ds 20
- stack: ds 2
-
- end
-