home *** CD-ROM | disk | FTP | other *** search
- MAIN:
- color 0,7
- cls
- locate 1,35
- print " ASICMAKE "
- color 7,0
- locate 3,23
- print "A program to merge ASIC .ASI files."
- locate 4,28
- print "See Documentation file."
- locate 6,26
- color 2,0
- print "(c) Stephen Almond, May 1991."
- locate 7,22
- print "This program is in the PUBLIC DOMAIN."
- locate 9,16
- color 4,0
- print "ASIC is a copyrighted program by David A. Visti."
- print " "
- print " "
- color 1,0
- print "(C)reate a '.MAK' file"
- print "(A)ssemble an '.ASI' file"
- print "(E)nd"
- gosub WAITFORKEY:
- if char$="c" then MAKEMAK:
- if char$="C" then MAKEMAK:
- if char$="A" then MERGEMAK:
- if char$="a" then MERGEMAK:
- if char$="E" then DONE2:
- if char$="e" then DONE2:
-
- MERGEMAK:
- cls
- count=0
- print "Name of MAKE file ";
- input MAKENAME$
-
-
- GOTANAME:
- OUTPUTFILE$=MAKENAME$+".ASI"
- MAKENAME$=MAKENAME$+".MAK"
- color 2,0
- print "Do you want a printout of the file ? (y or n)"
- print " "
- print " "
- TRYAGAIN:
- gosub WAITFORKEY:
- if char$="n" then NO:
- if char$="y" then YES:
- goto TRYAGAIN:
- NO:
- printout=0
- goto MAKEFILE:
- YES:
- print " "
- print " "
- color 2,0
- print "Turn on your printer now, please."
- print "Press any key to continue."
- gosub WAITFORKEY:
- printout=1
-
- MAKEFILE:
- e$="open"
- file$=OUTPUTFILE$
- open "o",3,OUTPUTFILE$
- if ERROR > 0 then PROGRAMERROR:
- gosub OPENMAKEFILE:
- NEXT1:
- gosub READMAKEFILE:
- if e=1 then DATAS:
- gosub OPENINPUTFILE:
- low=1
- READ1:
- gosub READALINE:
- if e=1 then NEXT1:
- gosub LOOKFORDIMS:
- if find=0 then NEXT2:
- gosub PRINTLINE:
- goto READ1:
- NEXT2:
- e$="close"
- file$=char$
- close 2
- if ERROR > 0 then PROGRAMERROR:
- goto NEXT1:
-
- DATAS:
- gosub OPENMAKEFILE:
- NEXT3:
- gosub READMAKEFILE:
- if e=1 then DATASANDDIMS:
- gosub OPENINPUTFILE:
- low=1
- READ2:
- gosub READALINE:
- if e=1 then NEXT3:
- gosub LOOKFORDIMS:
- if find=1 then READ2:
- gosub LOOKFORDATAS:
- if find=0 then NEXT4:
- gosub PRINTLINE:
- goto READ2:
- NEXT4:
- e$="close"
- file$=char$
- close 2
- if ERROR > 0 then PROGRAMERROR:
- goto NEXT3:
-
- DATASANDDIMS:
- gosub OPENMAKEFILE:
- NEXT5:
- gosub READMAKEFILE:
- if e=1 then MADEMAKEFILE:
- gosub OPENINPUTFILE:
- low=1
- READ3:
- gosub READALINE:
- if e=1 then NEXT5:
- gosub LOOKFORDIMS:
- if find=1 then READ3:
- gosub LOOKFORDATAS:
- if find=1 then READ3:
- gosub PRINTLINE:
- goto READ3:
-
- MADEMAKEFILE:
- print " "
- print " "
- print "FILE ";
- print OUTPUTFILE$;
- print " has been created with ";
- print count;
- print " lines."
- sound 400,20
- sound 200,40
- goto DONE:
-
- OPENMAKEFILE:
- e$="open"
- file$=MAKENAME$
- open "i",1,MAKENAME$
- if ERROR > 0 then PROGRAMERROR:
- return
-
- READMAKEFILE:
- e=0
- e$="read"
- file$=MAKENAME$
- input#1,char$ NONULL
- if ERROR=99 then CLOSE1:
- if ERROR > 0 then PROGRAMERROR:
- return
- CLOSE1:
- e$="close"
- close 1
- e=1
- return
-
- OPENINPUTFILE:
- e$="open"
- file$=char$
- open "i",2,char$
- if ERROR > 0 then PROGRAMERROR:
- return
-
- READALINE:
- e=0
- SETLINE:
- line$=""
- e$="read"
- file$=char$
- if low=0 then HALFDONE:
- GETINT:
- input#2,twochars
- if ERROR=99 then CLOSE2:
- if ERROR > 0 then PROGRAMERROR:
- low=0
- acc1=varptr(twochars)
- c=peek(acc1)
- if c=13 then HALFDONE:
- if c=10 then GOTLINE:
- c$=chr$(c)
- line$=line$+c$
- HALFDONE:
- low=1
- acc1=varptr(twochars)
- acc1=acc1+1
- c=peek(acc1)
- if c=13 then GETINT:
- if c=10 then GOTLINE:
- c$=chr$(c)
- line$=line$+c$
- goto GETINT:
- GOTLINE:
- return
- CLOSE2:
- e$="close"
- close 2
- if ERROR > 0 then PROGRAMERROR:
- e=1
- return
-
- LOOKFORDIMS:
- u$="DIM "
- l$="dim "
- size=4
- goto LOOKFOR:
- LOOKFORDATAS:
- u$="DATA "
- l$="data "
- size=5
- LOOKFOR:
- find=0
- c$=mid$(line$,1,size)
- if u$=c$ then LOOKFORRETURN:
- if l$=c$ then LOOKFORRETURN:
- find=-1
- LOOKFORRETURN:
- find=find+1
- return
-
- PRINTLINE:
- count=count+1
- print line$
- if printout=0 then NOLINEPRINT:
- lprint line$
- NOLINEPRINT:
- c$=chr$(13)
- line$=line$+c$
- c$=chr$(10)
- line$=line$+c$
- e$="write"
- file$=OUTPUTFILE$
- print#3,line$ NONULL
- return
-
- WAITFORKEY:
- char$=inkey$
- if char$="" then WAITFORKEY:
- return
-
- MAKEMAK:
- cls
- print " "
- print " "
- print "Name of file to create ? (NO extender) ";
- input MAKENAME$
- MAKENAME$=MAKENAME$+".MAK"
- e$="open"
- file$=MAKENAME$
- open "o",1,MAKENAME$
- if ERROR > 0 then PROGRAMERROR:
- print " "
- print " "
- LOOP:
- print "Name of .ASI file ? (Do NOT add .ASI extender!) (/e to end.)";
- input char$
- if char$="/e" then DONE1:
- char$=char$+".ASI"
- e$="write"
- print #1,char$
- goto LOOP:
- DONE1:
- e$="close"
- close 1
- if ERROR > 0 then PROGRAMERROR:
- print MAKENAME$;
- print " has been created."
- print "Press any key to continue."
- gosub WAITFORKEY:
- char$=""
- MAKENAME$=""
- goto MAIN:
-
- PROGRAMERROR:
- sound 1000,20
- color 4,0
- print " "
- print " "
- print "While trying to ";
- print e$;
- print " ";
- print file$;
- print " an ERROR number ";
- print ERROR;
- print " has occured."
- print "See 'SYSTEM ERROR CODE VALUES' in the ASIC manual to interpret."
- sound 2000,20
- DONE:
- color 2,0
- print " "
- print " "
- print "Press any key to end."
- gosub WAITFORKEY:
- cls
- close 1
- close 2
- close 3
- goto MAIN:
-
- DONE2:
- cls
- end
-
-