The extra keywords, commands and statements of the 128K models
Overview
What follows is a table of keywords for the 128K models of the ZX Spectrum+. The original ZX Spectrum+ 128K improved on the original ZX Spectrum by increasing Random Access Memomry (RAM) from 48K to 128K, this allowed for the use of a RAMdisk or as Sinclair called it a 'silicon disc'. To access the silicon disc an exclamation mark (!) had to be placed in front of LOAD, SAVE, MERGE, VERIFY and CAT commands much like the Microdrive commands had an asterisk (*) in fromt of them. This method of accessing the silicon disc was continued when Amstrad purchased the rights to Sinclair computers and started production of the ZX Spectrum +2. The +2 was almost the same computer as the Spectrum+ 128K but with a full size keyboard, a built in cassette player and a few minor changes to the ROM. For this reason this article will treat these two Spectrum computers as the same.
When Amstrad introduced the +3 with a built in 3 inch disk drive the previous method of accessing the silicon disc was dropped in favour of a CP/M based system. Amstrad also introduced the +2A and +2B. On the outside these were branded simply as the +2 but in actuality were more like cut down +3's and used the same CP/M like commands to access the silicon disc. The +3, +2A & +2B also had different methods of sending data to printers and other external devices. This article lists the +3 along with the +2A and +2B because they share the same CP/M-like commands.
All 128K models share the same sound statement 'PLAY' which allows control of the AY-3-8912 sound chip as well as the 'SPECTRUM' command which places the computer in 48K mode.
Some of the commands like COPY, ERASE and CAT may be familiar to original ZX Spectrum and ZX Interface 1 users. These commands and others may have similar functions to ZX Spectrum/Interface 1/Microdrive commands but may work in a different way with different parameters.
Commands
Keyword
Meaning
Comments
CAT
CAT [#n,] [d] [a] [EXP] (+3, also +2A and +2B)
Result: Produces an alphanumerically sorted catalog of files.
If used in the form CAT #n,... the output is directed to stream n. If an unambiguous filename (or an ambiguous file specification) is included, then only those files that 'match' will be displayed. When CAT is followed by a drive letter only, then all files on that drive will be displayed. If the drive letter specified is T:, then a catalogue of tape filenames will be displayed.
EXP suffix produces an expanded catalogue that includes system files, and displays those files whose write protection, system status and archive attributes have been set.
Drive M: is the RAMdisk (formerly the silicon disc on the 128K and +2).
CAT !
CAT ! (+128K and +2 only)
Result: Produces a list of files stored on the silicon disc.
This command was only used on the 128K and +2 model only. It was deprecated on the +3, +2A and +2B models. These models had their own CP/M based method for accessing the silicon disc.
For example: CAT "m:" would be the equivelant of CAT ! on the +3.
COPY
(all models)
COPY EXP
(+3, +2A and +2B only)
COPY TO
(+3, +2A and +2B only)
COPY TO SCREEN$
(+3, +2A and +2B only)
COPY TO LPRINT
(+3, +2A and +2B only)
COPY TO SPECTRUM FORMAT
(+3, +2A and +2B only)
COPY (+128K, +2, +3, +2A and +2B)
Result: Sends (dumps) a copy of the top 22 lines of the screen display to the printer (if connected) in quad density Epson bit map format; otherwise does nothing.
Report D if BREAK pressed.
COPY EXP [INVERSE] (+3, +2A and +2B only)
Result : Sends a copy of all 24 lines of display to the printer (if connected) in quad density Epson bit map format; otherwise does nothing.
Each coloured dot on the screen is printed with a different pixel pattern thus providing different grey levels for each colour. The BRIGHT attribute is also taken into account.
The optional INVERSE modifier allows the dump to be 'reversed' (like a negative) in order to save ribbon wear when printing-out predominantly black dumps.
Report D if BREAK pressed.
Note that if the dump is prematurely stopped, the printer may be left in graphics mode and the line feed set to an odd value.
COPY u1TO u2 (+3, +2A and +2B only)
COPY a¦d TO d (+3, +2A and +2B only)
Result : Copies the first named file to the second named file. The names must be different. Drive letters and user numbers may be specified within the filename.
If the source (u1) is an ambiguous file specification, then the destination (u2) must only be a drive letter. (In this case, the destination files will have the same name as the source.)
If both source and destination names are just drive letters, a complete disk-to-disk transfer will be made (note that any files previously on the destination disk will be deleted). If the destination disk is not +3 format, then the disk-to-disk transfer will not work.
When copying files, if the destination filename already exists, then the report 'File already exists will be displayed'. If the report 'Missing address mark' is displayed, then it is likely that the destination disk has not been formatted.
COPY u TO SCREEN$ (+3, +2A and +2B only)
Result : Displays the contents of a disk file on the screen. Control characters (tabs, line feeds, etc.) are replaced by spaces. This command can only sensibly be used to inspect ASCII files (though BASIC programs will be displayed, albeit without the correct formatting).
COPY u TO LPRINT (+3, +2A and +2B only)
Result : The contents of the named disk file are sent to the printer. No character translations are made. If the command FORMAT LPRINT "r" has been issued (to divert printer output to the serial (RS232 socket), then this form of the COPY command may be used as a method of exporting programs to an external machine.
COPY u TO SPECTRUM FORMAT (+3, +2A and +2B only)
Result : This allows a +3DOS file header to be added to a binary file created on a different type of machine. A new file with the name: u.HED is created.
The COPY statement has been greatly expanded for the +3, +2A and +2B models to include keywords already found on the Spectrum, but now given different meanings. The 128K and +2 (grey case) models had different methods of communicating with printers.
ERASE !
ERASE ! f (+128K and +2 only)
Result: Erases file f from the silicon disc.
This command was only used on the 128K and +2 model only. It was deprecated on the +3, +2A and +2B models. These models had their own CP/M based method for accessing the silicon disc.
For example: CAT "m:" would be the equivelant of CAT ! on the +3.
ERASE
ERASE a¦d (+3, also +2A and +2B)
Result: If a single file is specified, then that file will be erased from either the default drive or the drive identified in the filename. If an ambiguous file name is specified, a message asking for confirmation will appear. If Y is pressed, then all files that match the specification will be erased. If ERASE is followed by a drive letter only, then all files on that drive will be erased without confirmation being sought.
Only on the +3, +2A and +2B models.
FORMAT
(+2, +3, +2A, +2B)
FORMAT LINE
(+3, +2A, +2B)
FORMAT LPRINT
(+3, +2A, +2B)
FORMAT f;n (+128K and +2 only)
FORMAT LINE n (+3, +2A and +2B only)
Result: Sets the baud rate of the RS232 interface (device f on the +128K and +2) to n. Valid baud rates are in the range 75 to 19200.
Device f may be "p" or "P" (+128K / +2).
FORMAT d (+3 only)
Result: Prepares the disk in the specified drive (A: or B:) to be used. If the disk has already been formatted on a +3, a message allowing the operation to be abandoned will produced.
Disks formatted on other machines (except the AMSTRAD PCW range (CF-2) format) will not be recognised.
FORMAT LPRINT f1[;f2] (+3, +2A and +2B only)
Result: Allows printer output to be redirected and token expansion to be switched on or off.
If string f1 is "C", then subsequent printer output will be via the Centronics interface (the PRINTER socket).
If string f1 is "R", then printer output will be directed to the RS232 socket.
String f1 can also be "E" (for expanded), in which case characters below CHR$ 32 are not sent to the printer, and those above CHR$ 127 are converted to the letters of the appropriate BASIC token.
When string f1 is "U" (for unexpanded), all characters that follow are sent to the printer without translation. This allows ESC (escape) sequences to be sent.
If f1 is either "C" or "R", a second string, f2, may be specified, this can be either "E" or "U".
FORMAT ! and FORMAT LINE are equivalents and perform the same task.
LOAD !
LOAD ! f (+128K and +2 only)
LOAD ! f DATA () (+128K and +2 only)
LOAD ! f DATA $() (+128K and +2 only)
LOAD ! f CODE m,n (+128K and +2 only)
LOAD ! f CODE m (+128K and +2 only)
LOAD ! f CODE (+128K and +2 only)
LOAD ! f SCREEN$ (+128K and +2 only)
Result: Load program (or code) f from the silicon disc (RAMdisk) into main memory.
This command was only used on the 128K and +2 model only. It was deprecated on the +3, +2A and +2B models. These models had their own CP/M based method for accessing the silicon disc.
MERGE !
MERGE ! f
Result: Merge program f stored on the silicon disc with that already in main memory overwriting duplicate program lines.
This command was only used on the 128K and +2 model only. It was deprecated on the +3, +2A and +2B models. These models had their own CP/M based method for accessing the silicon disc.
MOVE TO
MOVE f1TO f2 (+3, also +2A and +2B)
Result: This will rename file f1 to f2. Both files f1 and f2 must be on the same drive.
MOVE u TO f (+3, also +2A and +2B)
Result: The string f may be "+P", "+S", "+A", "-P", "-S" or "-A". This allows the attributes of the file specified by u to be set (+) or unset (-). The attribute letters in the string f control write protection (P), system status (S), or archive status (A).
The CAT...EXP command can be used to display current settings. Protected files cannot be erased, saved over, or have any operation that would change them in any way performed upon them. System files are hidden from the normal catalog display and are only shown by the CAT...EXP command.
Archive status is provided for compatibility with CP/M based machines, and has no other relevance to the +3.
Only on the +3, +2A and +2B models.
SAVE !
SAVE ! f (+128K and +2 only)
SAVE ! f LINE m (+128K and +2 only)
SAVE ! f DATA () (+128K and +2 only)
SAVE ! f DATA $() (+128K and +2 only)
SAVE ! f CODE m,n (+128K and +2 only)
SAVE ! f SCREEN$ (+128K and +2 only)
Result: Save program f to the silicon disc from main memory.
This command was only used on the 128K and +2 model only. It was deprecated on the +3, +2A and +2B models. These models had their own CP/M based method for accessing the silicon disc.
SPECTRUM
SPECTRUM (+128K, +2, +3, +2A/+2B)
Result: Switches monitor program from 128K mode to 48K mode keeping any program in RAM.
Once the SPECTRUM command has been issued the 48K ROM is 'locked in' and 128K mode cannot be returned to.
The SPECTRUM keyword token replaces the user defined graphic character 't' (CHR$ 163) on the original ZX Spectrum.
VERIFY !
VERIFY ! f
VERIFY ! f DATA ()
VERIFY ! f DATA $()
VERIFY ! f CODE m,n
VERIFY ! f CODE m
VERIFY ! f CODE
VERIFY ! f SCREEN$*
*This command will be accepted by the Spectrum but will fail verification.
Result: Compare program f from silicon disc with that in main memory. Error R if verify fails.
This command was only used on the 128K and +2 model only. It was deprecated on the +3, +2A and +2B models. These models had their own CP/M based method for accessing the silicon disc.
Statements
Keyword
Meaning
Comments
PLAY
PLAY f1[,f2,f3...,fk]
Result: Interpret up to eight strings and play them simultaneously. The first three strings play via the TV speaker and (optionally) via the MIDI socket; and subsequent strings can be output only via MIDI.
Here is a list of the parameters that can be used in the string of a PLAY command, together with the values they may have.
a...g The pitch of the note within the current octave range.
A...G The pitch of the note within the current octave range.
$ Note which follows must be flattened.
# Note which follows must be sharpened.
O Octave number to be used (followed by 0 to 8).
1...12 Length of notes to be used.
& Specifies that a rest is to be played.
_ Specifies that a tied note is to be played.
N Separates two numbers.
V Volume to be used (followed by 0 to 15).
W Volume effect is to be used in a string.
U Volume effect is to be used in a string.
X Specifies duration of volume effect (followed by 0 to 65535).
T Tempo of music (followed by 60 to 240).
() Enclosed phrase must be repeated.
! ! Enclosed comment is to be skipped over.
H Specifies that the PLAY command must stop.
M Channel(s) to be used (followed by 1 to 63).
Y MIDI channel is to be used (followed by 1 to 16).
Z MIDI programming code (followed by code number).
PLAY supercedes the BEEP statement although BEEP is still a valid keyword on all 128K models.
The PLAY keyword token replaces the user defined graphic character 'u' (CHR$ 164) on the original ZX Spectrum.
Nomenclature
This list uses the same letters to represent variables, expressions and sequences etc. as the ZX Spectrum, ZX Spectrum+ 128K and +3 BASIC manuals.
α,β represents a single letter
v represents a variable
x,y,z represents numerical expressions
m,n represents numerical expressions rounded to the nearest integer
b represents a 16 bit binary number
e represents an expression
f represents a string valued expression
s represents a sequence of statement separated by colons :
c represents a sequence of colour items, each terminated by commas , or semi-colons ; A colour item has the form of a PAPER, INK, FLASH, BRIGHT, INVERSE or OVER statement.
d represents a string that evaluates to a valid drive, ie. A:, B:, M: or T:.
u represents an unambiguous DOS filename.
a represents a DOS filename that may be ambiguous, ie. one that may contain the wildcards * or ?.
¦ (vertical pipe) when placed between expressions represents one expression OR the other.
References
Sinclair ZX Spectrum BASIC Programming, Steven Vickers (author), Robin Bradbeer (editor)
ZX Spectrum 128 Introduction, Sinclair Research Ltd (publisher)
ZX Spectrum+2, Amstrad Consumer Electronics (publisher), Ivor Spittal (author), Robin Goodwins (author), Steven Vickers (extracts only), Robin Bradbeer (extracts only)
ZX Spectrum +3, Amstrad Consumer Electronics (publisher), Ivor Spittal (author), Robin Goodwins (contributor), Rupert Goodwins (contributor), Des Rackliff (producer), Steven Vickers (extracts only), Robin Bradbeer (extracts only)