Previous column ComputerAnswers    Next column ComputerAnswers

Logo

ComputerAnswers Column 24


COMPUTER ANSWERS DECEMBER 1986



Copyright 1986-2011 Simon N Goodwin

THE 64K QUESTIONS

The Amstrad 8256 with 256K of RAM uses the Z80 processor, which cannot address more than 64K of RAM. What good is the other 192K? Is it just a con to make people think they are getting 256K of useable RAM? If not, how is the 256K useful? Is the Amstrad 8512 with 512K of RAM an even bigger con? Can Mallard Basic handle more than 64K of programs and data? If so, how is it done? Discuss, please.
D.A.H Brown, Malvern, Worcs.

This question must get the Computer Answers 'Spanish Inquisition' award for 1986! The Amstrad computers have more memory than the processor can address directly, but this doesn't make them a 'con'. They use a technique called 'bank switching' to allow them to access large amounts of memory in sections, or 'banks'. The same trick is used by many other Z80 machines like the Spectrum 128, Memotech, Einstein and Enterprise.

The principle is fairly simple. Besides 64K of memory, the Z80 can also read and write information from several 'ports'. Normally these ports are used to connect external devices - keyboards, sound chips, and other peripherals. But one or more of these ports can be used as a control, to select between several banks of memory.

This is how it works. Imagine that someone has 16 railway timetables, but only has room on his or her desk to open four at a time. The person could still use all 16 volumes, but would have to swap them around to make them fit on the desk.

A computer can work similarly. Imagine that 256K of memory is sub-divided into 16 banks, each of 16K bytes. The Z80 processor can only access information in 64K of memory at any time, so it can only use four of the 16 banks. However it is fairly simple to arrange electronics to swap 16K banks around, so that the processor can select any bank by writing an appropriate value to the control port. It only takes a few bytes of code and millionths of a second for a processor to switch between banks of memory.

In these examples I've talked about 16K banks, but other sizes are quite possible. There's almost no theoretical limit on the number of banks that can be accessed this way, but most machines restrict themselves to 256 or fewer, as you'd need several ports to select between more than 256 banks. The Amstrad 8512 just has twice as many banks as the 8256.

Newer processors such as the Motorola 68000 can access 16 megabytes directly; this is part of the reason why they are faster than old designs. In fact the 68000 design allows 32 bit addresses, giving a maximum address space of 4,000-odd megabytes, but the 32-bit 68020 chip is still very expensive and most people settle for the 24 bit, 16 megabyte 68000.

The Intel chips used in many business computers use a hybrid scheme. Intel processors can access more than 64K but programs work with several 64K areas, called 'segments'. Special instructions are needed to switch between segments. In effect, the 8088 and 8086 have built-in bank-switching hardware.

A large address space brings problems as well as advantages. You need large variables and pointers to keep track of code and data. 32 bit addresses can make Motorola 68000 machine code very verbose by comparison with Z80 code.

Most Basic interpreters use 16 bit pointers, so they can only handle 64K of code and data. To avoid constant switching back and forth, the interpreter program is usually squashed into the same space. Further space is needed for file buffers and information about the state of the system.

The Memotech and the Sinclair QL are the only small computers I know of that let you carry on writing Basic programs up to the limit of your system's memory. Even Microsoft Basic-A on the IBM PC restricts you to about 36K on a 640K computer! Acorn have a version of their BBC Basic which keeps the interpreter and program in separate pages, but it uses 16 bit addressing so you're still confined to 64K for your program and data.

Amstrad's Locomotive Basic leaves just 31.5K free for programs and data when the interpreter, system variables and file buffers are set up. The rest of the memory is used to hold the display and CP/M system code, with 112K left over on an 8256 for 'drive M' - a very fast memory-based simulation of a disk. The 8512 uses the same scheme, but gives you 368K of space on drive M.

You can access drive M from Locomotive Basic very quickly, because there are no mechanical delays involved in reading from a bank of memory. You are allowed direct access to data, so you can wind quickly back and forth through files and treat them almost like arrays. As a side effect, this discipline will make it easy to adapt your code to use real disk files, albeit slowly, if you fill up drive M.

Locomotive Basic also lets you load Basic programs in 'overlays' - sections can be swapped with others on disk or drive M - so you can use more than 31K of program code in an application as long as you divide it up sensibly.

Many 'modern' computers use processors and software which are only designed to handle 64K, and it is worth bearing this in mind when comparing machines. However there are lots of bodges which make extra memory useful, even if it is tacked onto components designed for a 64K system.

2011 update: Maximum 68000 address space corrected from 8 to 16 Mb and 32 bit version part number tweaked from 68032 to 68020... Simon



MONITORS AND UPGRADES

In the near future I hope to purchase a new Atari 1040STF. However before I do so I would like to know how to interface my Microvitec Cub 653 medium resolution colour monitor to the Atari. Currently this monitor is giving very good results with my BBC Model B system.

Secondly, would I have any problems using my Taxan KP810 printer with the Atari?
John David Mason, Runcorn, Cheshire.

There's a myth about 'standard' video monitors. There's lots of scope for variation between the output of one computer and another, even if the same vague description is used in each case. I've often written about the difference between composite and separate syncs, RGB linear and RGB TTL, and sundry variations, so I'll leave out the background information this time - suffice it to say that Microvitec make 165 different varieties of monitor! The Atari ST produces linear RGB outputs at up to one volt into 150 ohms, with separate synchronisation signals. The BBC machine squirts out RGB at TTL levels - on or off, zero or four volts - with composite synchronisation pulses, and prefers a load impedance of about 1500 ohms. So there's a big difference between 'RGB' on one machine and 'RGB' on the other, and you won't be able to connect the Atari without making quite a few changes to your monitor.

It is not company policy for Microvitec to convert one type of monitor into another, but they can sometimes be persuaded to do one-off conversion jobs. Prices vary, but it could cost as much as £130 - plus VAT - to upgrade a monitor to use 'dual standards', so that you can plug in either computer at will. You might be able to find a good TV or video engineer who could do this for you more cheaply, but it won't be easy whatever you do.

I asked Microvitec what they would advise people to do if they wanted a 'compromise' monitor that would give reasonable results on most systems. They suggested the 1451AP - a monitor that works from a single composite video signal. This won't give quite such good results as a purpose-made RGB monitor, where the computer can control each tube of the display separately, but it should work much better than a TV display. Most micros can produce a composite video output, but some only generate a monochrome composite signal.

The good news is that your KP810 printer should work fine with the ST, as long as you use an appropriate lead.



QL TAPE INTERFACE

Can the QL, through its network ports or otherwise, be connected to a domestic cassette recorder to allow programs to be recorded? The supply of microdrive cartridges is erratic here and I have heard that they are prone to data loss.
Aljaz Haider, Karachi, Pakistan.

It's certainly possible to connect a cassette recorder to the QL's network ports, but your recorder will have to produce a fairly high output level because the electronics expects a 5 volt signal from Spectrums or QLs on the net.

The problem would be getting appropriate software. The network data rate is about 100 times higher than a normal cassette interface; it is far outside the bandwidth of a cassette recorder so you wouldn't be able to record normal network traffic. The QL user group did consider writing software to access cassettes at a lower data-rate, but I think they gave up this idea.

Even if you wrote such software it would load and save a lot more slowly than the microdrives; at the common cassette speed of 1200 baud it would take about 6 minutes to load QL Quill, whereas microdrives take 30 seconds. Cassette file-handling is pretty rudimentary, even compared with microdrives, because you can't re-read sections or wind from one file to the next unless the user intervenes to read the tape counter and press appropriate buttons.

Despite all the moans about microdrives, I've used them extensively and found them as reliable as disks, although much slower. They're certainly much more reliable than cassettes.

The best way to escape QL microdrive shortages is to add a disk interface. There are half a dozen models available, costing about £70-80. These work with almost all drives and software packages. Quill loads from disk in about 5 seconds.



SOAP STORY

We are looking for a simple program to print small decorative labels for our own brand shampoo bottles etc. We use a BBC computer and Epson FX80 printer. Can you suggest a suitable supplier?
J.G Woods, Ashton-under-Lyne, Lancashire.

I don't know of any commercial package that would do just what you want, but that's not surprising since it is rather an esoteric application. You have two options - you can either try to bend a general-purpose graphics program to your will, or have one tailor-made.

Any program that allows you to design graphics on the screen and then print them out should suit your purposes - you'll have to experiment with the placement of the graphics on the screen so that they fit over the sheets of labels you use in the printer. The FX-80 printer is a popular and versatile model, so you should have no trouble finding a package that can drive it.

One snag of this approach is that you may have to load a design program every time you want to print some labels. Printing will be slow because the software will be set up to copy an entire display, not just a few areas matching the position of the labels.

You might prefer to track down a programmer to do the job. Professional micro programmers are rare and expensive, but you should be able to find someone with the appropriate skills at your local computer club. It's a small job - perhaps a weekend's work for someone competent - and you should be able to get a purpose-made program for a price similar to that of a commercial graphics package.

Choosing your programmer is obviously tricky; insist on someone with the same computer and printer as yourselves, and then rely on your own judgement of character. I'd be tempted to choose someone who could show me the results of previous graphical experiments. You can find your local club by contacting the ACC, who have their own column in every issue of PCW; I'd be grateful if budding label designers would NOT write to Computer Answers offering their services!

UPGRADING THE 6128 KEYBOARD

I am the owner of an Amstrad 6128 which I am very impressed with. Perhaps my only complaint is about the membrane keyboard. Is it possible to fit a remote keyboard on the lines of the Amstrad PCW 8256's, but preferably of higher quality?
R. Sidsaff, Stamford, Lincs.

I've not seen anyone advertising remote keyboards for the 6128, and I doubt if they'd be viable commercially. Maybe a manufacturer will write in and prove me wrong.

A do-it-yourself modification is possible. A computer keyboard is just a job lot of keys arranged in a grid, with wires from the computer connected along two sides of the grid at right angles. Remote keyboards use special-purpose chips to combine all the signals into a serial data-stream, so that you can connect the computer and the keyboard with a telephone lead rather than a rope of wires. The combined signal is also less likely to carry interference into the computer - keyboard wires often come straight out of the board on an all-in-one computer and you could run into reliability problems if you extended these across a room without buffering them in some way.

It is easy enough to get unwired keyboards - switches on a grid - from electronics suppliers and DIY computer firms. Alternatively you could buy a cheap or second-hand computer and try to wire the keyboard into your Amstrad. If you replace the keyboard yourself the layout and labelling won't match that on your Amstrad, even if your chosen replacement has the correct number of keys. One person I know bought an Atmos when Oric went bust and wired the keyboard into his QL, but only dedicated hackers do that sort of thing.

The keyboard of the 6128 uses a similar mechanical layout to that of the 8256, so I don't think there would be much point replacing one with the other, even if you could track down a 'spare' 8256 keyboard and a de-coding circuit for the computer end of the link. I have noticed that the feel of Amstrad keyboards tends to vary from one machine to the next, even if the models are ostensibly the same.



ATARI MAGAZINES

I have just received an Atari 800XL computer. I have looked out for magazines for this computer and even tried Commodore and Spectrum programs but they have not worked. Is there a Atari 800XL magazine?
K.D Wittin, South Yardley, Birmingham.

The Atari 800 is best known as a games machine rather than a programmer's computer - the Basic is slow and rather non-standard, as you have found out. Database publish a magazine called Atari User, which you should be able to find in large newsagents.

The Atari is much more popular in the US than in Britain, and it would be worth looking out for back issues of American magazines; in particular, 'Antic' and 'Compute!' have carried a lot of Atari 800 features. Much of the Atari 800-specific material from Compute has been re-published in books. Look out for 'Compute's first book of Atari', 'Compute's first book of Atari Graphics' and similar titles. You should be able to order these from a good bookshop.

Atari themselves publish some excellent books on the inner workings of their machine, and you should be able to get these through your dealer. 'De Re Atari' is the classic; good-quality documentation for the ROM and hardware is also available from the manufacturer.



WORDSTAR CONFIGURATION

My printer is the Shinwa CP80, and whilst running Wordstar I am unable to utilise any of the different print styles. From the Wordstar help screens it appears as though there are some user-definable print codes but as my machine is second-hand and I don't have any software manuals I have no idea how to install these. Can you advise?

Apparently not?! The original disc contained two copies of this question but no author name, and no reply... Simon




Link to the top of this document    Link to the main index
Previous column ComputerAnswers    Next column ComputerAnswers