BASIC TOPICS: Program Segmentation with the Aerco FD68 (EDITOR’S NOTE: While Mr. Lanius uses the Aerco FD-68 Disk System and MIKRO drives as examples in this article, the principles presented here in apply to any high speed mass storage device. Consider this, with the extra memory available on the Aerco FD-68 board (up to 256K on a modified unit), could a RAMDISK system also be feasible?-ed.) We Timexers have grown accustomed to working within the memory limitations of our little machines. This has probably been out of a lack of knowledge and/or lack of mass storage devices that were fast enough to allow us to segment our programs. Segmenting a program simply means that only part of the program is actually in memory at any given time. This is how systems like CPM (RPM) can have programs that do much more than we Timexers would normally think possible in 64K. With Aerco’s ZDOS operating system, there is no reason we cannot do this with our current systems. Consider programs like ARTWORX or TECHDRAW. Both are very good programs, each with it’s own set of features. Both of these is also limited due to the memory limitations of our computers. With segmentation, one could have numerous features incorporating the best of both. For example, Artworx has a UDG generator built in. You could have the program load in just that portion of program, then do the UDGs. When done, leave the UDG information in a safe location in memory, or save it to disk, then load back in the main program. While this would indeed slow down the program, you would gain the ability to have more options in a program. By limiting the segmentation to the less often used portions of a program, while keeping the main functions in memory, you would rarely see the speed difference. This idea extends to other mass storage devices such as MIKRO DRIVES. For example, Tiny Board was originally a BBS written in the confines of the 64K memory on the Timex. The message base was limited to 20 messages. There are now Mikro Drive versions that make use of this segmentation idea and have message space limited only by the disk space available. Added features, like on-line adventures that would have otherwise been immpossible to do in 64K, are now feasible. The following is a simple example of this segmentation idea. Listing #1 is the main program. Type it in then save it to disk. Type in each of the other listings and save them also. When finished, load listing #1 and RUN. What you now have is a VERY simple Etch-a-Sketch program. The main menu is loaded and from there you can go to the sketch program, the copy screen program, or the routine to change the border color. All of the above would have fit into the memory with no trouble, but that is not the point. This shows how the work in progress can be saved to disk then recalled by another program. While this may not be a very useful programming example, I hope that I may have planted a seed in the minds of those who dabble in programming with the Aerco FD-68 system. If anyone comes up with applications for this type of programming please let the rest of us know.
Listing #1 – MENU
10 CLS : PRINT " MENU"
20 PRINT ''"1) Etch a Sketch"''"2) COPY"''"3) Border color"
30 IF INKEY$="" THEN GO TO 30
40 IF INKEY$="1" THEN CAT "Sketch.bas",
50 IF INKEY$="2" THEN CAT "copy.bas",
60 IF INKEY$="3" THEN CAT "Border.bas",
70 GO TO 10
9999 MOVE "MENU.BAS",10
Listing #2 – SKETCH
10 REM sketch
12 CLS :
15 PRINT #1;"s=save q=quit l=load"
17 PRINT #0;"Move with 5,6,7,8"
20 LET l=0
30 LET c=0
35 PLOT c,l
40 IF INKEY$="" THEN GO TO 40
50 IF INKEY$="5" AND c>0 THEN LET c=c-1
60 IF INKEY$="8" AND c<255 THEN LET c=c+1
70 IF INKEY$="6" AND l>0 THEN LET l=l-1
80 IF INKEY$="7" AND l<175 THEN LET l=l+1
90 IF INKEY$="s" THEN MOVE "screen.scr",: CAT "menu.bas",
100 IF INKEY$="l" THEN CAT "screen.scr",: GO TO 15
110 IF INKEY$="q" THEN CAT "menu.bas",
900 GO TO 35
9999 MOVE "sketch.bas",10
Listing #3 – BORDER
10 CLS : PRINT AT 0,0;"Press 8 or 9 to quit"
20 INPUT "Border Color";a
30 IF a=8 OR a=9 THEN CAT "menu.bas",
40 BORDER a
50 GO TO 10
9999 MOVE "border.bas",10
Listing #4 – COPY
10 CLS : PRINT "Press a key when ready to copy"
20 IF INKEY$="" THEN GO TO 20
30 CAT "screen.scr",: COPY
40 CAT "menu.bas",
9999 MOVE "copy.bas",10
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.