Bank Switching… The Timex/Sinclair 2068 Computer, Part II

Publication

Pub Details

Date

Pages

BASIC Terms

See all articles from T-S Horizons n20

Welcome back! The first installment might have given you the idea that machine code was necessary for understanding bank switching. Would I do that to you? On occasion, machine code will be presented to support “fixes”, but if you don’t actually make the fixes you can skip it without any loss.

We previously discussed how to fix a statement like: CLOSE#3 when new devices had been added. “C” for a Centronix printer is a typical example. The OPEN statement pulls an error which can be trapped with ON ERR. Fixing this type of problem is quite simple. The error number and location are available in the system variables.

OPEN #3, “C” is sufficient syntax if patches have been made to the CHANS table, or a new channel has been inserted.

The complete syntax for OPEN goes beyond this. The statement for an EXBU floppy disc drive, bearing a BEU chip is:

OPEN#7,"D",[parameter list]

The parameter list includes such information as drive number, disk label, filename, extension, disk format standard, and file attributes. This syntax is common to all bus expansion units. Different devices require different parameters of course.

Does this give you the idea that you can read, say an IBM formatted disc? Yup, but it won’t be easy until the interface routines become available.

What an OPEN statement does is to verify the presence of the device, then post the offset to STRMS pointing to either CHANS or SYSCON as appropriate. In the process, a device dependent OPEN routine is generally required – just for CLOSE. The key here is “the presence of the device”. That is where bank switching begins.

When you turn your computer on, it goes through a lengthy initialization process to make it possible to do all those wondrous things. Just before the copyright message appears, the bank switching system is invoked to search out and identify what is connected; and to prepare a sorted list of them. That list is the system configuration table (SYSCON).

Ah! There is more to this than you thought! Cartridges which plug into the dock have reserved places at the bottom of SYSCON; one for AROS and one for LROS types. Does it make more sense now, that this article began with I/O? It was necessary to put in perspective what bank switching does, before showing how it works.

It is still to early to explore how it works, but in the interest of fairness, a short description is in order.

Gee! This is kind of embarrassing! Because Timex never came out with any kind of EXBU, their version of bank switching does not exist either! Writing about something that does not exist is called fiction. Bank switching using standard I/O is totally fictitious. It can be done, but preferably using a different method than shown in the literature.

A BSC reached through memory mapped I/O resides partly inside the SCLD. That part is real, powerful, and relatively simple. It is supported in hardware and ROM (with some patches needed).

The BSC has a separate data bus it shares with joysticks. This consists of four lines from the joystick port (which transfer “nibbles”) for multiplexed data, and one line from the rear connector, the function of which is better described later.

Bank switching control lines include DZOUT, DZIN, and BUSISO. The buffered address lines A13 through A15 tell what to do with the nibbles passed through the joystick port IOA. Anyone interested in learning more about peripheral control can find the IEEE 488 standard in their libraries or in the INTEL manual.

None of the control lines are connected in the TS2068. We’ll cross that bridge when we come to it. For now, we’ll assume all signals are available.

Most BEUs need an Identification Number (ID) which it recognizes. This can be its position in a daisy chain harness or any other scheme. No two devices can have the same ID. The value 0 is not allowed. The system polls from 1 to 255, pausing as DZIN is sensed. In this way it finds all attached devices, one at a time. It returns control to the CPU each time.

The CPU tests the bank for being RAM or ROM and creates an entry for it in the SYSCON table. All RAM is treated alike, but ROM is prepared for sorting. Before going on, the BEU is told to recognize its position in the SYSCON table instead of its ID.

The XFER_BYTES routine in chunk 3 lets the CPU get data from chunk 0 of the bank into the SYSCON table, using bank switching of course. Only one byte is needed to test if it is RAM. For ROM, the first 22 bytes are copied into SYSCON. If the device is not an EXBU, these bytes (and others perhaps) belong to the BEU chip. The data is used for initialization, but the device is never bank switched. This is the case with most printers and the better implementations of DOS systems. OPENing a printer loads its “kernel” from EBU chip to RAM.

Those first 22 bytes of ROM carry all the information needed to identify and operate the device. Some devices are not ROM, requiring additional testing to classify them, e.g., MODEM.

Once the table is complete, and all BEUs are recognizing the new assigned bank numbers (ABN), it is sorted according to the priority read in byte 22, lower numbers mean higher priority to be placed near the bottom of the SYSCON table. RAM is given a priority of 255 so it is always above any ROM entries. Devices which have handling routines in the HOME ROM are at the bottom. It as planned to accommodate thirteen different devices, but which has not been said. RAM banks are loaded with the interrupt handler from the EXROM.

The IDs are then reassigned to match the sorted SYSCON table. The last phase of initialization is the posting of non-EXBUs to CHANS and posting that fact back to SYSCON.

Then – the computer is ready to serve you.

Next we will look a lot more closely at that SCLD, examining its power and limitations, but not now. Yes, the system will be summarized, but not until the final article in this series. Complicated, isn’t it? Like life, it’s “verrrry interesting”.

Part II of this series originally contained an example of how easily one could be led astray by deliberately misleading data. Though it was intended to be a warning to the reader, it led to blind acceptance, or rejection of the whole presentation. Few recognized my intent. My warning still stands.

Reprint of:

Image Gallery

Source Code

Scroll to Top