ABASIC ' ! c' AB150DOC cABASICCMD% cCHAINFIXCMD  cCHAINFIXDOC  cCOPYCMD cDUMPCMD cREPAIRCMD  cREPAIRDOC cTEDTXT " cXDIRCMD   c The following changes have been made to A/BASIC V1.5:0 The CREATE verb now properly creates a random file of the specified size and then reopens it for update. format - CREATE #1,"FILE.NAM",X - where x=number of 252 byte records The 'seek' functions of RREAD and RWRITE work corectly with the new CREATE format. A RENAME verb has been added. format - REANME A$,B$ - rename file A$ to B$ The FILSIZ verb now returns the proper value. format - FILSIZ(#1) - returns the number of sectors in the file. Proper error reporting for the reading of files open for write. The direct page is now set in the compiler as well as the runtime. Removal of the perfs during the printing of the listing. Backspace is now handled correctly at runtime. The object file specified at compile time (if any) is automaticly deleted if on already exists. The working data area of the compiler has been relocated to $2C00 and the code has been moved to $0100 as per FLEX convention. This will also aid in the extending of the tables for those who need it.  Changed the file format used on disk by A/BASIC so it would be more compatible with TSCs basics. 1. No more leading zeros on numerics. 2. No space padding on strings. 3. Fields are seperated by commas. 4. Records are terminated with a CR. Runtime package now uses the FLEX vector 'PCRLF' to enable 'esc' pause feature during printing.  &.: ABASIC (c) 1982 Harry B. Fair O v_ Nߔ0<5/0?!01Eo!&_NO00n40Ro&2b0.DFHxI>L0P00Q:${00 002X ' % 2 %& "4'.F%+0F F2' PIXX/ H'40DD H&50܁*'n.'h% [% d$JH0f솞$? ':0:' H'(0?$!(&FFD H&D H  2b 4&50000'4005' 0! ^503r > 5$#Oc#dL O # L 0O** ERROR # n$= j$5 '\ $' &$'F5A̯-S 6D9O'E 얒' 'l 6-5D_ u|%9$&0 -G' '  45  69  &S C45$Ԟl6 *4( 4)5 0 '94߁A% ["595 0%9" 9Ձ ':'9,&09 &90 4r 401;5'  r5 47500 9#941a&Z&5 ' 5ŖL9$9V% 0(yL0"gZ&9 eZ&9PAGE A B A S I C C O M P I L E R V1.5:0   DDDD09# 2Ao%l d%l d2a4o5901A0&9&&9$ &90)0s +0)0 0ԟ)0 )0;)0t+@% &@9$0)'%'+,0'4`/ߡ&0 '+0 +'0 Ȅ9ENDFORNEXTREMGOTOIFINPUTPRINTRETURNORGBASELETSTACKSTOPCALLDIMPOKEOPTGENRREADRWRITEREADWRITEDISPLAYNAMEOPENCLOSERESTORESCRATCHKILLCHAINUSERUSERUSERCREATELSTRECRENAMEELSEONGOSUBBUF$EOFTHENTOSTEPOFFERROROVRNMINOVRTABFILESABSRNDPOSPEEKCLKERRSWAPEOFSTATUSLENVALASCSUBSTRFREEFILSIZSTR$RIGHT$LEFT$MID$CHR$TRM$`$5_-.R$#040-섍-0 &ؖ-9hi9@44P& P0F'4'00F0n& ' & X50n5@9J04'88xLx%L0LJ5Z&9x',0y8vx9 _O& 0fZ_ C 7N 1w  d+ & L * Q 3  "  %%:߁N'\H'XS'XI' ,' 90 0G$M&]&99Z?%9$' ? o 0,$ & 9턟@(&"u$ t,'?& t   $ u)'90&&@tL ?&tM' = tu'=$P%X$b9XI%94%&NN  2b9w2b'j >' 0w> 0sF%S0\0N\0Q0LQ0XGv0@0@AF'%/'0]0   M**&  $pPROGRAM END ERROR(s) DETECTED PROGRAM LENGTH VARIABLE LENGTH NO ERRORS DETECTED R&$'u@8$M'd 6kX )@f$G& $^A $S3 &  /O$%D ;&0& 1;&0v& q'45$(&0 9T$OZ O\#$ B$  r $ ?W ?S$&? 6};$- & o  d[w,&0 9Oh p  Y96% <$H'$96 IP$  #96L$  66$6Q%9  ??%q&z#&0% 9"0  f9 $Z$'BNR^@!$PM& VJ  @$<W%<O Rv$'Z$U$V$  90$4 ([$$5     $M&  $ 99  U  .$ -9k% 9 &%& 9oo09$&M&9-~ %9 Qn$pN &݆ O' #O  #p$#m?$ğB  , H%M%9G? 1' _0K?ZX $@&%2b&9_=& <& >&098)<1- $9 $J>%{% 9w='909b('90$#4P)5&0%9@6 04 ׍$* ލ$'9$&B0'$<_-.$. -Z&..0 &-90% #  %"99 I%9&9<$f$A'9<$?M$B& <ʀ$ ?:4005&9< ?'0=000:9 I)%9<:400Q5& 9076怦:?<&44 ?' <ʀ t O >55 _< c.6(y6_ xu$ i$"M]'PK._' \'9utt\t)&u,u&c $P,&0 Ֆu'̭ t/$&tI','(E&4K$5$D'\F&84?% '2a9O_-q5'́"&>0_$%M'\wp$\ W5c ' "&"'O0900\9!$ ' j-9 'O9%]\$$&=02&45K$/  '+&0 & @$'@ l ̆ % &9 4V&0"sn$'"$ʍ-h&$4p5h5=t_< &j- ' pn(9 & ږ &9L&JT_0 4'\0 M''' ' &R SXOf 45O^004_ 139 $ 3&9:1+&._ -'94O5`M'v c 0 13*& 'K /'94' /5 10;&& !& %'945 ܟ% @%9 10=$%6$$& $Q9O g$ _('F-&0$-@P #&!0$ -CS- 0R 1  X19 ޔ 0́)' 091#3' 314B540.0-04944005'0-.感4 943&4-4.5-5 5G 66$ D% $&9_ 9 3$$0O1L39$ u$O4& P2b9&&$4 5& M540F5,'2b90% 1_$OXI@Pɦ=by)1dz jx4H115n|&W; |O&-e &-JU&  AH`O1L39RK'*pb&0H$ &0 O44-55W_5J ObM&M  u4 4'`&0$ &a &J%WQ' {554&  & @ &  r5]'h O  .3 {#׍% ̈-6Ɩ3'@O139k'0$09 0/&9&&94Ɓ 4 4 4_ 45$ $& #oo$&4O&@5-9!& -0/9B8H#H#X40 B9ekKB<3,}V[`-&O_ Y *- z2b EC/S +1 0n-p n-o  A 4 n@@P_no ڍ ٍՍ Vb-4P&--5 0T w  > aWd ̤ ̪ ̨ |̣v4+5 %Ą ʊ Ȉ -)$4.5-B   - S O K G4-&.\' 5. .& - .& - .5- O 2- --& †-4FF5(, . & / ن' ՆXI 2~  Ԗ'F%j0g`]SRY'v& lIOOS')\0O"l-0KƀƓR'S&zZ00=dY'h0 0!MƐIJW'd00Ɓ0V'b00cU'1`0 0I Kl-u9 k?9TX'PjSTz^0L0ˍX'/f0{70{\]UZ[A opOp?9'F%C0F~9LOAD MAP: OUT INP DSK MUL DIV RND ST1 ST2  '0-%~3 '#0$-%O3 &0+&01',0 1 4Z&4050 5Z& ;90 0焽'&9? ' ^PZQV~ 0_&& &9 &90 'i ~$'0\\Z*94_{5 4" &$"L0o$"5ޟ"$9ܖ&&ͦ' &"9 ~&~$ &4+,5&94&a5" 4&m'0lo5ƀ'Z&94M+n5 -5@P0oo'%l '%l 荨d%l d %l l2b9"$9O_444A} '-&l q$2 '. '*m';0%7 "3XIXIXI%%%!%j ʦ'2b5m'@P2a9'2gn2e_O9%o9Z& &o 9 "' ,'90" 9 " '0" '0Z&9o9? >ƀ& '\0 &$ ϧ & 0o"&~$]'Z čx ! *'' 'm'&h"' 2dn9~2b'n?~ 1 4Z&4050 5Z& @ -%~3& "_t""1?' &o9 T g f q s" 0"4&3l#& t _5" '"0 ʆ&90:m& ~9'_ O9O9&'o45&Z&  #94 q5@ M* @P * @P  = =$  '=$  ' = O+& $@P9$SC#! & &+'22bn9M*@P & 'M!2bn*@P  + L +& $   &$@P9HXIXI6DV9'b9b9_m'0\ O9b]'i &c0Z ƀo"9''0Z&'9b'4M5'44#.L' b'M'"$"m',J'0 ]'"$  b]' '0Z 'o52bnƀ b  M'0Z&)''0')9O 'o  &M&9/']'*, +,+#_O9') -))-& 0Z&/O9 0 /+Z 4&'"5,"'o ))"4+&-"5&+&"-9DK~8$,B^O%#$ }MQoó/vA[FZ& ,CHAINFIX V1.0 (c) CATERPILLAR SOFTWARE CO. 00@R0oR&0R0iH% 0o NOҽ$0$PP' ZP&L_P#a~0qP0N焽&$0N 焽' 'M?~mM'A+M' oPllPhmPa& PYPRO"M'0$ 90 $0-P!O.90$P P3 r1-n0' ' OOO90ؽ$OʆO3 11--0' C' 9$00OE0Ƚ0OE0ݽ0O{E0'_Y&00NIOFZ&oOJ0 O7O*O.&$O&ONO*O ONlO & 4+5&箍N߯MNٯMNӯM09 4v0ja'20d$4AENNjN& N$  5 54 0K& Z' &. 5oNi*'oN\40ܽ0E5BlNK&+M/&944N(05M54DVDVDV5'HZ 940L '?~540L '?~5 Drive number to check ?  Drive numbe r out of range.............File end INCORECT ! ............Intersection at - Initializing bit maps.Building the file map.Building the free map.Checking for collisions.Checking for misses.Total number files intersected -  Total number of ؔintersections -  Total number of missed sectors -  Relink the free chain (Y/N)  Relinking the free chain.  Chain fix program complete.  CHAINFIX is a program to examine and report back on the state of the sector links on a disk, and at the user descretion relink the free space. The program performs five basic steps: 1. Building a bit map of all the sectors used bye files. 2. Building a second bit map of the free chain. 3. Comparing the maps for any 'collisions' of data. 4. Reporting the findings. 5. Optionaly rebuilding the free sector map.  ~Y@+,`#   r%[& @o @-%1r%C& o -%@m'Dm&~$1 ?  $~D@ }'Ģ$ | Zm&ަC'׾!$.' Ё9# o0Z&.' -% | '% 0Z* oC&{$&cm'e+m+ D}&,DA=='0=AM'&0A ˆĎ@ 1%qC &~~$00o_9.D. Ĵ o_~9& 0Z&9 D00Z&9$@&~ˍ ~ͽ~m &@ 4  5Lħ @&~$;m*~'~#;@m'l@'& 0 H~-'J0 ԶC' `k0&&I'0 }' @&' & 9''~ª~9 ߎ۽Y&Y&ێ &æ$~f!%9".' 4''5_]9 COPIED COPY COMPLETE TO DRIVE #NO SUCH FILE FILE EXISTS DELETE ORIGINAL?  ARE YOU SURE? STARTUPTXTh2`2D_9YZ[;~^~~9' ŕ΄ě9&Š SŘECTORS  SECTOR n@-%v&m;noZ&n@& Z& ߎ4n? Z&0 $.}%.Z&~$~?~4FFFF5@~  ' 0B%Y}Y&Z"^0'X&~U'R'!D'C'W'TN'50T ý'B%KB%M0߶LN &10Uy0RxS0<,0<~$0y0/O0U|OO&  &)O09/03UW'%A!0 Wz. ,.Z&9PU|V&|U<0\zP&0~'B%B%]'&0@ '?0  46' 5INVALID UNIT NUMBER REENTER:  REP:  [CRNT=  NEXT= WHAT ??  0 1 2 3 4 5 6 7 8 9 A B C D E F X:  REPAIR is a disk fix program for reading, repairing, and rewriting sectors on a disk. COMMANDS - U x specifies the unit (drive) number R tt ss read the sector specified by tt-track ss-sector W tt ss write the sector specified by tt-track ss-sector W defaults to the current sector D display the contents of the current sector N read the next sector (by chain) C bb v1 v2 ... change byte at bb to value v1, byte at bb+1 to v2 etc. X exit the program back to flex * TED 3/27/83 . modified for new compiler V-1.5:0 4/9/83 * ORG=$1000 BASE=$2E00 DIM F$(3,15),I$(255,129),D$(3),A$(2),E$(5),S$(130) DIM L$(130),R$(130) BASE=$0030 DIM A(1),B(1),E(1),F(1),N(1),S(1) D$="." C=1 L1=1 I=1 I$(1)="" B$=CHR$(8)+" "+CHR$(8) * POKE($CD16)=$11:POKE($CD17)=$0C : REM FLEX ESC return vector ON ERROR GOTO 3000 PRINT PRINT 3 PRINT "What is the name of the file to edit"; GOSUB 900:F$=L$:PRINT IF F$="" THEN 3 GOSUB 10:O$=F$:GOTO 50 * * Get a character without echo - return in $0030 5 GEN $AD,$9F,$D3,$E5 :REM JSR [$D3E5] GEN $B7,$00,$30 :REM STA $0030 A=PEEK($30):A$=CHR$(A) RETURN * * For FLEX's ESC return vector. * 7 GOTO 100 * * Process F$ - Add drive number and extension if necessary. * 10 A$=MID$(F$,2,1) IF A$<>D$ THEN W=PEEK($CC0C):IF W=$FF THEN W=0 IF A$<>D$ THEN 20 A$=MID$(F$,2,1) IF A$=D$ THEN W=VAL(LEFT$(F$,1)) F$=MID$(F$,3,LEN(F$)-2) 20 IF LEFT$(RIGHT$(F$,4),1)<>D$ THEN 30 F$(2)=LEFT$(F$,(LEN(F$))-4) E$=RIGHT$(F$,4) GOTO 40 30 E$=".TXT" F$(2)=F$ IF LEN(F$(2))>8 THEN 45 IF LEN(F$(2))<1 THEN 3 IF ASC(LEFT$(F$,1))<32 THEN 3 40 F$=RIGHT$(STR$(W),1)+D$+F$(2)+E$ *  * F$ equals new filename. * RETURN * 45 PRINT "Filename too long":GOTO 3000 * *  Read in the file if there * 50 ON ERROR GOTO 70 OPEN #1,F$ RESTORE #1 :REM If this is not done then ABASIC will write. FOR I=1 TO 255 READ #1,BUF$ I$(I)=BUF$ NEXT I PRINT "File is longer than 255 lines":GOTO 3000 60 F=1 :REM F=File flag  1=file exists L1=I :REM L1 is next line available. GOTO 120 :REM Display menu then goto Command Parser 70 CLOSE #1 IF ERR=21 THEN 80 IF I<=1 THEN 75 IF ERR=8 THEN 60 IF ERR<>4 THEN PRINT "ERROR #";ERR:GOTO 100 75 F=0 :REM File does not exist L1=1 I$(1)="" GOTO 120 80 PRINT "Syntax error in filename" GOTO 3000 * * Command Parser * 100 ON ERROR GOTO 111 IF L1=>255 THEN PRINT "Cannot add any more lines" IF L1<1 THEN I$(1)="":IF L1<1 THEN L1=1 PRINT "TED: "; GOSUB 5  B=A IF A=8 THEN A=C-1 : REM Left arrow, Backup 1 line IF B=8 THEN 113 IF A=9 THEN A=C+1 : REM Right arrow, Forward 1 line. IF B=9 THEN 113 IF A=$0D THEN 115 : REM Break, print line. IF A=$1B THEN A=$0B :REM Make ESC the same as ^ for Termi nals. IF A=$0B THEN C=1 : REM Cursor up, goto line 1 IF A=$0B THEN 115 IF A=$0A THEN C=L1-1 : REM Cursor down (LF) goto bottom. IF A=$0A THEN 115 A=A&$5F IF A=$4C THEN 200 : REM List lines IF A=$53 THEN 300 : REM Save to disk IF A=$41 T HEN 395 : REM Abort IF A=$46 THEN 400 : REM Find String IF A=$44 THEN 500 : REM Delete current line IF A=$45 THEN 600 : REM Edit Current line IF A=$49 THEN 700 : REM Insert after current line IF A=$4E THEN 800 : REM New, Erase all lines. IF A=$48 THEN 120 : REM List menu IF A=$47 THEN 112 : REM Goto a line number. IF A=$50 THEN 250 : REM Print number of lines. PRINT : PRINT "WHAT ?":GOTO 100 * 111 IF ERR=18 THEN 100 :REM Strange ABASIC error? PRINT "ERR ";ERR GOTO 100 * 112  PRINT "Goto line number"; INPUT A * 113 REM Print line A if valid. Make A the current line. IF A>L1-1 THEN 115 IF A<1 THEN 115 C=A 115 PRINT C;"=";I$(C):GOTO 100 * 120 REM Display menu PRINT "TED version 1.0" PRINT PRINT " L - List the file in memory." PRINT " S - Save the file to disk." PRINT " A - Abort edit and goto FLEX." PRINT " F - Find a string of characters." PRINT " D - Delete the current line." PRINT " E - Edit the current line." PRINT " I - Insert after the current line." PRINT " N - New, erase all lines in memory." PRINT " G - Goto a line number." PRINT " P - Print n lines. (Changes current line)" PRINT " ENTER - Display current line." PRINT "Up Arrow - Goto line 1. (Also ESC)" PRINT  "Dn Arrow - Goto last line." PRINT "Lf Arrow - Backup one line." PRINT "Rt Arrow - Forward one line." PRINT " H - Display this menu." 125 PRINT IF C<1 THEN C=1 PRINT "Current line #";C; PRINT ", Last line #"; IF L1<=1 THEN L1=1 PRINT  L1-1; PRINT ", Lines left =";255-(L1-1) IF F=1 THEN PRINT "Old"; IF F=0 THEN PRINT "New"; PRINT " Filename: ";F$ PRINT GOTO 100 * * List lines * 200 PRINT " List starting line#"; INPUT S PRINT " Ending line# to list"; INPUT E 203  IF S<1 THEN S=1 IF E>L1-1 THEN E=L1-1 FOR I=S TO E PRINT I;"=";I$(I) * CALL $CD24 : REM FLEX's PCRLF. NEXT I GOTO 125 * * Print a number of lines * 250 PRINT "Print how many lines"; GOSUB 900:PRINT IF L$="" THEN L$="10" S=VAL(L$) E=C +S-1 S=C IF E$59 THEN 10 0 PRINT "Are you sure? "; GOSUB 399 IF A<>$59 THEN 397 PRINT "I hope you were right." GOTO 3000 397 PRINT "I thought so.":goto 100 399 GOSUB 5 PRINT A$ A=A&$5F RETURN * * Find a String of characters * 400 PRINT " Find string "; GOS UB 900 PRINT IF L$="" THEN 405 S$=L$ 405 IF S$="" THEN 100 FOR I=C+1 TO L1-1 S=SUBSTR(S$,I$(I)) IF S>0 THEN 410 NEXT I S$="" PRINT "Not found":GOTO 100 410 C=I:PRINT C;"=";I$(C) PRINT C;"=";TAB(S+1+LEN(STR$(C))); FOR I=1 TO LEN(S$ ) PRINT "^"; NEXT I PRINT GOTO 100 * * Delete current line * 500 IF L1=1 THEN 100 PRINT " DELETING " PRINT C;"=";I$(C) FOR I=C TO L1-1 I$(I)=I$(I+1) NEXT I IF C=L1-1 THEN C=C-1 IF C=0 THEN I$(1)="" IF C=0 THEN C=1 L1=L1-1:GOTO 100 * * Edit current line * CTRL K Up arrow is the lead in for a find char (also ESC) * CR ends edit * LF truncates line at cursor * BS deletes char at left of cur. * TAB (9) Right arrow get to end of line for append * * At any given time L$=left  side of line, R$=right side. * 600 L$="":R$=I$(C) PRINT "Edit" PRINT C;"=";R$ PRINT C;"="; 610 GOSUB 5  IF A=$0B THEN 620 : REM ^K Lead in for search to char IF A=$1B THEN 620 : REM ESC the same as ^K IF A=$0D THEN 640 : REM CR exit  IF A=$0A THEN 650 : REM Truncate IF A=$08 THEN 630 : REM BS IF A=$09 THEN 616 : REM Append IF A<32 THEN 610 IF A>126 THEN 610 PRINT A$; L$=L$+A$ GOTO 610 * Print rest of line and wait. * This line is needed to remove mystery $0D fro m some lines? 616 IF RIGHT$(R$,1)=CHR$($0D) THEN R$=LEFT$(R$,LEN(R$)-1) I=LEN(R$) GOTO 625 : REM Cheat * Search and print line to char 620 GOSUB 5  IF A<32 THEN 610 IF A>127 THEN 610 * FOR I=1 TO LEN(R$) D$=MID$(R$,I,1) IF D$=A$ THEN 625  NEXT I GOTO 620 625 L$=L$+LEFT$(R$,I) PRINT LEFT$(R$,I); R$=RIGHT$(R$,LEN(R$)-I) GOTO 610 * BACKSPACE and delete char 630 IF LEN(L$)=0 THEN 610 PRINT B$; L$=LEFT$(L$,LEN(L$)-1) GOTO 610 * Print rest of line and exit. 640 IF R$="" TH EN 650 PRINT R$; L$=L$+R$ 650 I$(C)=LEFT$(L$,129) PRINT GOTO 100 * * Insert after current line * 700 PRINT "Insert" PRINT "TYPE '#' IN COLUMN 1 TO EXIT!" 710 IF L1=256 THEN 100 IF L1=1 THEN C=0 PRINT C+1;"="; 715 GOSUB 900 IF LEFT$( L$,1)="#" THEN 730 * C=Current L1=Next line available * Fake out Abasic because it can't do a STEP -1 720 PRINT N=L1-C-1 C=C+1 FOR I=1 TO N I$(C+N-I+1)=I$(C+N-I) NEXT I L1=L1+1 I$(C)=LEFT$(L$,129) GOTO 710 730 PRINT:IF L1=1 THEN C=1:GO  TO 100 * * New - Erase all in buffer * 800 PRINT "New" L1=1:C=1:I$(C)="":GOTO 125 * * INPUT L$. This will input a valid string into L$ * Honors ^X and prevents unwanted control chars * from being in the line as INPUT does. * 900 L$="" :REM St !art with empty string PRINT " ? "; 910 GOSUB 5 :REM Returns char as A$ and A IF A=$0D THEN 940 :REM IF A=$18 THEN 930 :REM ^X Cancel IF A<>8 THEN 920 :REM Backspace IF LEN(L$)=0 THEN 910 L$=LEFT$(L$,LEN(L$)-1) PRINT B$; :R"EM Print SP BS SP GOTO 910 920 IF A>127 THEN 910 :REM Check for printable char. IF A<32 THEN 910 L$=L$+A$ PRINT A$; GOTO 910 930 PRINT " ^X " GOTO 900 940 RETURN * 3000 END  $}'@&$ G.' !%9#}'~@ *# '@'%~r@&Tà&OĪBo_9ҽDO9 W$R$& !~y .'!%t9"'$ ڽù%d’l&@&Xà&SĊ_9Uĕ_9Dĝ_93ĥ_U9$~($~@?~ 'ˆ9,~Û@&|$à'~Ñ}D&~Ú0}D+UV% "# 0D}&)A=='0=AM'&0A 9dbDê.`OLčMQCECSC;U91/Y'%@WƀD@C~°'~y9 ~@~& 0Z&9 o0Z&.'~-| '% 0Z*99' 0Z&9_9& ~ "Û_~9+J'000  ƽ<0~<-~FILE# NAME TYPE BEGIN END SIZE DATE PRT FILES=SECTORS=LARGEST=FREE=DIRECTORY OF DRIVE NUMBER  CREATED: DI,SK:  #JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC                                                                   !!!!!!!!! ! """"""""" " ######### # $$$$$$$$$ $ %%%%%%%%% % &&&&&&&&& & ''''''''' '