PRO/FILE 2068 + OS-64
THESE NOTES ARE INTENDED AS A SUPPLEMENT TO THE PROFILE MANUAL.
I have rewritten PRO/FILE 2068 to operate with the ZEBRA OS-64 module to provide a 64 column by 15 line data-file and display. Portions of the BASIC program were changed and the machine code had to be moved (and changed) to accomodate the changes in the operating system. I
There are only about 500 bytes left unused in ram.
FILE SIZE:
I have used 22760 bytes for d$ (maximum file size) because this rewrite was also intended for use with the АҺ) Microdrive (which makes a smaller file size practical) and, at this size, I can get 4 complete files on a 62 foot wafer.
I like to SAVE a standard size file so that changes will not cause a new SAVE to over-write part of the following file on a wafer. `
ADDITIONS:
I have added the following routines from the PRO/FILE manual {pps 97-107); . The keypress "tick"
keypress non-auto-repeat
lprint from edit (copy display)
autosearch improvement
auto-sort (by 32 chars)
block purge.
I have also added a routine to allow 2 files to be merged.
CHANGES:
The main menu has been completely rearranged and several new functions added.
The data-entry/edit menu has been rearranged and all of the functions now appear on a single menu. Upper/lower case ana insert/over conditions now appear on the menu. The line and column positions of the cursor are also displayed an the menu along with the LPRINT format.
"STOP" to exit the data-entry mode and "STEP" to exit the edit mode are displayed as a reminder. The program is supposed to differentiate between them so BUT BE CAREFUL. I have experiencec random problems using STOP from edit.
Different key-click sounds are provided for data-entry and cantral functions.
-[ 1i l-
LINE CHANGES AND ADDITIONS:
Many of the new line numbers and routines will not match the original program but they are still obvious enough that you can sort them out. These are the major changes.
Lines 20 - 118: main menu £ select Lines 1050 — 2000: data review menu Lines 5004 - 5018: data enter/edit menu Lines 5500 - 5510: data "LOAD" Lines 5600 - 5630: data "SAVE" Lines 5650 - 5680: "MERGE" two files Lines 7200 - 7240: "LPRINT" Line 9800: "CHANGE FILENAME" Line 9994: CLEAR 62627 and LOAD mc. Line 9995: DIM (22760) and certain standard values are put into š variables to save ram space. Line 9996: Housekeeping variables are initialized including the blank lines and "zzz"s that are necessary for sorting and printing operations. GOSUB 5620 is to insert the "SEARCH IS COMPLETES" message in the first 20 bytes of d$ (this is also used by LOAD. Line 9997: РОКЕ 24201,0 (A&J drive O) | POKE 65510,0 (turn off line feed, 05—64) POKE 65523,185 (select A&J interface, OS-64) POKE 65525,72 (LPRINT # of chars per line, plus # of chars in margin, OS-64 RANDOMIZE USR 15623 (initialize # of chars, OS-64) Line 9998: initialize у% % f$, start (GO TO 1) Line 9999: SAVE & VERIFY for backup
You may need to make some changes in Line 9997 to match your OS-64 (they’r not all the same), your interface, and your printer.
MACHINE CODE:
The PRO FILE MC now starts at 62628 (down 861 bytes) because the operating system is moved around for the 64 column mode and portions of it now occupy the top of ram.
You will need HOT-Z, or some other assembler /disassembler that will allow you to relocate blocks of code. Otherwise you will have to go thru the МС and. change all of the GOTOs & JPs by hand.
It was only necessary to change 3 bytes to accomodate the 64 column mode. Addresses are the NEW locations.
F502 = 40 (40 hex = 64 spaces) F463 = 40 (set count to 64) F4c4 = 41 (# of columns + 1)
=p 273»
"SAVE" and "LOAD":
Both SAVE and LOAD will automatically put the computer in CAPS mode (POKE 23658,8).
All data SAVE/LOAD operations are set up for А%Ч drive O because I always keep programs in drive 1 and files in drive O.
The dimensioned data file (d$), as the first variable declared, is always located at (PEEK 23627+256tPEEK 23628). The first 6 bytes are header information, therefore the actual data starts at byte 7. Line 5630 creates variable "loc" which is the beginning of the data. loc=6+ (PEEK 23627+256*%PEEK 23628).
"SAVE"; Line 5600; will use the "FILENAME” (f$) that appears оп the main menu. The routine will also ask for a file number.
The message "SEARCH IS COMPLETE" will be removed from d$ and the value of variable "p" (total bytes used) will be inserted in the, now unused, 20 bytes of the header. |
The program will automatically VERIFY.
"LOAD"; Line 5500; will ask "HAS CURRENT FILE BEEN SAVED?” (as a safety check to prevent losing a file). "М" will return you to the main menu, "Y" will ask for the filename to be loaded. Variable "p" is extracted from the new d$ and the message "SEARCH IS COMPLETE?t" is replaced in the first 20 bytes.
"LPRINT":
Тһе OS-64 operating system does not support the 2040 printer. However, it does provide а centronics driver for a large printer (interface selectable). Therefore, the driver code used in the manual is not necessary.
The total number of characters per line are set in Line 9997. However, since some printers do not have a "left margin” control - Line 7220 contains the necessary number of blank spaces to create a left margin. This means that line 9997 (POKE 65525,72) is the number of characters to be printed PLUS the number of characters for the margin.
If you want a blank space between each individual file printout, then change line 7225 to “NEXT x: LPRINT".
EXAMPLE; I have indexed the club newsletter library. The first line is always the newsletter name and date with content notes on the other lines. І get rid of the LPRINT when I want a list of just the newsletter names & dates. I use the LPRINT when I want a printout of the entire file, with a space between each file.
-L 3 J-
COMBINING FILES (MERGE):
PRO/FILE allows deleting blocks of files so that large files may be split. I have added a routine that allows two files to be combined. As written, it requires 2 microdrives.
EDIT THE TWO FILES TO THE SIZE AND DATA THAT YOU WANT. Remembered that the total number of bytes in the two files MUST BE LESS than the maximum file size (22760 bytes minus 20, or 11375 bytes each).
Place the wafer containing the regular files in drive 0, place a formatted wafer (20-35 ft) in drive 1.
When you select "MERGE", the program will prompt for the first filename. It will then LOAD that file (from drive 0), place the actual file size in variable "pi" (pi=p-20), place the filename іп "h$", and then SAVE tand VERIFY) the file tat its actual file size minus the 20 byte header) to drive i. See line 5660, SAVE "ai,"+ f$ CODE tlac+20),pi.
The program will then prompt for the next filename (to be LOADed from drive O). This will LOAD normally.
The first file will then automatically be reLOADed (using the name іп "h$), AND using the new value in variable "р" to determine where the file should go in d$ so that it is immediately behind the resident file. Line 5680, LOAD “a"+h$ CODE (loc*p*1)
The value in variable "pi" is then added to the value in variable "p" to give the size of the combined file.
It is a simple matter to rewrite tbe program if you only have one microdrive. You will need to put pauses (and reminder messages) in to allow time to swap wafers.
WARNING: It has been my experience that no two microdrives run at the same speed. Therefore, if you have saved several files using the slower drive and then over-write one of those files using the faster drive, it will also over-write the beginning of the following file.
-E 4 l-
- 0001. "КЕМ %Ж FRO/64 xt MODIFIED OCT, 1987 BY FRANK HOLLAND
0005 LET a=to: LET x$z""
0004 RANDOMIZE p: POKE VAL "63174", PEEK VAL "23670": FOKE VAL "63175", FEEK VAL "23671": RANDOMIZE USR VAL "63407"
0005 LET y=to: DIM еФ(%15, t64): CLS
OQS If PEEK VAL "62750" = to AND y$ <> "D" AND y$ <> " STEP " THEN GO SUB VAL "7300"
0010 IF у% = "D" OR y$ = " STEP " THEN GO TO t119
0020 CLS: PRINT AT ti, t15; "XXXXXX* PRO/FILE 2068 + OS-64 XXxxxxx"
0040 PRINT AT t3, t3; "FILE : "3 #% "FREE : "3 LEN d$ - p; "bytes"? TAB t3; "ORDER : "; g "FORMAT: "; as
ОО50 PRINT АТ VAL "7", +10; "XX» LIST ALL FILES"? TAB t10; "<E>nter NEW FILE"? TAB %10; "<Stave FILES (drive O)"* TAB t10; "<L>cad FILES (drive О)" TAB tiO; "<M>erge FILES"? TAB +10; "<A>utosearch (& lprint)"' TAB t10; "<Feormat LPRINT"? TAB t10; "«C?hange FILENAME (7 chars.)"" TAB tiO; "<P>urge ALL FILES"
0051 РКІМТ AT VAL "18", t2: "SEARCH COMMAND\# (line 1-9) to sort files."* ТАВ t2; "SEARCH COMMAND\D to delete series of files." TAB t2; "Separate multi-word command words with token ""AND"","
0055 PLOT to, to: DRAW +255, +0: DRAW tO, VAL "175": DRAW -t255, to: DRAW tO, VAL "-175"
0100 РОКЕ VAL "23658", t8: INPUT "SEARCH COMMAND? "; x$
0101 IF x$ = "E" THEN GO TO VAL "5000"
2 IF x$ = "S" THEN GO SUB VAL "5600": GO TO ti 5 IF x$ = "L" THEN GO SUB VAL "5500"; GO TO ti 4 IF x$ = "A" THEN GO TO VAL "5200" 5 IF x$ = "F" THEN GO SUB VAL "6500": GO TO t20 ad зе IF w$ = "C" THEN GO TO VAL "9800" 37 IF x$ = "P" THEN GO TO VAL "9650" 28 IF x$ = "M" THEN GO SUB VAL "S650": GO TO ti 15 IF x$ = "" THEN GO TO ti 16 IF x$(LEN x$) = " AND " OR LEN x$ > t64 THEN GO TO %10 18 CLS 19 LET x$ = x$: LET x$ = x$ 20 RAMDOMIZE USR VAL "63179" 30 LET j$ = CHR$ PEEK VAL "23670" 40 IF a = tO THEN IF CODE j$ > VAL "48" AND CODE j$ < VAL "S8" THEN LET s = VAL j$: LET a = ti: LET y = tO: LET y$ = " STEP ": GO SUB VAL "7300": LET p$ = b$: LET q$ = 5% 50 LET b = USR VAL "63240"
-£ 6 J=
0206
1000
1049
1050
1055
1056
1060
1070
1075
‘IF jẹ = "D"
THEN LET a =ti: LET s =to: LET y$ = "D": LET y = to
FRINT AT %0,%0;: DIM e$(ti5, t64): LET e$(t1) = "": IF USR VAL "62714" THEN
IF e$(ti, TO t18) = d$(t2 TO t19) AND b <> p THEN CLS: GO TO VAL "150"
IF a THEN GO TO VAL "7000"
IF a THEN GO SUB VAL "7300": GO SUB VAL "7310": GO SUE VAL "7300"
IF e$(ti, TO t18) <> d$(t2 TO t19) AND CODE j$ > t32
THEN GO TO VAL "8500" + CODE j%
GO SUB VAL "9830": '
PRINT AT %17,%0; "<М>аіп menu"; TAB t25; "iE»dit file"; TAB t45; "Forint file"? "ENTER? to continue"; TAB t25; "<A>dd new file"; TAB t45; "<F>ormat "°? "<Roestart same search"; TAB t25; "<р>е1еіе file"; TAB t45; " "3 a$
PRINT AT t20, ti; "Search is for:": TAB VAL "36"; "or enter new SEARCH COMMAND"? x$ FOKE VAL "23658", t8
INPUT "OPTION? "; y$
IF y$ = nu AND b < p THEN CLS: GO TO VAL "i150" IF y$ = "M"
THEN GO TO ti
IF USR VAL "63407" THEN (this line is supposed to be this way, it is not an
= Z ae
error)
1080
1090
1100
1200
1400
5003
5004
5005
IF FEEK VAL "63165" + t256 % PEEK VAL "63166" <> PEEK VAL "23627" + t256 * PEEK VAL "23628" + VAL AND (y$ = "D" OR y$ = "E") THEN GO TO VAL "4000"
IF y$ = "Б" THEN CLS: LET x$ = x$ GO TO t119 + (a X VAL "5121")
IF y$ = "P" THEN GO TO VAL "7205"
IF y$ = "F" THEN GO SUB VAL "9830": GO SUB VAL "6500": LET y$ = "": GO TO VAL "1050"
IF a$ = "A" THEN LET x$ = "і": GO TO VAL "5000"
LET x$ = y$: GO TO VAL "115"
GO TO VAL "1050"
LET p = p - USR VAL "62779": IF y$ = "р" THEN LET y$ = CHR$ (CODE "D" X a): GO TO VAL "4"
GO TO VAL "5002"
CLS:
DIM e$(ti15, +64)
LET m = tO:
LET z = VAL "25658": LET i = tO:
LET c = to
GO SUB VAL "9830"
PRINT AT %17,%0; "ARROWS move cursor",b$” "SHIFT О Delete character", “SHIFT 1 Alternate Insert/Over"
PRINT AT ti9,tO; "SHIFT 2 = CAPS LOCK", "SHIFT 3 = LINE DELETE"? "SHIFT 4 = LINE ERASE", "SHIFT SYMBOL SHIFT: Line insert"? "“STOF> to close file": IF ys = "E" OR y$ = "A"
nen
THEN PRINT AT VAL "21", TO; "<5ТЕР> to return from
-t 8 1-
ADD/EDIT"
5007
5008
5өбо
5010
5015
SC16
5050
5050
'FRINT AT ti6, t5; "UPPER CASE":
IF PEEK z = tO THEN FRINT AT tió, t5; "lower case"
PRINT AT +16, 50; "INSERT OFF": IF i = ti THEN PRINT АТ tió, VAL 50; “INSERT ON "
PRINT INVERSE ti; АТ 1, с; SCREENS (1,c)3 INVERSE tO;
AT t17, t32; "L= "s TAB 353 1 + 1; TAB 40; "C= "
TAB 45; c+ti ON ERR GO TO 5008
IF INKEY$ = "" THEN GO TO 5010
LET y = INKEYS
IF y$ = " STEP " OR y$ = " STOP " THEN ON ERR RESET: CLS: GO TO 6000 J F y$ = na
THEN GO TO 5010 BEEP .001, 50
PRINT AT 1, с; SCREENS (1, c): IF CODE y$ « t16 AND CODE y$ > t3 THEN GO SUB 5100 + CODE y$: BEEP .005, 25: GO TO 5006
IF i THEN LET еФ (1+1) = e$(l+1 TO c) + " " + esil+ti, FRINT AT 1, tO; e$(l+ti)
PRINT AT 1,c; y$: LET e$(l+ti, c+ti) = y
~ #
LET c = (c*t1) X (c«6 LET 1 = 1 + (c=to): LET 1 = 1 Ж (1«t15) GO TO 5008
-E 9 J-
c+ti TO 63):
5104
5106
5107
5108
5109
5110
5111
5115
5114
5117
5130
5200
FOR x = 1 TO 13: LET e$(x+t1) с e$(x+t2): PRINT AT x, tO; e$six+ti): NEXT x: LET e$(t15) = PRINT e$(ti5S): RETURN
LET e$f(l+ti),c+ti TO) = ""; PRINT AT 1,%0; e$(l+ti): RETURN
РОКЕ г, (PEEK z-tO) X tB: FRINT AT 1,035 e$i(l+ti,c+ti): RETURN
LET i = NOT i: FAUSE t5: RETURN
LET c = c-(c^t0O0): RETURN
LET c = c*(c& VAL "65"): RETURN
LET 1 = 1+(VAL "149: RETURN
LET 1 = 1-(1>+0): RETURN
LET e$(l+ti) = е%(1441, TO c) + e$(l+ti, c+t2 TO t63) +
PRINT AT 1, tO; e$(1+t1): GO TO VAL "5108"
LET с = tO:
LET 1 = 1 + tis
LET 1 = 1 - (1>VAL 814%): RETURN
FOR x = ti5 TO 1 + t2 STEP -ti: LET e$(x) = е%(х-%1): PRINT AT x - ti, tO; eS (x):
NEXT x:
LET e$(l+ti) = "":
PRINT AT 1, tO: e$(l+ti): RETURN
GO TO VAL "5004" RETURN
GO SUB VAL "7300": LET a = ti:
INPUT "PRINT OUT Y/N) "3 y$: LET y = y$ = "ү"
=L 10 1-
5220
5510
5111
5600
5610
5620
5630
INPUT "SEARCH COMMAND? "3 x$:
IF x$ = "" OR LEN x$ > VAL "63" THEN BEEF VAL ".S", %10: GO TO VAL "5210"
LET 2% = О": INPUT "LINE NUMBER (0-15) "3 z$: IF 2% = w"
THEN BEEF VAL ".5", %10: GO TO VAL "5220"
ON ERR GO TO VAL "S220"; IF VAL z$ « tO OR VAL z$ > t15 THEN GO TO VAL "5220"
ON ERR RESET: LET s = VAL z$:
CLS IF s <> tO THEN LET p$ = b$: LET q$ = g$ GO TO t119 CLS:
POKE VAL "23658", t8: INPUT "HAS CURRENT FILE BEEN SAVED? (Y/N) "; y$: IF y$ <> "Y"
THEN GO TO ti
INPUT "FILE NAME? "3 f$: GO SUB VAL "S630":
LOAD "a" + f$ CODE loc: LET p = VAL d$ (ti TO t20)
GO TO VAL "S6ZO"
РОКЕ VAL "23658", t8:
CLS:
INFUT "SAVE AT FILE #7 "; n$: GO SUB VAL "S630":
LET a$(ti TO t20) = STR p
SAVE "a" + n$ + "," + f$ CODE loc, VAL "21760": VERIFY "a" + f$ CODE
LET d$ (ti TO t20) = "X#SEARCH IS COMPLETEX": RETURN
LET loc = (PEEK VAL "23627" + t256 Ж PEEK VAL "23628") + VAL RETURN
=. 11 j-
"с.і
5650 CLS: PRINT "MERGE: file #1": GG SUB VAL "5510": LET pi p - 120: LET h$ f$
"on
5660 POKE VAL "24201", ti: SAVE "Di," + f$ CODE (loc + %20), рі: VERIFY "a" + 4% CODE: FOKE VAL "24201", to
2670 FRINT "MERGE: file #2": GO SUB VAL "5510"
5680 РОКЕ VAL "24201", ti: LOAD "3" + h$ CODE (loc + p + t1): FOKE VAL "24201", +0: LET p =p + pi: RETURN
6000 LET d$(p) = CHR$ (42 - а X 42):
6010 FOR x = ti TO +15 LET e$(x) = es (x) IF USR 62628 THEN NEXT x
6020 LET p = USR 62669 6030 60 TO VAL "4" - (y$ = " STOF ") + (a X (y$ = " STEP "))
6500 FRINT AT +18, t2; "ENTER DESIRED FORMAT:"; b$? TAB t2; "Туре ALL or line numbers (1-9) separated by ""/"n""* TAB t2; "Use ""O"" to print blank lines"; b$
6510 LET c$ ="": LET n = to: INFUT "FORMAT? "3 a$: LET a$ = a$ + "/': IF a$ (ti) = "/" THEN GO TO VAL "6510"
6515 IF a$ = "ALL/" THEN FOR x = ti TO t15 LET c$ = CHR$ x:
RETURN
6520 LET d ti: FOR x ti TO LEN a$ IF a$(x) < "7s" OR a$(x) > "9" THEN GO TO VAL "6510"
= 12” J=
7200
7202
IF x < LEN at THEN IF а(х TO x+t1) = "//" THEN GO TO VAL "6510
IF a(x) = "/" THEN LET n = VAL a$(d TO x-t1): LET d = x + tls IF n < ti6 THEN LET c$ = c + CHR$ n IF n > tiS THEN GO TO VAL "6510" NEXT x RETURN IF 5 = to
THEN GO TO VAL "7202"
IF b = р THEN GO TO VAL "7070"
LET s$ = e$(s, TO tz2)
IF s$ = p$ THEN GO TO VAL "7200"
IF s$ > p$ i THEN IF s$ < q$ THEN LET q$ = 5%
GO TO VAL "7230"
IF p$ = g$ THEN GO TO VAL "1047" LET p$ = q$: LET q$ = g$: CLS
LET x$ = x$: GO TO t119
FOKE PEEK VAL "63165" + t256 * PEEK VAL "63166", tO
IF y= to THEN GO TO VAL "1047"
=L 13 3-
7205 FOR x = ti TO LEN c$
7210 IF CODE с%(х) = to THEN LPRINT 7220 IF CODE c$(x) AND e$(x) > b$ + b$ THEN LFRINT " " + "es (CODECS (х) )
7225 NEXT x
7230 IF а AND b < p
AND y$ <> "C"
THEN CLS:
GO ТО VAL "150"
7240 GO TO VAL "1047"
7300 LET v = PEEK VAL "62750":
FOKE VAL "62750", VAL "215" - v: FOKE VAL "62736", VAL "215" - y; RETURN I
7510 PRINT AT tO, %0;: LET e$(ti) = ""; IF USR VAL "62714" THEN (this line is supposed to be this way, it is not an error) 7311 RETURN 8548 GO TO ti
8557 LET p = p - USR VAL "62779": GO TO VAL "6000"
8567 GO TO ti
8568 GO TO VAL "1060"
9650 INPUT "ARE YOU SURE? (Y/N) "; x$ IF x$ = "y" OR x$ = "Y"
THEN GO TO VAL "9995" 9660 GO TO ti
?800 INPUT "NEW FILENAME? "; f$: GO TO ti
3830 PLOT tO, VAL "54"; DRAW t255, tO: PLOT tO, VAL "52": DRAW t255, to: FRINT АТ tió, VAL "22"; "xx OPTION MENU XX": RETURN
-L 14 J-
9996
9997
9998
9999
‘CLEAR VAL "62627": LOAD "@pro/64" CODE VAL "62628" CLEAR: DIM d$(VAL "22760")1 LET tO = VAL "о" LET ti = VAL "i": LET t2'= VAL "2": LET t3 = VAL "3": LET t5 = VAL "5": LET t8 = VAL "8": LET +10 = VAL "10": LET «15 = VAL "iS": LET t16 = VAL "16": LET t17 = VAL "17": LET t19 = VAL "19": LET t20 = VAL "20": LET t25 = VAL "25": LET t32 = VAL "52": LET t45 = VAL "45": LET t64 = VAL "64": LET t119 = VAL "119": LET t255 = VAL "255": LET t256 = VAL "256" LET p = +20: GO SUB VAL "5620": LET a$ = "ALL": LET c$ = "n"; ' FOR x =ti ТО +15: LET c$ = c$ + CHR$ x: NEXT x: LET в -tO: LET b$ = " LET g$ = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" FOKE VAL "24201", to: РОКЕ VAL "65510", to: FOKE VAL "65523", VAL "185": FOKE VAL "65525", VAL "72": RANDOMIZE USR VAL "15623": INK tO: CLS LET y$ = "C": LET f$ = "FILENAME": GO TO ti CLEAR: SAVE "Ji,FRO/G4" LINE VAL "9994":
SAVE "@2,pro/64" CODE VAL "62628, VAL "795":
VERIFY "@PRO/64": VERIFY "apro/64" CODE
-L 15 2-