TCOMP3.DOC This is a modified version of TCOMP.121 to allow it to work with the DVI unit. This version reads the source file from the disk and compiles it into lightning fast machine code. See TCOMP.121 and .DOC for additional info. Modifications: o Drive 0: is assumed unless '1:' precedes the filename. o Under normal conditions, the user will enter just the filename for the BASIC file. Extensions are allowed here (ie. TEST.TCM is allowable). The BASIC file must NOT be saved as an ASCII file. The compiler uses the tokens, just as in 'TCOMP.121'. o The object file will be stored on disk upon end of compilation, if an object filename was entered. Again - see DOCs for TCOMP. *** NOTE *** Extensions are NOT allowed here. For example: If the souce file is TEST.TCM and 'TEST' is entered for the object file, then the compiler will save the object file as 'TEST.OBJ'. o The object file SAVEM attributes have been changed to reflect the actual size of the object file. TCOMP.121 would savem the file using the lower limit and upper limits given by the user. This version uses the lower limit and the actual last memory byte generated by TCOMP.DVI (plus about ten bytes). o TCOMP is less susceptable to fatal errors. TCOMP.121 will die with the infamous '?OM Error ...' if the lower limit is set too low, whereas TCOMP.DVI will state:"SYSTEM OM ERROR: Try a lower start address" and ask again. Also, if any errors occur in the compiler, it will respond with: 'SYSTEM ERROR # xx OCCURED IN LINE # xxxx' These error codes may be looked up in either the DVI manual or in the Model 100 Basic Reference Manual. Hopefully the compiler won't die. Final Notes: TCOMP.DVI's main use and advantage, is that the only file that needs to be in RAM: is the compiler itelf. This allows for the compilation of larger programs, as well as further expansion to TCOMP.XXX. One must remember, however, to leave room for the object file. TCOMP.DVI is compatible with the TDD using POWR-D with NO modifications. Compatibility test: The following program was used as an exerciser - to ensure all functions of TCOMP (almost all) were utilized. This program and 'QCHESS.TCM' were used to ensure TCOMP.121 and TCOMP.DVI operated identically. They should, since TCOMP.DVI is TCOMP.121, except it reads from disk vice RAM:. Appologies: I appologize to for scrunching his first two lines in TCOMP. This was necessary to install the patch (for disk input) and to allow quicker program execution. Additional note: For those of you who want to analyse the program, all the modifications are spaced, whereas the rest of TCOMP is de-spaced: (FOR A1=1 TO N STEP P vice FORA=1TONSTEPP) I blame my parents for this, since they taught me neatness when I was young, and I can't stand despaced programs, except for RUN only applications. +---------------+ | Robert Toft | | [74716,476] | +---------------+ File:TEST.TCM 10 REM 20 REM Test program for TCOMP 30 REM 32 DIM A(10) 35 CLS 40 PRINT@121," Grafics test" 50 FOR I=0 TO 239 60 PSET(I,0) 70 PSET(I,63) 80 NEXT I 90 REM 100 FOR I=1 TO 62 110 PSET(0,I) 120 PSET(239,I) 130 NEXT I 132 LINE (10,10)-(200,53),1 140 GOSUB 9000 150 CLS 160 PRINT "ON e GOTO test" 170 FOR I=1 TO 5 180 ON I GOTO 190,200,210,220,230 190 PRINT "One": GOTO 240 200 PRINT "Two": GOTO 240 210 PRINT "Three": GOTO 240 220 PRINT "Four": GOTO 240 230 PRINT "Five" 240 NEXT I 250 GOSUB 9000 260 CLS 270 PRINT "ON e GOSUB test" 280 FOR I=5 TO 1 STEP -1 290 ON I GOSUB 310,320,330,340,350 300 NEXT I: GOTO 360 310 PRINT "Ein": RETURN 320 PRINT "Zwei": RETURN 330 PRINT "Drei": RETURN 340 PRINT "Vier": RETURN 350 PRINT "F3nf": RETURN 360 GOSUB 9000 370 CLS 380 PRINT "IF e THEN n test" 390 A=2 400 IF A=2 THEN 420 410 PRINT "IF e THEN n test FAILED": BEEP 420 PRINT "IF e THEN more stmnts test" 430 IF A=2 THEN PRINT "tenatively passed": GOTO 450 440 PRINT "FAILED": BEEP 450 PRINT "Nested FOR NEXT loop test" 460 FOR I=1 TO 4 470 FOR J=1 TO 3 480 PRINT I;",";J 490 NEXT J,I 495 GOSUB 9000 500 CLS 510 PRINT "Function test" 520 A=PEEK(1)*2+3^3/9-(1-2) 530 B=(1<>2) AND 0 OR 1 540 C=SGN(B) 550 D=ABS(-5) 560 E=INP(3) 570 PRINT "The following rows should match:" 580 PRINT A;B;C;D;E 590 PRINT 106;1;1;5;3 600 GOSUB 9000 610 CLS 620 PRINT "READ/DATA/RESTORE test" 630 READ A,B,C,D 650 PRINT "The following two rows should match:" 660 PRINT A;B;C;D 670 RESTORE 9999 680 READ E,F,G,H 690 PRINT E;F;G;H 700 GOSUB 9000 710 CLS 720 PRINT "SOUND test" 730 FOR I=600 TO 2000 STEP 200 740 SOUND I,50 750 NEXT I 760 GOSUB 9000 770 CLS 780 PRINT "Array test" 790 FOR I=1 TO 10 800 A(I)=I*I 810 NEXT I 820 FOR I=0 TO 10 830 PRINT A(I); 840 NEXT I 850 GOSUB 9000 999 END 9000 REM time out routine 9010 FOR I9=1 TO 5000: NEXT I9: RETURN 9999 DATA 1,2,3,4