Other Uses for the T/S 2068 Larken RAMDisk

Authors

Publication

Pub Details

Date

Pages

BASIC Terms

See all articles from Update April 1990

Background

The LARKEN RAMDISK banks are all mapped into the DOCK bank of the 2068 even though the board is plugged into the back expansion slot. Consequently, it is possible to load any of the RAMDISK banks with data for a database or spreadsheet. This means that up to 256K more information can be handled and increases the usefulness of the “old workhorse” dramatically.

It is also possible to load a DOCK bank with code which simulates a BASIC cartridge (AROS) and to run that code as a BASIC or m/c program. This is what cartridges do.

Larken Bank Switching

First of all, the 2068’s RAM is organized into 8 chunks of 8K each. Normally, with Display File 1 in use, the bottom two contain ROM and the next one the system variables and ROM routines which are moved to RAM on power-up. These 3 chunks should not be disturbed.

The LARKEN RAMDISK board uses the top 4 chunks (4 to 7) to make up a bank. A bank is made active by switching off the HOME RAM chunks 4 to 7 and turning on one of the RAMDISK banks. The active bank is actually treated as a DOCK bank. Thus the RAMDISK board holds up to 8 DOCK banks which can be selected from the keyboard.

How?

Which chunks are active in HOME and which active in DOCK is controlled by the Horizontal Select Register (HSR) located in PORT 244 (F4 hex). The individual bits which make up the byte in the port determine in which bank the corresponding chunk will be active. A zero bit means the chunk is in HOME. Since we want to use the top 4 chunks in DOCK, we will load the HSR with 11110000 binary (240 decimal). Thus <OUT 244,240> activates the DOCK bank.

Which Dock Bank?

LARKEN uses PORT 7 to select the one to be activated. The second page of the LARKEN RAMDISK notes gives the code numbers corresponding to the banks:

Bank A B C D E F G H
Code 7 3 5 1 6 2 4 0

Thus <OUT 7,7> will select bank A. Further, LARKEN uses bit 6 of PORT 7 to control the WRITE-PROTECT circuitry of the RAMDISK board. A zero in bit 6 puts the bank in the READ-only mode. To be able to load data into the bank, we must add 1000000 binary (64 decimal) to the bank code number. Therefore, <OUT 244,240: OUT 7,71> will permit us to put data into DOCK bank A.

What Can Be Put Into It?

Strictly code. I use two of the banks to hold records for a database program. It switches the banks in or out as needed to add records or to sort them.

The code, however, can be in the form of an AROS cartridge and therefore be used to hold a BASIC program.

How to Save the RAMDISK Bank

Any data read into the bank would destroy the existing data. To preserve the RAMDISK, enter the following: OUT 244,240: OUT 7,7 :RANDOMIZE USR 100: SAVE "RAMDSK.C1" CODE 32768,32768. The contents of bank A will now be safely on floppy and we can mess around with the bank as much as we want. The DOCK bank, however, is still active and needs to be turned off.

How to Get Back to Normal

The commands <OUT 244,0: OUT 7,0> will do the job. With a zero in the HSR via PORT 244, all bits are zeros and all chunks of RAM will be active in HOME. The zero to PORT 7 will turn return to bank H which has a code of zero. This is the normal condition for RAMDISK.

Bank H — A Special Case

When the computer is turned on or NEWed, it checks the DOCK to see if an AROS is present. If one is, it is automatically activated. A simulated AROS loaded into this bank will run if the <NEW> key is pressed. If the power supply is turned off, the code in the bank will be lost even if the battery backup is connected. If you want a permanent AROS in bank zero, install an EPROM containing the utility in the H bank socket. I have HOT-Z in the bank and a switch in the line running from pin 1 of the 74145 to pin 20 of the H RAM chip. Without the switch, HOT-Z would run every time the computer was booted.

How to Restore the RAMDISK Bank

<OUT 244,240: OUT 7,71: LOAD "RAMDSK.C1"CODE> will put the RAMDISK bank A back in the RAM chip. Don’t forget to <OUT 244,0>

Simulating an AROS Cartridge

An AROS cartridge must have 8 “overhead” bytes starting at 32768 (8000 hex) to give the computer the information it needs to run the BASIC program. See page 109 of the Tech Manual.

For our demo we will POKE into bank A the following bytes: 1,2,8,128,15,1,0,0.

The first 1 indicates that this is a BASIC “cartridge”.

The 2 signals AROS as opposed to LROS, a Language cartridge.

The 8 and 128 form the beginning address of the BASIC program (low byte first). In this case the BASIC will be at 8+256*128=32776 or 8008 hex.

The 15 (00001111 bin) means that chunks 4 to 7 will be active in the DOCK bank. This is exactly opposite to the format for the HSR.

The second 1 denotes an Autostart for the program.

The two zeros reserve no bytes for m/c variables.

The BASIC program will be loaded as code starting at 32776.

Creating an AROS

  1. Save RAMDISK bank A as described earlier and then key in OUT 244,0
  2. Key in1 10 CLS: PRINT “OK”: STOP 20 OUT 244,240: OUT 7,71 30 RESTORE: FOR X= 32768 TO 32775: READ Y: POKE X,Y: NEXT X 40 DATA 1,2,8,128,15,1,0,0 50 OUT 244,0
  3. SAVE as "test.B1"
  4. SAVE as "test.C1"CODE PEEK 23635+256*PEEK 23636,10002 The peeks simply find the address of the start of the BASIC program. It is moved up 50 bytes if the large printer is active. The 1000 is an arbitrary number large enough to be sure that all of the program is saved.
  5. Now <GOTO 20>. This will put the “overhead bytes” for the AROS in place.
  6. Key in OUT 244,240: LOAD "test.C1"CODE: OUT 244,0. This will put the BASIC program into the “cartridge”.
  7. Press <NEW> key. This activates the AROS and Line 10 of the program should run.
  8. If you saved a RAMDISK bank earlier, load it back in.

Running an AROS (BASIC in DOCK)

If DOCK bank n contains an AROS, then <OUT 7,bc: NEW> will RUN it (bc is the LARKEN code for bank n). It’s that simple.

Storing an AROS

If the code is to be left in a DOCK bank and maintained with the battery backup, it should not be in a bank that was formatted as a RAMDISK bank. If the bank is in Drive 4, then keep the AROS on floppy and load it in when you need it.

Running AROS From DOCK and BASIC in HOME

Programs can exist in both banks and either one can be RUN. Which one is active depends on the contents of the aros flag at 23750. A zero at this address will allow the HOME bank program to be run. A 128 there activates the DOCK program.

A program in DOCK cannot be listed nor can it be edited. So if you attempt to enter a line and can’t, you know that you are in DOCK and must return to HOME.

Steps to run both:

  1. Boot the DOCK program with <OUT 7,bc: NEW>. This MUST be done first to let the computer know that an AROS is present.
  2. Key in POKE 23750,0 to activate HOME bank.
  3. Load in the BASIC program.
  4. POKE 23750 with 0 or 128 depending on the bank wanted and then RUN or GOTO the appropriate line number.

Summing Up

The ability to use the RAMDISK banks for other purposes expands the usefulness of the 2068 dramatically. Data that could not be handled by the unexpanded machine can now be dealt with easily.

Huge BASIC programs can be broken down into segments, stored in DOCK banks, and called into action as needed by a short controlling program. This would leave most of HOME RAM free for the storage of data.

Expansion of the 2068 makes economic sense too, removing some of the pressure to move on to a bigger machine that can’t be tinkered with.

What we need now is a mess of programs that exploit this potential.

For starters, George Chambers has two of mine. One is a database and the other a HOME/DOCK program handler. Ask him for them.

Explore and enjoy!

Products

 

Media

 

Image Gallery

Source Code

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

Scroll to Top