&TRACE
CP SET EMSG TEXT
&TYPE WELCOME TO TRIPOS SYSGEN
&TYPE
* QUERY OR BAD ARGUMENTS?
&IF .&1 = ? &GOTO -QUERY
&IF &INDEX >= 1 &IF &INDEX <= 2 &GOTO -AOK
&TYPE BAD ARGS!
&EXIT 8
*
-AOK
&SYSFILE = &1
&SYSOPTS = F&2
*
*
CPEX Q 199
&IF &RETCODE = 0 &GOTO -TDOK
EX TDISK E
&ERROR &EXIT &RETCODE
-TDOK
DESBUF
AC 199 E
COPY &FILENAME &FILETYPE &FILEMODE = = E(REPLACE
AC 199 A
AC 191 B/A
*
*        NOW CREATE FILES IF NECESSARY
*
&CALL -CRAT BLIBSEG BCPL8086
&CALL -CRAT CLI$INIT BCPL8086
&CALL -CRAT COHAND BCPL8086
&CALL -CRAT FHWORK BCPL8086
&CALL -CRAT XBLIB BCPL8086
*
&CALL -CRAT CLI BCPL
&CALL -CRAT FHROOT BCPL8086
&CALL -CRAT FHGENRAL BCPL
&CALL -CRAT FHMAIN BCPL
&CALL -CRAT FHAUX1 BCPL
&CALL -CRAT FHAUX2 BCPL
&CALL -CRAT FHAUX3 BCPL
&CALL -CRAT FHACCESS BCPL8086
&CALL -CRAT FHCHARIO BCPL
&CALL -CRAT FHRESTAR BCPL
&CALL -CRAT FHINITEN BCPL
&CALL -CRAT FHSTART BCPL8086
*
&CALL -CRAT KLIBSEG ASS86
&CALL -CRAT MLIBSEG ASS86
&CALL -CRAT RDRIV ASS86
&CALL -CRAT PDRIVSEG ASS86
&CALL -CRAT DKDRIVSE ASS86
&CALL -CRAT CKDCBSEG ASS86
&CALL -CRAT CPDCBSEG ASS86
&CALL -CRAT DKDCBSEG ASS86
*
*
* NOW RUN SYSLINK TO PRODUCE THE HUNK FILES
*
FI SYSPRINT T(CHANGE RECFM F LRECL 80 LOWCASE
FI SYSIN R(RECFM F LRECL 80 CHANGE
FI SYSTERM T(RECFM F LRECL 80 LOWCASE CHANGE
SYSLINK &SYSFILE &BLANK SYSLINK  MAP= SYSLINK OPT= &SYSOPTS &BLANK SYSCODE
CP SET EMSG ON
&EXIT &RETCODE
*
*  SUBROUTINE CRAT,  IF FILE &1 HUNK DOES NOT EXIST THEN
*                    IT IS CREATED. IF &2 IS BCPL8086 OR
*                    BCPL THEN THE COMPILER IS CALLED
*                    OTHERWISE THE ASSEMBLER.
*
-CRAT
&CALL -TFILE &1 HUNK A
&IF &RETCODE = 28 &GOTO -CREAT
&IF &RETCODE NE 0 &GOTO -CRBAD
&TYPE &1 HUNK EXISTS
&RETURN
-CRBAD &EXIT &RETCODE
-CREAT
* TEST FILETYPE
&TYPE CREATING &1 HUNK
&IF &2 = ASS86 &GOTO -DOASS
&IF &2 = BCPL COPY &1 BCPL F = BCPL8086 A(REPLACE UNPACK
&IF &2 = BCPL8086 COPY &1 BCPL8086 B = = A(REPLACE UNPACK
&ERROR &EXIT &RETCODE
EX BCPL86 &1
&ERROR
&RETURN
*
-DOASS
COPY &1 ASS86 B = = A(REPLACE UNPACK
&ERROR &EXIT &RETCODE
EX GOASS &1
&RETURN
*
* SUBROUTINE TFILE TESTS WHETHER THE FILE &1 &2 &3 EXISTS
*
-TFILE
&ERROR
LISTFILE &1 &2 &3
&RETURN
*
-QUERY
&BEGTYPE
YOU SHOULD SUPPLY THE FN OF THE SYSLINK FILE AND ALSO OPTIONS
IF REQUIRED.
&END
&EXIT