; Library: ZSLIB ; Version: 1.0 ; Module: ZSPTIMC3 ; Version: 1.0 ; Author: Carson Wilson ; Date: August 9, 1988 ; Purpose: Print civilian time with formatted hours. ; PUBLIC PTIMC3 EXTRN COUT,PA2HC ; SYSLIB EXTRN PHL4DC,PAFHC ; ZSLIB ; ; PTIMC3 - Print civilian time as "hh:mm " or "h:mm " if a.m., ; "hh:mmp" or "h:mmp" if p.m. ; Print relative time as "+nnnn ". ; ; Entry: - points to date as BCD yy mm dd hh mm ; Exit: Time printed ; Uses: - None ; PTIMC3: push hl push de push bc push af ld b,' ' ; Default to a.m. or relative inc hl inc hl inc hl ; Point to time bit 7,(hl) ; Test relative jr z,REALTM ld a,'+' ; Show relative time call COUT ld d,(hl) inc hl ld e,(hl) ex de,hl res 7,h ; Remove flag call PHL4DC ; Print relative time jr EXIT REALTM: ld a,(hl) ; Hours or a ; Hour 0 (00:xx a.m.)? jr z,NOTML1 ; Yes, make 12:xx a.m. cp 13h ; Time past 12:59 hours? jr c,NOTMIL ; No, don't change ld b,'p' ; Yes, p.m. sub 12h ; Xlate to civilian daa NOTMIL: cp 12h ; 12:xx p.m.? jr nz,NOTML2 ; No ld b,'p' ; Yes, show '12:xxp' NOTML1: ld a,12h ; Make 12:xx NOTML2: call PAFHC ; Print formatted hours ld a,':' call COUT inc hl ld a,(hl) call PA2HC ; Print minutes EXIT: ld a,b call COUT ; 'p' or space pop af pop bc pop de pop hl ret end ; End ZSPTIMC3.Z80