;**************************************************************************
; SEEU.M68      -       "See U"
;
; by Dave Heyliger - AMUS Staff
;
; Displays the current setting of U.LIT or any copy thereof
;**************************************************************************

       SEARCH  SYS                     ;search the normals
       SEARCH  SYSSYM
       SEARCH  TRM
       SEARCH  AAA                     ;from [100,130]

DEFINE  BRIGHT=PRTTAB -1,12.
DEFINE  DIM=PRTTAB -1,11.

       .OFINI
       .OFDEF  MODULE,8.               ;module name (like U)
       .OFSIZ  IMPSIZ

       PHDR    -1,0,PH$REE!PH$REU      ;define header
       GETIMP  IMPSIZ,A5               ;A5 points to variable list

       ;first get your user stats: bottom of mem, top of mem.
       JOBIDX  A6                      ;get yourself
       MOV     JOBBAS(A6),A4           ;store current user base
       CLR     D0

       ;make sure the end contitions aren't met or ^C not entered
SCS:    CTRLC   EXIT                    ;quit on ^C
       TST     @A4                     ;end of partition?
       BEQ     EXIT                    ;yup

       ;else find any module with SCS as the extension
       CMMW    #[SCS],10.(A4)          ;".SCS" module?
       BNE     NOSCS                   ;nope

       ;found an ".SCS" module, type out module plus internal meaning
       INC     D0                      ;found a module - mess D0 up
       LEA     A2,MODULE(A5)           ;point A2 to buffer space
       LEA     A1,6(A4)                ;point A1 to RAD50 module name
       UNPACK                          ;unpack the module name
       UNPACK
       CLRB    @A2                     ;end string w/ null
       LEA     A2,MODULE(A5)           ;repoint to module name
       TTYL    @A2                     ;type out module name

       DIM
       TYPE    < translates to >       ;fancy screen output
       BRIGHT

       TTYL    12.(A4)                 ;type out internal meaning til null

NOSCS:  ADD     @A4,A4                  ;increment current user "base"
       BR      SCS                     ;look again

EXIT:   CMP     D0,#0                   ;any SCS modules?
       BNE     10$                     ;yes, we found some
       CRLF                            ;no, so tell em so
       TYPECR  <?No previous commands defined>
10$:    CRLF
       EXIT
END