Changes
Fixed some minor OCR typos
== GENERAL SYSTEM ARRANGEMENT ==
Superficially, the CPC464 is a typical Z8Ø—based Z80—based system, with an unusually economical arrangement of peripheral devices. By making full use of the capabilities of these devices, a performance level has been obtained which is higher than the limited chip count might suggest. One consequence of this is that the operating system is especially complex, a fact which is offset by the comparative ease of user access to the various functions. The word ‘comparative‘ 15 is necessary, because knowledge of machine code is needed, which may be a difficulty for some users, but once they have come to terms with machine code a wide range of possibilities opens up.
Among other ingenuities, the way in which a minimum of 96K of memory has been packed into a 64K memory map is especially noteworthy, and this aspect of the system will be studied first.
=== The Memory Map ===
The whole of the 64K byte memory is occupied by RAM, to which any writes to memory will be directed. This makes sense, since there is r no point in trying to write to ROM. Reads from addresses in the middle half of memory will also access RAM, there being no ROM in this area. For addresses in the top and bottom quarters of memory, however, both ROM and RAN are present, and it is possible to read from either at will. A BASIC peek will always access RAM, so a special bit of machine code is needed to obtain the contents of ROM.
The memory arrangement is complicated by the fact that the top quarter of RAM is dedicated to use as screen memory, and most must be immediately accessible at regular intervals while data Is being passed to the display. For this purpose, two bytes are read every microsecond.
The processor is put into a wait state while the pairs of bytes are being transferred, the transfer being made directly from memory to the Video Gate Array, using an address generated by the CRT Controller chip. This means that the main processor can only make one memory access per microsecond, and although its clock runs at 4 MHz the actual processing speed is slightly reduced, a point to watch when calculating execution times.
=== Outer Peripherals ===
The devices mentioned above are the ‘inner peripherals‘, which are accessed directly from the main processor. Further devices, classed as the ‘Outer Peripherals‘, are accessed by the inner peripherals. They include the Programmable Sound Generator, accesed accessed by the PPI; the keyboard, accessed by the PPI and the Sound Generator; the Cassette Recorder, accessed by the PPI; the Loudspeaker, driven by the Sound Generator.
For further details of the hardware system, consult ‘[[The Ins & Outs of the Amstrad|The Ins and Outs of the Amstrad]]‘, which gives additional Information on the coding and action of these devices.
=== System States ===
At switch-on, a number of initialisation procedures are executed, and control then passes to upper ROM Ø0. If there is no external ROM of this number, the internal BASIC interpreter takes charge as the ‘foreground‘ program.
Once a foreground program has been entered, it remains in charge until a return at entry level is executed, when a full reset is performed, and ROM is again put in charge. However, the foreground program can call on background programs for assistance, and these, in turn, can call other programs. There is thus — nominally — one foreground level, but there can be several background levels.
A ROM other than 0, or a program in RAM, can be selected as the foreground program. This can be done by a RUN”” command which reads a machine code program that has a defined Start address, or by a machine code routine. It may be more convenient to leave the BASIC interpreter nominally in charge and run a program CALLed from BASIC as if it was a foreground program. This has the advantage that a full reset is not inevitable in response to a return at entry level. Instead, the interpreter is re—entered.
Using BASIC in this way has other advantages. [[HIMEM]] can be checked and adjusted quite easy putting it below the area in which machine code is to reside, and other system variables can be set up. The BASIC program will use some RAM, particularly from Ø17 0170 upwards, but this is likely to be a negligible drain on the large RAM area available.
One point to watch is that if extension systems are added, such as disc drive, speech facility, or the [[Maxam|MAXAM]] assembler in ROM form, HIMEM is lowered, because the extensions have claimed workspace for their own use. Some commercial programs are incompatible with a disc drive ‚ because they trespass on the disc workspace. Protected or not, they cannot be transferred to disc.