Although expansion systems add valuable memory to your Spectrum they can cause difficulty with commercial programs. Stuart Harris reveals how to run VuCalc with the XK System.
Business-Like Expansion
Although expansion systems add valuable memory to your Spectrum they can cause difficulty with commercial programs. Stuart Harris reveals how to run Vu-Calc with the XK System
Business programs with a modifiable Basic do not present too many problems in being converted to work with the extra memory made available by expansion systems, such as the Cambridge XK System (issue 91).
Vu-Calc is one such program that not only converts to running with the extra memory, but allows data transfer between the spreadsheet pages without losing any features of the original.
To modify the Basic of Vu-Calc to work with XK Expansion System enter MERGE "VU-CALC" and then list the program.
- Remove LOAD "" SCREEN$ from line 10.
-
Change line 1000 to read:
1000 GOSUB VAL "1100":LOAD a$ CODE: CLS:OUT 253,127:GO SUB VAL "1100":LOAD a$ CODE:CLS:OUT 253,126:GO TO VAL "3000" -
Change line 3000 to read:
3000 GOSUB 1200:PRINT AT 9,2;"ENTER 1 : EXIT PROGRAM"''TAB9;"2 : CLEAR PAGE 1 "''TAB9,"3 : CLEAR PAGE 2"''TAB 9;"4 : TURN TO PAGE 1"''TAB9;"5 : TURN TO PAGE 2":INPUT "OPTION?";a -
Change line 3010 to read:
IF a>0 AND a<6 THEN GO TO (3000+a*100) - Change line 3200 to 3350
- Enter 3200 OUT 253,126:GO TO VAL "3350"
- Enter 3300 OUT 253,127
- Enter 3400 OUT 253,126:GO TO USR VAL "25671"
- Enter 3500 OUT 253,127:GO TO USR VAL "25671"
Then enter SAVE "FILENAME", save to tape and verify the program.
Load the code from the original program entitled "c" and save it using SAVE "e" CODE 25232,5270 then verify it.
Finally, load the new version of Vu-Calc with LOAD"FILENAME":RUN. After it has loaded, you will go straight to the spreadsheet like the original, except this is page 1 at OUT 253,126.
There is no need to keep the SCREEN$, as the time it takes to load this is best spent inputting the extra data into Page B. The same also applies to the two line basic program "vu-calc" before the main program.
Because of the way the XK Expansion System gives you an extra 32K RAM at the top end of the memory - from address 32768 up and the data loads into the spreadsheet from address 30457 - the top five rows of the spreadsheet and cells 1 to 27 inclusive on row F are common to both pages.
This area can be used for headings, allowing more room for figures in the lower 54 ros. More important, it can be used for transferring data between pages using the formula available in Vu-Calc to move the figures around in conjunction with the #c (calculate) command e.g. to move the contents of AA1 on Page 1 to BA1 on page 2.
Move AA1 to F1 in the common area using the formula AA1 in box F1 then ENTER#c. Quit Page 1 using #Q to call up the menu. Select option 5 to turn to Page 2 and with the formula BA1 in cell F1 enter #C and the contents of F1 will appear in BA1.
Cell F28 should be avoided when transferring data as part is in the common area and part is not. Note that any formula saved and reloaded on page 1 will be lost when page 2 is loaded.
Saving data is the same as in the original version.
These changes give a spreadsheet on each of the two internal pages provided by the XK System. More could be added - you are limited only by two things: the amount of memory left for the Basic part of Vu-Calc and the number of sets of 32K RAM available to you.
If you wish to use the XK System with this expanded Vu-Calc and a Microdrive then the Basic has to be radically altered (see Microdrive listing). Unfortunately, you lose the menu and the error trapping facility.
The loading of data into each page is done by going to that particular page using #Q ENTER then entering 1 or 2 and loading from there.
Note that it you have any formula in the common area these should be loaded with the second page of data, otherwise they will be deleted.
If you should be returned to Basic you can get back into Vu-Calc using GOTO 3000, and entering the page number required.
If you do not have the XK System yet, but still wish to use this listing to convert Vu-Calc to work with Microdrive then delete lines 3000-3200 inclusive, and on being returned to Basic use GOTO USR 25671.
To save the Microdrive listing use SAVE * "m";1;"run" LINE 10. To save the machine code use SAVE*"m";1;"e" CODE 25232,5270 after loading it from cassette. The program will load and run by entering run.
If you wish to save any data already on cassette to Microdrive use SAVE*"m";1;"FILENAME" CODE 30457,29469