    DIM BASECPU$[4],TARGETCPU$[4],REVISION$[1],DISK$[20]
    DIM ASMDOFILENAME$[40], IODRDOFILENAME$[40], ASMEXT$[20]
    DIM ASMFILENAME$[40],ASMOBJNAME$[40],ASMIODRNAME$[40]
    DIM CREATELOG$/7,:E,0,0/,JUNK$/0,0,0,0/
    PRINT ""
    PRINT "Build .DO files for assembling ASM15 and its I/O package."
    PRINT ""
    INPUT "Enter device that the source files reside on: "DISK$
    IF DISK$[LEN(DISK$),1] <> ":" THEN LET DISK$ = DISK$ CAT ":"
    PRINT ""
    INPUT "Revision letter: "REVISION$
    PRINT ""
    PRINT 'The only acceptable CPU inputs are "6800", "6805" and "6809".'
    PRINT ""
RETRY1:
    INPUT "Enter CPU this assembler executes on: "BASECPU$
    IF BASECPU$ <> "6800" AND BASECPU$ <> "6809" THEN
        PRINT "Unacceptable base CPU type."
        GOTO RETRY1
    FI
    PRINT ""
RETRY2:
    INPUT "Enter target CPU for assembler output: "TARGETCPU$
    IF TARGETCPU$ <> "6800" AND TARGETCPU$ <> "6805" AND ...
&       TARGETCPU$ <> "6809" THEN
           PRINT "Unacceptable target CPU type."
           GOTO RETRY2
    FI
    PRINT ""
    ASMEXT$ = ".ASM"
    IF BASECPU$ = "6800" THEN ASMEXT$ = ".68C"
    ASMFILENAME$ = DISK$ CAT "ASM15" CAT REVISION$ CAT ".." ...
&               CAT TARGETCPU$ CAT "." ...
&               CAT BASECPU$[1,2] CAT BASECPU$[4,1]
    ASMIODRNAME$ = DISK$ CAT "ASM15IODR" CAT BASECPU$[1,2] CAT ...
&               BASECPU$[4,1] CAT ".BIN"
    ASMOBJNAME$ = DISK$ CAT "ASM15" CAT REVISION$ CAT TARGETCPU$ CAT ...
&               "." CAT BASECPU$[4,1] CAT ".BIN"
    ASMDOFILENAME$ = "ASMASM15" CAT REVISION$ CAT TARGETCPU$ CAT ".DO"
    IODRDOFILENAME$ = "ASMASM15IODR.DO"

    CREATE #1,IODRDOFILENAME$
    PRINT #1,"*  DO file to assemble I/O package for assemblers running"
    PRINT #1,"*     on a MC";BASECPU$;"."
    PRINT #1,"ASM";BASECPU$[3,2]
    PRINT #1,DISK$;"ASM15IODR";ASMEXT$
    PRINT #1,""
    PRINT #1,ASMIODRNAME$
    PRINT #1,""
    CLOSE #1

    CREATE #1,ASMDOFILENAME$
    PRINT #1,"*  DO file to assemble ASM15";REVISION$;
    PRINT #1," for the MC";TARGETCPU$;
    PRINT #1," running on an MC";BASECPU$;"."
    PRINT #1,"ASM";BASECPU$[3,2]
    PRINT #1,DISK$;"ASM15";".CTRL";ASMEXT$
    PRINT #1,""
    PRINT #1,ASMOBJNAME$
    PRINT #1,"ASSEMBLER   EQU   ";
    IF TARGETCPU$ = "6800" THEN PRINT #1,"0"
    IF TARGETCPU$ = "6805" THEN PRINT #1,"1"
    IF TARGETCPU$ = "6809" THEN PRINT #1,"2"
    PRINT #1,"ASSEMBLY    EQU   '";REVISION$
    PRINT #1,""
    CLOSE #1

    PRINT "The command files generated are: ";
    PRINT ASMDOFILENAME$;" and ";IODRDOFILENAME$
    EXIT
    END
