 TITLE 'CP-V/CP-R GRAPHICAL DISPLAY MODULE ELLA. 708011-51A00 3.18.74'
         SYSTEM   SIG7FDP
*
*
*
         DEF      DISP:0
         REF      L:SPACE,L:PRINT,E:PRINT
         REF      HEXEBC,HEXTWO,MS:HMSN,DSP:
         REF      BUFFER,CF,CAB,COMBUFF
         REF      R:COM,DECHEX:,READ:ERF
         REF      REW:FLAG,YR:R,JD:R
*
*
*
TEXTS    CNAME
         PROC                       THIS PROCEEDURE
         DISP     %                 SUPPRESSES TEXT
         LIST     0                 PRITOUT.
LF       TEXT     AF
         LIST     1
         PEND
         PAGE
*
*
         CSECT
TITL1    TEXTS    'G R A P H I C  D I S P L A Y            '
TITL2    TEXTS    '- - - - - - -  - - - - - - -'
TITL4    TEXTS    'TIME ERRORS'
TITL5    TEXTS    '-----0------------------10------------------20',;
                  '------------------30----'
TITL6    TEXTS    'END OF FILE'
OUTBUF   TEXTS    '                                              ',;
                  '                                              '
INPUE    TEXTS    'INVALID REQUEST'
INPU2    TEXTS    'INVALID REQUEST. (QUAL .GT. 60 MIN)'
ERRX     TEXTS    'NON-DECIMAL VALUE IN R14, DECHEX: ROUTINE'
*
         BOUND    8
SOUTPUT  RES      3
SINPUT   RES      3
ODATE    PZE
OYEAR    PZE
FTFLG    PZE
TSCALE   PZE
WORDCNT  PZE
PASSFLG  PZE
QUALTEMP PZE
TMXFLG   PZE
ZEROFLG  PZE
COUNT    PZE
OVERFLOW PZE
         PAGE
         BOUND    8
HOURS    PZE
MINUTES  PZE
*
ADDR     PZE
SCALE    PZE
NEXTIME  PZE
TWORK    PZE
MAXTIME1 PZE
RELTIME3 PZE
NTIME    PZE
NYEAR    PZE
NDATE    PZE
*
MAXTIME  DATA     X'05265BFF'
TDEFAULT DATA     X'0000EA60'
X40X     DATA     X'40404040'
:KX0000F DATA     X'0000000F'
PATCH    RES      100
         PAGE
DISP:0   LI,7     -8
         STW,0    ODATE+8,7
         BIR,7    %-1
         STW,1    REW:FLAG
         LW,13    CF
         BEZ      QUAL07
*
QUAL05   MTW,1    CAB
         LW,13    CAB
         CI,13    79
         BG       QUAL06
         LW,4     13
         LB,12    COMBUFF,4
         CI,12    X'40'
         BE       QUAL05
         CI,12    X'0D'
         BE       QUAL06
         MTW,1    PASSFLG
         CI,12    X'F0'
         BL       QUALERR
         CI,12    X'F9'
         BCS,2    QUALERR
         LW,15    WORDCNT
         CI,15    3
         BGE      QUALERR
         MTW,1    WORDCNT
         AND,12   :KX0000F          FROM END OF QUAL05
         SLS,12   28
         LW,13    QUALTEMP
         STH,13   12,1
         SCS,12   4
         STW,12   QUALTEMP
         B        QUAL05
         PAGE
*
QUAL06   LW,12    PASSFLG
         BEZ      QUALERR
         LW,14    QUALTEMP
         BAL,15   DECHEX:
         B        QERR
         STW,15   TSCALE
         CI,15    60
         BG       QUALERR2
*
QUAL07   LI,14    28
         BAL,15   L:PRINT           TITLE, GRAPHIC DISPLAY
         DATA     TITL1
         BAL,15   L:PRINT
         DATA     TITL2
         BAL,15   L:SPACE
         BAL,15   L:SPACE
         BAL,15   L:SPACE
         BAL,15   DSP:
         BAL,15   L:SPACE
         BAL,15   L:SPACE
         BAL,15   L:SPACE
         LI,14    10
         BAL,15   L:PRINT
         DATA     TITL4
         LI,14    68
         BAL,15   L:PRINT
         DATA     TITL5             PRINT, -----0......
         BAL,15   INPUT
         B        END
         PAGE
*
         STW,0    TMXFLG
         STW,0    ZEROFLG           CLEAR FLGS
         STW,0    COUNT
         STW,0    OVERFLOW
         LI,13    HA(OUTBUF)+3
         STW,13   ADDR
         LW,14    MAXTIME
         STW,14   MAXTIME1
         MTW,1    MAXTIME1
         LW,14    JD:R,1
         STW,14   RELTIME3
         STW,14   NTIME
         BAL,15   MS:HMSN           CONVERT TO HH:MM:SS:NNN
         STD,12   HOURS
*
NEW05    LI,13    0
         LW,14    HOURS
         BAL,15   HEXTWO
         DATA     OUTBUF
         LI,13    3
         LW,14    MINUTES
         BAL,15   HEXTWO
         DATA     OUTBUF
         LI,13    X'7A'
         STB,13   OUTBUF,2
         CW,1     TMXFLG
         BE       RTMX
         LW,14    TSCALE
         BEZ      INIT05
         LW,13    TDEFAULT
         MW,13    TSCALE
         STW,13   SCALE
         B        INIT10
         PAGE
*
INIT05   LI,13    10
         STW,13   TSCALE
         LW,13    TDEFAULT
         MW,13    TSCALE
         STW,13   SCALE
INIT10   LW,14    SCALE
         AW,14    NTIME
         STW,14   NEXTIME
         B        LOOP01
*
RTMX     STW,0    TMXFLG
         B        LOOP01
*
LOOP     BAL,15   INPUT
         B        END
*
LOOP01   LW,13    NYEAR
         CW,13    OYEAR             HAS YEAR CHANGED
         BG       LOOP02            IF SO, BRANCH
         LW,13    NDATE
         CW,13    ODATE             HAS DATE CHANGED
         BG       LOOP02            IF SO, BRANCH
         LW,13    JD:R,1            FETCH REL. TIME
         CW,13    RELTIME3          IS CURRENT > OR = PREVIOUS TIME
         BGE      %+2               IF SO, BRANCH
         B        LOOP05
         LW,14    ZEROFLG
         BNEZ     LOOP02B
         STW,13   RELTIME3          IS CURNTIME = OR > NEXTIME ON SCALE
         CW,13    NEXTIME           IF SO, BRANCH
         BL       LOOP05
*
LOOP02   LW,14    ZEROFLG
         BEZ      LOOP02A
         LW,13    JD:R,1
         STW,13   RELTIME3
         CW,13    NEXTIME
         BL       LOOP05
         B        LOOP02C
LOOP02A  LW,13    OVERFLOW
         BNEZ     %+2
         BAL,15   OUTPUT
         STW,0    ZEROFLG
         STW,0    OVERFLOW
         STW,0    COUNT
         LW,13    NEXTIME
         STW,13   NTIME
         LW,13    SCALE
         AW,13    NTIME
         CW,13    MAXTIME1
         BL       LOOP03
         LW,14    MAXTIME
         STW,14   NTIME
         SW,13    MAXTIME1
         STW,13   NEXTIME
         MTW,1    ZEROFLG
         B        LOOP04
LOOP02B  EQU      %
         STW,13   RELTIME3
         CW,13    MAXTIME
         BL       LOOP05
LOOP02C  STW,0    ZEROFLG
         MTW,1    ODATE
         LW,14    ODATE
         CI,14    365
         BLE      LOOP02A
         STW,1    ODATE
         MTW,1    OYEAR
         MTW,1    ODATE
         LW,14    ODATE
         CI,14    365
         BLE      LOOP04
         STW,1    ODATE
         MTW,1    OYEAR
         B        LOOP04
*
LOOP03   STW,13   NEXTIME
LOOP04   LW,12    MINUTES
         AW,12    TSCALE
         STW,12   TWORK
         STW,12   MINUTES
         STW,1    TMXFLG
         CI,12    60
         BL       NEW05
         LW,13    TWORK
         AI,13    -60
         STW,13   MINUTES
         MTW,1    HOURS
         LW,13    HOURS
         CI,13    24
         BL       NEW05
         LI,13    -24
         AWM,13   HOURS
         B        NEW05
*
LOOP05   LW,14    OVERFLOW
         BNEZ     LOOP
         LH,14    BUFFER
         BAL,15   HEXEBC
         LW,4     ADDR
         LH,15    15
         STH,15   0,4               PUT ERR CODE IN OUTBUF
         MTW,1    ADDR
         MTW,1    COUNT
         LW,14    COUNT
         CI,14    30
         BL       LOOP
         LI,15    X'C6C6'
         LW,4     ADDR
         STH,15   0,4
         BAL,15   OUTPUT
         STW,1    OVERFLOW
         B        LOOP
         PAGE
*
*        ROUTINE SECTION
*
END      EQU      %
         BAL,15   OUTPUT
         BAL,15   L:SPACE
         LI,14    11
         BAL,15   L:PRINT
         DATA     TITL6
         BAL,15   L:SPACE
         BAL,15   L:SPACE
         BAL,15   L:SPACE
         B        R:COM
*
QUALERR  EQU      %
         LI,14    15
         BAL,15   E:PRINT
         DATA     INPUE
         B        R:COM
*
QUALERR2 EQU      %
         LI,14    35
         BAL,15   E:PRINT
         DATA     INPU2
         B        R:COM
*
QERR     LI,14    41
         BAL,15   E:PRINT
         DATA     ERRX
         B        R:COM
         PAGE
*
INPUT    EQU      %
         LCI      3
         STM,13   SINPUT
INPUT01  EQU      %
         BAL,15   READ:ERF          READ AN ERROR RECORD
         STW,0    REW:FLAG
         CI,15    1
         BNE      *SINPUT+2         EOF/EOD
         LW,13    YR:R
         STW,13   NYEAR
         LW,13    JD:R
         STW,13   NDATE
         LW,13    FTFLG
         BNEZ     INPUT15
         MTW,1    FTFLG
         LW,13    NYEAR
         STW,13   OYEAR
         LW,13    NDATE
         STW,13   ODATE
INPUT15  LB,14    BUFFER
         BEZ      INPUT01
         CI,14    X'21'
         BE       INPUT01
         CI,14    X'22'
         BE       INPUT01
         CI,14    X'23'
         BE       INPUT01
         MTW,1    SINPUT+2
         LCI      2
         LM,13    SINPUT
         B        *SINPUT+2    RETURN BACK......
         PAGE
*
*
* ROUTINE PRINTS ONE LINE OF INFORMATION
*
OUTPUT   EQU      %
         STW,4    SOUTPUT+2
         STD,14   SOUTPUT
         LI,14    68
         BAL,15   L:PRINT
         DATA     OUTBUF
         LI,4     -20
         LW,14    X40X
         STW,14   OUTBUF+20,4
         BIR,4    %-1
         LI,14    HA(OUTBUF)+3
         STW,14   ADDR
         LW,4     SOUTPUT+2
         LW,14    SOUTPUT
         B        *SOUTPUT+1
         END      DISP:0

