For the benefit of new users, Andrew Hewson takes a trip down memory lane
A SIMPLE question to start with from Frank Woolton. He writes: I have a Spectrum Plus. Can I use Spectrum 48K games on my computer?
Yes, you can. It is now nearly four years since Sinclair launched his first Spectrum home computer, so it is worth reviewing the history of the machine for recent purchasers.
The Spectrum was originally launched in two versions-16K and 48K. The design was, incidentally, based on the ZX80 and the ZX81 which preceded it, and there were some distinct features of the Spectrum carried forward unnecessarily from the earlier computers.
The 16K and 48K machines differed only in the amount of RAM memory. The amount of RAM available determines the length and therefore, to some extent, the complexity of the programs which the computer can run.
The public soon demonstrated that the 48K machine was preferred. The manufacturers and others offered upgrades to 16K purchasers, and before too long the 16K machine was withdrawn. Independent software suppliers upgraded or withdrew their 16K programs.
That situation continued until late 1984 when Sinclair launched the Spectrum Plus. The keyboard of the original Spectrum 16K and 48K, while far superior to the plastic sheet of the ZX80 and ZX81, was unsatisfactory and a source of criticism from all quarters.
With the Spectrum Plus the manufacturers discarded the original case and keyboard and brought in a few cosmetic changes, such as the provision of a reset switch. They also redesigned the internal printed circuit board - not for the first time - but the operation of the machine, so far as the user was concerned, was unchanged from the 48K computer. Thus all software written for the Spectrum 48K will run on the Spectrum Plus and vice versa.
The same cannot be said of the recently introduced Spectrum 128K. For reasons which I will not go into here, 48K of RAM is the maximum amount which the Spectrum can drive without going into some fairly complex jiggery-pokery. In bringing in the 128K computer Sinclair has had a go at the jiggery-pokery by designing the machine to operate in two distinct modes.
In 128K mode some use can be made of the extra 80K of memory onboard, although it is not as convenient to get at as it might be. In 48K mode the computer is supposed to operate as an ordinary 48K/Plus machine. In fact, because of the jiggery-pokery, the operation is not quite identical. Some commercial software, especially that written before the design of the 128K became widely known, makes assumptions about the state of the 48K machine which do not hold true for the 128K machine.
Fortunately, not too much software is affected by the changes. The official Sinclair estimates is that 98 per cent of 48K/Plus programs also run on the 128K.
Thus, in summary, 16K programs run on the 48K machines but not necessarily vice versa; all 48K programs run on the Plus and vice versa; Plus programs probably run on the 128K but not necessarily vice versa.
|
Gerald Bishop bought a Spectrum Plus for his son, thinking that the only thing you could use a home computer for was to play games. Now he's a convert to the Sinclair User cause and is busily devouring back issues of the magazine, library books and so forth. He's even attempted to set up his own local user group.
His question concerns the use and meaning of Peek and Poke, which I shall come to in a minute, but because his letter is so contemptuous of the games-playing fraternity let me make one point before I start. While the average game may be fairly frivolous at best and totally mindless at worst, the sophistication of the computing which lies behind it is deadly serious.
Hence there is a great deal the average Sinclair user can learn about the capabilities of the home computer from studying commercial programs. Remember that the commercial programmer, whatever advantage he may have over the amateur in terms of the environment in which he develops his programs, has no advantage in terms of the equipment on which his product must eventually run. There is no secret ingredient available only to a few privileged workers.
Thus you too, given time and patience, can learn how to do anything which appears in a commercial program, whether it be super high-speed graphics in an absurdly trivial game, or compressed script and fancy window techniques in a sophisticated word processor.
Returning to Gerald Bishop's question he asks: 'What are Peek and Poke for?'
I'm not sure that they are 'for' anything, but they are certainly useful if you are interested in scrabbling around inside the memory to find out what is going on and how your machine works. Taking Peek first, it is a function which takes the form:
PEEK address
The address can be any positive whole number between zero and 65535 inclusive. Alternatively, it can be a positive number which when evaluated yields such a positive number.
The Peek function returns the value which is currently held at the address in memory referred to. In the Spectrum the first 16K of memory is so-called Read Only Memory, or ROM, which is fixed and immutable. Peeking into this area, between addresses zero and 16383 inclusive, always gives the same result. Try it and see - you can't do any harm. Use a command such as
PRINT PEEK 1000
It is this area of ROM memory which gives the Spectrum its distinctive character. The execution of the Peek function, together with all the other Basic functions and commands, is controlled by the contents of the ROM.
If you execute lots of PRINT PEEK commands you will observe that the result is always a positive number between zero and 255 inclusive. That is because there are 256 arrangements only of the eight bits which comprise each byte of memory at each address. The number of arrangements which the 16 bits constituting two adjacent bytes can take is 256*256=65536. For reasons which are not at all coincidental there are 65536 bytes of memory - 65536 different addresses in the 48K Spectrum and Spectrum Plus.
So much for Peek. If you Peek the addresses in RAM -those between 16384 and 65535 inclusive - you will find that they, too, only take values between zero and 255. Mostly the values discovered will be zero, corresponding to unused memory.
The Peek function is fairly bland. The Poke command, in comparison, is much more fun because it is used to alter the contents of memory. It takes the form:
POKE address, number
where the address ties between zero and 65535 inclusive as before, and the number lies between zero and 255 inclusive.
If you Poke a number into an address less than 16384 you will have no effect - because you are attempting to Poke ROM which is fixed and immutable - remember? Try:
PRINT PEEK 1000 POKE 1000,47 PRINT PEEK 1000
You will find that the contents of the address remain unchanged despite all your efforts.
Not so if you Poke a number into RAM. For the most part your change will be permanent, unless your Spectrum has other ideas for the memory location in question. Try a number of RAM addresses to see what happens but be careful - you are sticking a spanner in the works. You cannot do any permanent damage but you may cause some unexpected effects, and if the worst comes to the worst you may have to unplug or reset and start again.