@3{INTO THE 128 @5}ZX Computing Monthly - May 1986 @4 "... It will load all programs which were specially written for the Spectrum 128, as well as many programs which were written for the Spectrum +, Spectrum 48K and 16K ..." @7 - extract from Sinclair ZX Spectrum 128 Introduction manual. @1 This article is all about Uncle Clive's new computer, the Spectrum 128. What it is, how it works, and what makes it tick. This article will be of use and interest to both Basic and machine code users. The Spectrum 128 is, as its manual states, two computers in one. It can run as a 128 (which is almost as different from the old Spectrum as was the QL), or it can pretend to be an old Speccy, in which case it behaves exactly as though it were an ordinary Spectrum with 48K of RAM. When running as a 128 there are a couple of extra commands, and a few other extra features such as calculator and a renumbering facility - these extra features are menu driven and cannot be initiated by a BASIC program. But what exactly does this mean in terms of compatibility? The manual claims that the machine can run in 48K mode, and that it will then run exactly like an old Speccy. However, the following line: @7 IF PEEK 75 = 191 THEN PRINT "THIS IS NOT A SPECTRUM 128" @1 will give different results on an old Speccy to the new Speccy in 48K mode. This is a minor detail and you shouldn't worry too much about it - in general Sinclair's claim that a 128 in 48 mode behaves exactly like a 48 should be considered truthful. 128 mode, however, has quite a few differences - some of which could well produce incompatibility with programs written for the ordinary Spectrum. I'd like to examine these differences now, and discuss their consequences. @5 CHARACTER SET @1 The first change is the character set. There are two differences in the character set which could affect the visual display of some graphics games. CHR$ 163 on the old Spectrum produced the user defined Graphic-T, and CHR$ 164 gave Graphic-U. On the new Spectrum they don't! CHR$ 163 gives the new keyword ~SPECTRUM~, and CHR$ 164 give the new keyword ~PLAY~. This means that on the new Spectrum 128 there are only nineteen user defined graphics, compared with twenty-one on the 48. The second change concerns the ZX Printer. @7The printer will not work on the Spectrum 128. @1 This is of course quite a serious difference for anyone who owns a ZX Printer and not one of those expensive things you have to plug into the RS232. It means that unless you buy a 'real' printer you can't list programs. Fortunately you don't have to buy an Interface One because the 128 already contains an RS232 Interface, although you still have to buy a lead. The reason that the ZX printer doesn't work is that the printer buffer (the area of memory between hex 5B00 and 5BFF) is used by the 128 for paging-in new regions of memory and for storing a few tables and system variables. This has consequences for the machine code programmer. Any machine code program designed to utilise the memory in the printer buffer is likely to cause a crash! The 128 contains at least two ROMs. The visible ROM is almost identical to the ROM of the old Spectrum, and contains the program for running BASIC. There is also an invisible ROM (invisible because you cannot read it using PEEK) which is paged in on power-up, and may be paged in using the code in the printer buffer. So far, I have not yet worked out how to utilise this ROM from machine code but I can make a guess as to what it contains. It must contain the program to operate the menus, the renumber facility, the calculator, and the new commands @7SPECTRUM@1 and @7PLAY@1. The ordinary ROM is, as I said earlier, almost identical to the old Spectrum ROM. This means that machine code programs which make use of subroutines in the ROM will still run perfectly well. No subroutine addresses have been changed, but the ROM is still slightly different. The space at the end of the ROM (addresses 386E to 3CFF) which used to be unused now contains some new code. There are also minor changes to the main bulk of the ROM. @5