Acorn Computers Limited, 4a Market Hill, Cambridge CB2 3NJ. England. Telephone 0223 312772 SYSTEM 2 TECHNICAL MANUAL Chapter 1 - Introduction 2 - Parts List 3 - Electrical Assembly 4 - Mechanical Assembly 5 - Peripheral Devices 6 - Cassette Operating System Commands 7 - Operating System Control Characters 8 - Teletext Visual Display Unit 9 - O.S. Software Specification 10 - Circuit Diagrams & Descriptions 11 - System Expansion (C) COPYRIGHT ACORN COMPUTERS LTD 1980 ISSUE 1 JAN 1980 OCRed and converted to plain text by Ben Harris , April 1998. $Id: Sys2TM.txt,v 1.11 1998/05/21 20:25:18 bjh21 Exp $ Editing continued and Chapters 5-9 added by J.G.Harston January 2018 Chapters 5-8 taken from Ben Harris' unedited source. Chapter 8 cross referenced with "80x25 VDU Card" documentation Chapter 9 taken from System 5 OS documentation and Atom COS documentation Chapter 1 Introduction to system 2 The Acorn system 2 is a complete micro-computer available in kit form or fully assembled and tested. Using the popular Euro cards (100 x 160mm) an easily expanded system concept has been created and System 2 itself may be produced as an expansion of the two card System 1. The cards are housed in a 19" card frame with a backplane using DIN standard two part connectors. No peripheral devices are supplied with the basic System 2, it being left to the user to select the ASCII keyboard, CRT display, cassette tape recorder and power supplies best suited to the application. These parts are, of course, available with the system if required. The system may be furnished with professional connectors, front panels and a 19" case if desired. At the heart of System 2 is the Cassette Operating System (COS) software and the Acorn BASIC interpereter. This resident software provides powerful high level language facilities ideally suited for all applications. Chapters 2, 3 and 4 of this manual need to be referred to only if the system is in kit form. Chapters 9, 10 and 11 need only be referenced in case of system expansion. The Acorn BASIC is described in its separate manuals. 1-1 Chapter 2 - System 2 Parts List Unpack the kit carefully and ensure that no components are concealed within the packing materials. 6502 CPU card PCB Printed Circuit Card 200,000 issue 3 or later IC1 6502 micro processor and 40 pin socket IC2 INS 8154 RAM/IO " IC3 2114 RAM and 18 pin socket IC4 2114 RAM " IC5 Not supplied IC6 Not supplied IC7 OS ROM and 24 pin socket IC8 INS 8154 RAM I/O not supplied but 40 pin socket is IC9 74LS20 and 14 pin socket IC1O 74LS139 and 16 pin socket IC11 74LS04 and 14 pin socket IC12 74LS00 and 14 pin socket XTAL 1MHz crystal R1-4 4 off 4K7 resistor Cl-2 47 or 100 nF capacitor C5-8 " C9 15 uF electrolytic capacitor NB C3, C4, C10, IC5, OC6, and IC13 are not fitted. IC8 is available as an accessory. 2-1 Cassette Interface PCB Printed Circuit Card 200,001 issue 2 or later IC1 CD4024B and 14 pin socket IC2 CD4024B " IC3 CD4011B " IC4 CD4013B " IC5 CD4001B " IC6 CD4024B " IC7 LM358 and 8 pin socket R1 3K9 resistor R2 47K resistor R3 4K7 resistor R4 1K resistor R5 10K resistor R6 4K7 resistor R7 4K7 resistor R8 47K resistor R9 4K7 resistor R10 4K7 resistor R11 10K resistor R12 47K resistor R13 4K7 resistor R14 470K resistor R15 4K7 resistor R16 4K7 resistor C1 100pF capacitor C2 1nF capacitor C3 10nF capacitor C4 1nF capacitor C5 15uF electrolytic capacitor C6 47 or 100 nF capacitor C7 Not fitted C8 22nF capacitor C9 47 or 100 nf capacitor C10 47 pr 100 nF capacitor 2-2 Visual Display Unit Interface PCB Acorn Computers Ltd. pt no 200,002 IC1 74LS139 decoder and 16 pin socket IC2 74LS02 NOR gate and 14 pin socket IC3 74LS13 Schmitt trigger and 14 pin socket IC4 MC6845 C.R.T. controller and 40 pin socket IC5,6,7 74LS157 data selector and 16 pin socket IC8,9 2114-3 R.A.M. and 18 pin socket IC1O 74LS174 hex flip-flop and 16 pin socket IC11 INS 8208 buffer and 20 pin socket IC12 74LS86 excl. OR gate and 14 pin socket IC13 SAA5050 character generator and 28 pin socket IC14 74LS00 NAND gate and 14 pin socket Q1 BC197 transistor D1 1N4148 diode R1 1K resistor R2 1K resistor R3 470 R preset potentiometer R4 10K resistor R5 4K7 resistor not supplied R6 22K resistor R7 4K7 resistor R8 10K resistor R9-12 4 off 10K resistors R13 4K7 resistor R14 10K resistor R15 470R resistor R16 82R resistor R17 18K resistor not supplied R18 10K resistor R19 10K resistor not supplied R20-22 3 off 10K resistors Cl 10 or 15 uF electrolytic capacitor C2-7 6 off 47 nF capacitors C8 100 pF capacitor C9 150 pF capacitor NB For IC11 INS208 is equivalent to DP8304 2-3 Memory Board (issue 2) PCB Printed Circuit Card 200,003 issue 2 or later IC3-10 2114 RAM and 18 pin socket IC1,2, 11-16 18 pin sockets supplied for extension RAM IC17 BASIC ROM and 24 pin socket IC18 24 pin socket supplied for extension ROM IC19 74LS42 and 16 pin socket IC20 74LS00 and 14 pin socket IC21 81LS95 or 97 and 20 pin socket IC22 INS8208 and 20 pin socket IC23 81LS95 or 97 and 20 pin socket IC24 74L42 and 16 pin socket IC25 74LS00 and 14 pin socket R1 1K resistor C1-7 7 off 47 or 100 nF capacitors C8 15uF electrolytic capacitor NB IC24 is a 74L42 from National Semiconductor only Also supplied for System 2 is 1 off Card Frame 173-12501L 4 off 64 way plugs 17-3704L 4 off 64 way sockets 17-3705F 8 off card guides 173-12553G 1 off Back-plane PCB 200,011 Earthwire and solder tag 16 off 2.5 mm x 10 mm screws 8 off 2.5 mm nuts 2-4 Chapter 3 - Electrical Assembly Assembly Technique Four Eurocards and a backplane board have to be assembled for System 2, the components for each card are packed separately in plastic bags or on conducting foam. Before attempting to assemble each card check that all the component parts are present and that none have been damaged. It is worthwhile taking a few minutes to make sure that all the components can be identified. Sometimes components will be substituted in case of supply difficulties. For instance, 0.047 uF capacitors may replace 0.1 uF capacitors shown on the parts list. The components substituted will in no way be detrimental to the system's operation. Also some manufacturers have similar but different type numbers eg for the CMOS a CD4011 from RCA may be replaced by an MM5611 from National Semiconductor. For capacitors note that the value may be expressed in one of two ways: 100 nF = 0.1 uF 10 nF = 0.01 uF 1 nF = 1000 pF 0.1 nF = 100 pF etc. Capacitors supplied with the Acorn cards are usually identified by a 3 digit number, the first two digits being the first two digits of the value and the third being the number of following zeros eg: 101 = 10 and one zero ie. 100 pF 103 = 10 and three zeroes ie. 10000 pf = 10 nF 473 = 47 and three zeros i.e. 47000 pF = 47 nF = 0.047 uF. If in doubt about the capacitor values, count the number of each of type supplied in the kit and then identify them using the parts list quantities. The resistor colour code is shown here. [ Picture removed from ASCII version ] 3-1 The first and second bands give the resistor value and the decade band shows the number of zeros following: 0 Black 1 Brown 2 Red 3 Orange e.g. Yellow, Violet, Orange 4 Yellow is Yellow, Violet = 4,7 and 5 Green Orange = 3 zeros i.e. 000. 6 Blue So the value is 47000 ohms, 7 Violet i.e. 47 kilo-ohms or 47K. 8 Grey 9 White The tolerance band is red for +/- 2%, gold for +/- 5% or silver for +/- 10%. Assembling the cards will require a considerable amount of soldering and a small electric soldering iron is essential with a diameter at the end of the bit not exceeding 0.1 inches. The iron should be rated between 10 and 30 watts and fine 22 gauge flux cored solder should be used. If you have never soldered before we advise you not try to assemble the cards without assistance as Acorn Computer Ltd. cannot accept responsibility for kits which have been improperly assembled. When soldering make sure the component is well pushed on to the board as shown, use a minimum of solder and once the solder has run remove the iron. [ Picture removed from ASCII version ] Some of the integrated circuits used in the system employ MOS technology and they can be damaged by static electricity. As a general rule if there is no noticeable static charge in the area and no nylon clothes or carpets are present all will be well. An earthed soldering iron should be used when soldering on a board containing MOS, ICs and the ICs should be kept on the conducting foam on which they are supplied until required. The Acorn Printed Circuit cards are double sided, through hole plated glass fibre and are manufactured to the highest standards. A layer of green solder resist ensures that accidental solder splashes do not stick to the tracks and a clearly marked white silk screen indicates component positions. Examine the cards for faults or damage before proceeding. It is not necessary to solder through holes which connect one side of a board to the other and do not have a component lead in them and attempting to do so can break the through hole plating and thus the connection. All soldering should only be done on the opposite side of the board to the components (i.e. side 1). 3-2 The cards are each supplied with a full set of integrated circuit sockets. The sockets must be fitted the right way round, on the circuit board viewing it from the top. Pin 1 of an IC is identified as shown: [ Picture removed from ASCII version ] The sockets will have either a 45 degree chamfer for pin 1 or a semi circular cut out as shown: [ Picture removed from ASCII version ] Note that on the Central Processor Unit IC1 is the opposite way round to the other sockets nearby. Fit the sockets one at a time and ensure that they are pressed fully down with no leads bent under the socket before first soldering two diagonally opposite pins at the corners. Check that the socket is the right way round and successfully fitted before soldering the rest of the pins. There is no need to snip off the excess of the socket pins. After the IC sockets the resistors and capacitors are fitted to the circuit cards. Identify the component from the component list and fit it to the board. Some capacitors will need to be fitted as shown. [ Picture removed from ASCII version ] Do not crack the capacitor body when bending the leads. The electrolytic capacitors are polarised and the positive end marked + must be located as indicated on the circuit cards. The crystal on the CPU card is fitted as shown: [ Picture removed from ASCII version ] Again bend the leads away from the component body and lay the crystal down on the board before soldering. Snip off any excess leads under the board. 3-3 The connector is fixed to a card using two 2.5 mm screws and nuts before soldering the pins. When all of the components are soldered the integrated circuits may be fitted in their sockets, pin 1 is identified by either a semicircle or a dot as shown:- [ Picture removed from ASCII version ] Identify the IC type from the components list and plug it into the appropriate socket. If the leads are splayed out press them all in together as shown until the IC fits easily to the socket. [ Picture removed from ASCII version ] Take care that no IC pins get bent under the IC when inserting and remember that IC1 on the CPU card is the opposite way round to its neighbours. 6502 CPU Printed circuit cards at issue 3 or later are supplied with complete systems. The NMI, IRQ and RST switches are not required. Also not supplied or required are ICs 5 and 6 together with their 16 pin sockets and the 5 volt regulator, IC 13. The electrolytic decoupling capacitor is fitted at C8 and C10 must not be used. This allows the Block zero signal to be connected to the backplane by fitting a wire link to the right hand side of IC13 as marked on the silk screen. The INS 8154 RAM/IO chip is fitted at IC 2 and the ASCII keyboard connects to port B of it. A 20-way right angled header may be fitted for connecting the keyboard or wires can be soldered directly to the edge fingers. IC 8 is not used in the system but a second INS 8154 can be fitted here giving 16 I/O lines for user definition and so a socket for it is supplied. [ Picture removed from ASCII version ] 3-4 The operating system ROM is fitted in IC 7 and to use it the correct address selection links are required: [ Picture removed from ASCII version ] To produce this a track must be broken on side 2 of the card as shown: [ Picture removed from ASCII version ] and a wire link must be fitted from pin 5 to pin 9 of the ADR SEL location. The ROM IC marked COS (Cassette Operating System) can now be fitted in IC 7. In System 2 three connections from IC 2 to the backplane are required in order to connect to the cassette interface. On issue 3 boards these must be made with three pieces of fine insulated wire and they are as follows: IC 2 pin 16 to backplane plug pin B 19 for CASIN IC 2 pin 17 to backplane plug pin B 20 for CASOUT IC 2 pin 18 to backplane plug pin B 21 for NHITON Cassette Interface Printed Circuit Cards at issue 2 or later are supplied with complete systems. IC 8, the 8 digit display and the small keypad are not required for System 2. Before fitting the 64 way plug the following pins MUST be cut off the plug as close to its body as possible. The pin numbers are marked on the body of the plug: A2 - 31 inclusive Bl B21 - 31 inclusive A wire link is required from IC 6 pin 3 to pin B 14 of the connector for the Not High Tone signal. [ Picture removed from ASCII version ] 3-5 VDU Interface Card R5 is not required on this card. [ Picture removed from ASCII version ] Memory Card This card carries the 4K of user RAM in ICs 3, 4, 5, 6, 7, 8, 9 and 10 and to address it a link must be fitted in position RAM 1. A further 4K of RAM (8 x 2114's) may be added at anytime and the extra sockets are supplied as standard. If an issue 1 memory card is supplied the BASIC will be in a pair of EPROMs. The low one is fitted in IC 17 and the high one in IC 18, a link must then be fitted in position ROM 6. Eventually all systems will be supplied with issue 2 memory cards and the BASIC in a single ROM. This ROM is fitted in IC 17 and again a link must be fitted in position ROM 6. [ Picture removed from ASCII version ] If desired a write protect switch for the RAM may be fitted by breaking the track marked between ICs 15 and 21 and fitting a SPST switch across it. Back Plane The backplane has provision for eight 64 way Euro card sockets and two 32 way power supply sockets. Side A is connected from pin to pin right across the back plane and carries the computer data bus, address bus, control lines, clock and power. Side B is left unconnected and may be wire wrapped to configure a user defined system of additional boards, extra I/O, interrupt priorities etc. The left hand 64 way card location has its 16 bit address bus isolated from the other cards, and so it may not be used for System 2. System 2 connectors are fitted as shown: [ Picture removed from ASCII version ] 3-6 Ensure that the connectors have pin 1 at the top and push their pins through the backplane. With each connector pushed hard against the backplane solder pins A1 and A32, check that the connectors are all lying flat on the back plane before soldering the rest of side A. The side B pins should not be soldered at all. Four connections are necessary to connect the 6502 CPU card to the cassette interface. These may be made with soldered links but preferably are wire-wrapped. Simple hand wire-wrapping tools are available for about £5.00. The connections are: CPU card pin A29 to cassette interface pin B11, Ø2 clock " B19 " " B12, CASIN " B20 " " B13, CASOUT " B21 " " B14, NHITON Finally a wire link is soldered on the left of the back plane to connect the system 0volts to the earthing wire. The earthing wire is soldered into the backplane and using a solder tag it is connected to the card frame metal work by the top left tie bar screw after the backplane has been mounted in the frame. The backplane is now ready for use in System 2. 3-7 Chapter 4 - Mechanical Assembly The Eurocard frame kit contains two end plates, two end plate front angles, two front tie bars with tapped strips, two rear connector mounting rails and eight fixing screws. Assemble the frame as shown: [ Picture removed from ASCII version ] Note that when viewing the frame from the front, the 83rd guide position is on the right. The standard allocation of the front of the cardframe is as shown: [ Picture removed from ASCII version ] The 2.8" space is for a 5/12 volt power supply. Seven Eurocards spaced at 1" are allowed for with another one occupying part of the 7" space for a floppy disc controller. The left hand Eurocard location is reserved for the CPU card when bus buffers are fitted to the backplane. The four-card System 2 does not require buffers and so the cards are fitted as follows: 2.8" Space (power supply) 1" Space 1" CPU 1" cassette interface 1" VDU interface 1" memory board 1" Space 1" Space 7" Space (Floppy disc controller) Take the backplane board with its four connectors and lay it so that the board is between the upper and lower rear tie bars with the connector mounting ears on the front of the tie bars. Pin 1 of the connectors should be at the top i.e. the bus buffer IC locations are to the left hand side. Using eight of the 2.5 mm screws provided fix the connectors into the tapped holes on the rear tie bars that are numbered 21, 26, 31 and 36. Check that the power bus lines on the backplane are not shorted to the tie bars. 4-1 [ Picture removed from ASCII version ] With the backplane mounted in the frame take care that the protruding connector pins are not damaged in any way. Card and module guides may be fitted at multiples of 0.2" spacings by either clipping them into the holes, or onto the metal between the holes, of the tie bars: [ Picture removed from ASCII version ] Note the guides are fitted with the flat side to the left and the stepped side to the right. To fit the guides place them in the appropriate location on the rear tie bar and then push them onto the front tie bar where they snap into position. [ Picture removed from ASCII version ] To remove the guides push them to the rear whilst unclipping them from the front tie bar. Top and bottom pairs of guides are fitted into positions 20, 25, 30 and 35. It should now be possible to slide the four boards into the guides with their components facing to the right. The connectors should mate together but it may be necessary to loosen the screws securing the backplane connectors and move the backplane fractionally to allow the connectors to mate freely. With a fully expanded system card guides are fitted in positions 15, 20, 25, 30, 35, 40 and 45 with the slimmer module guides in positions 2, 12, 51 and 82. The Eurocard frame may be fitted in a 19" case giving protection for the printed circuit cards. Two front handles supplied with the case are positioned behind the card frame angles and four screws with plastic washers secure the frame and handles into the case. 4-2 One-inch front panels may be fitted to the Eurocards, these are available with holes already cut for suitable front connectors for each board. The memory board only requires a blank panel. The front panel is fixed to the board using two plastic brackets also supplied as shown: [ Picture removed from ASCII version ] 4-3 Chapter 5 - Peripheral Devices Power Supply System 2 requires a 5 volt stabilised supply at a current rating of not less than 1.5 amps (2 amps with 8K of RAM). This supply may be connected with two pieces of wire to the holes provided on the backplane (see page 3-11). If the 0 volt line of the supply is not earthed a safety earth should be connected to the card frame metalwork, which is in turn connected to the earth connection on the backplane. If available, a 5 volt/3 amp module may be fitted in the left of the rack using four module guides and a 32 way socket on the left of the backplane. Keyboard A parallel ASCII keyboard is required to be fitted on the front of CPU card. A 5 volt supply for the keyboard is available and the board requires a 'low for key depressed' strobe signal. The connections may be soldered to the front of the board as follows: (top) 20 +5 volts 19 Reset 18 Key strobe 17 Data bit 6 16 Data bit 5 15 Data bit 4 14 Data bit 3 13 Data bit 2 12 Data bit 1 11 Data bit 0 10 - 9 - 8 - 7 - 6 - 5 - 4 - 3 - 2 - (bottom) 1 0 volts The reset is provided by a simple push button connected to 0 volts. This is often available as an extra key on ASCII keyboards. 5-1 If desired a 20 way PCB header can be connected to the CPU card in which case the keyboard connections are as follows: 20 Data bit 5 19 Data bit 6 18 Data bit 4 17 Key strobe 16 Data bit 3 15 Reset 14 Data bit 2 13 + 5 volts 12 Data bit 1 11 0 volts 10 Data bit 0 9 - 8 - 7 - 6 - 5 - 4 - 3 - 2 - 1 - When connecting ribbon cable sockets to the headers ensure that the pin 1 identification arrows are together. Cassette Recorder System 2 uses a standard Audio Cassette Recorder for program and data storage. On the cassette interface card is a Computer Users Tape Standard interface which connects to the recorder as shown: [ Picture removed from ASCII version ] This recorder output consists of one of two tones, 2.4 KHz represents a logic 1 and 1.2 KHz a logic 0. Each bit i.e. 0 or 1 lasts for 3.3 mS giving an operating speed of 300 bits/ second. Both recording and playback are crystal controlled giving a low error rate and except on very cheap recorders whose speed may vary, no trouble should be experienced in transferring tapes from one machine to another. We recommend the use of a recorder with an input and output dedicated to external connection to an amplifier as opposed to the microphone and external loudspeaker connections on the cheaper recorders. These types usually have a 3 or 5 pin circular DIN connector which is wired as shown above. The input and output recorder levels as supplied are both 300 mV r.m.s. The output may be adjusted by changing R3 and input by changing R12 on the keyboard. The output should be adjusted so that the tones play back at a comfortable audio volume without excessive distortion. The input is then adjusted for reliable operation or using an oscilloscope, to give a waveform at pin 7 of IC 7 which is in excess of 2 volts peak to peak but is not being clipped. 5-2 Visual Display Unit The VDU interface drives a raster scanned cathode ray tube display device e.g. a monitor or a television. The format is 40 characters on 25 lines with teletext colour graphics. The standard output is a 1 volt/75 ohm composite video signal available on pin 15 on the front of the V.D.U. card with a 0 volt return on pin 14. A 75 ohm coaxial cable connected to this will drive a monitor directly. Also this signal may be used to drive a UHF modulator as shown below giving an interface to a standard television. [ Picture removed from ASCII version ] Using the composite video output the different colours available from the VDU card will appear as different shades of grey, even on a colour monitor or television. To obtain a colour display the Red, Green and Blue drive signals from the card together with the required synchronising signals must be fed to either a TTL level input colour monitor or a colour encoder/UHF modulator system. Note that if a BNC connector is mounted on an optional front panel for the video output the body of the connector i.e. 0v should be insulated from the panel. After switching on and entering the COS R3 on the VDU card is adjusted to give stable characters of the correct width on the screen. 5-3 Chapter 6 - Cassette Operating System This is a 2K byte program resident in ROM on the 6502 CPU card. It provides support for other programs e.g. a BASIC interpreter by dealing with peripheral devices and allowing programs to be filed on cassette tapes. It is specifically written for the system 2 and it interfaces to the teletext Visual Display Unit interface, a parallel ASCII keyboard and a Centronics parallel printer. To start system 2 enter the COS by pressing the reset button (Break) on the keyboard. If the system is working the COS will display on the VDU: Acorn Cos * The star is the COS prompt indicating that it is waiting for the user to type in a command. To the right of it is the flashing cursor at which the characters typed are displayed. Commands must be typed in capital letters only and many keyboards feature a Capital Lock button so that the alphabetic keys always produce an upper case output whilst the numeric and symbolic keys continue to work in shifted or un-shifted mode as usual. On typing a character the VDU will display that character and advance the cursor along one position to the right. Another character may then be entered. Should a character be typed in error it may be corrected by pressing the delete (back space or rub out) key in which case the character to the left of the cursor is erased and the cursor moved back to that position. If desired the whole line may be thrown away by entering control X ie. pressing the control key and X together. A new cursor is displayed and a new line of text can then be entered. After typing a word or some words separated by spaces the displayed text may be entered to the COS by typing return. If the text is not a command recognised by the COS it will respond with Com? * The user may then type in more text. If the COS recognises the command but it is not presented in the correct way i.e. its syntax is wrong the display will show Syn? * 6-1 The COS recognises the following commands any of which may be abbreviated by entering enough of the characters to distinguish it from any other command followed by a full stop. Spaces are used to separate the arguments, unless otherwise stated leading zeroes are not required. The commands are listed giving the command, its full name and its shortest possible abbreviation: BASIC Enter BASIC This command causes execution of the Acorn BASIC interpreter if it is present. Refer to the BASIC manual for explanation of how to use it. If BASIC is not present either in ROM or RAM then the system crashes and must be re-set. LOAD Load from Tape L. The syntax of this command is as follows: LOAD "FILNAME" SSSS The name of the file to be loaded is inside double quotes and may be up to sixteen characters long. Files are normally loaded to where they were originally saved from. The optional four digit hexadecimal address allows relocation to a new section of memory starting at the address specified. On pressing RETURN the COS will respond with Play drive 0 The user should now start the cassette recorder in play mode at the desired position on the tape and press the space bar on the keyboard to indicate to the COS that this has been done. The COS will display the names of any files that are on the tape between the starting position and the file that it is searching for. When the file to be loaded is found it is loaded and the COS will then display the * prompt indicating that the loading process is complete and that the recorder may now be stopped and that new commands may now be entered. Files are stored as a number of 256 byte blocks each of which is identified on the tape. If the file to be loaded is part way past the tape heads this is detected at the start of the next block. Loading ceases and the COS displays Rewind drive 0 6-2 The user should then stop the tape, rewind it and then press the space bar to which the COS will respond with Play drive 0 The loading process should then be repeated. One error message may be produced Sum? This indicates that the checksum has failed at the end of a block i.e. a byte or some bytes have not loaded correctly. The * prompt is displayed and the user may rewind the tape and try to re-load if desired. The loading operation may be aborted by pressing the space key. When the COS reaches the end of the block it is loading, loading ceases and the * prompt appears. SAVE Save on Tape S. The syntax of this command is as follows: SAVE "FILNAME" SSSS EEEE XXXX The name that the file is to be saved under is inside double quotes and may be up to sixteen characters long. This must be followed by two hexadecimal addresses, the start address and the end address plus one of the section of memory to be saved. The optional third address specifies where execution is passed to after loading the file back using the RUN command. On pressing return the COS will respond with Record drive 0 The user should now start the cassette recorder in record mode at the desired position on the tape and press the space bar on the keyboard to indicate to the COS that this has been done. After the COS has finished outputting to the tape it will respond with the * command and the recorder may then be stopped. The escape does not allow the save sequence to be aborted. Tapes may be created in the system 1 format by omitting the filename, the third address has no significance in this case SAVE SSSS EEEE 6-3 (missing pages) RUN Load and execute a file from Tape R. The syntax of this command is as follows: RUN "FILENAME" SSSS The function is exactly as for LOAD, but on completion of loading execution is transferred to the execution address specified when the file was created. The optional start address SSSS may be used to relocate the file. The execution address is not affected by relocation. GO Enter code G. The syntax of this command is GO XXXX When entered program execution is transferred to the address specified which is obligatory. DRIVE Drive select D. The syntax of this command is DRIVE N where N is 0, 1, 2 or 3. This command is included to maintain compatibility with more advanced operating systems and has no effect in the COS except to change the number printed on the screen which is initially set to 0. 6-4 MON Messages on MO. When entered this command allows messages from the COS to appear in the output stream to the VDU and printer. This is the usual condition after reset. Possible messages are: Rewind drive N Play drive N Record drive N NOMON Messages off N. This command turns off the messages enabling the VDU contents to be preserved and stopping unwanted printouts. CAT Catalogue . This command allows the display of information about the files on a cassette tape. When entered it will respond with Play drive 0 and after starting the recorder in play mode and pressing the space bar the following display format is produced FILENAME SSSS XXXX BBBB CC This is produced every time the COS enounters the start of a block. SSSS is the start address of the block. XXXX is the execution address of the file as used by RUN. BBBB is the block number, blocks are numbered in a file starting at zero. CC is the number of valid bytes in the block, minus one. All these are, of course, in hexadecimal. When a system 1 file is encountered the display is SSSS EEEE Here SSSS is the start address and EEEE the end address plus one of the file as used in SAVE. To stop the flow of information press the space bar and stop the recorder. 6-5 FLOAD Finish loading F. The syntax of this command is FLOAD "FILNAME" SSSS The normal LOAD demands that files are loaded from the start of the first block and will request that the tape is re-wound if started in the middle of the file. FLOAD allows loading to commence from the start of any block in the file. The optional hexadecimal address SSSS specifies the memory address to which the start of the first block is loaded if relocation is required. This is useful after a checksum error has been encountered. The tape may be stopped and re-wound to any point prior to the block which produced the error. FLOAD is then used to allow loading to continue and the block identifiers will ensure that blocks are loaded in the correct place. However if the file was being relocated the block identifiers do not specify the correct memory address for that block. In this case CAT can be used to find out which block is next on the tape. Knowing how many 256 byte blocks have been loaded the optional start address for the next block can be calculated and entered in the FLOAD command. USE Use qualifier U. The syntax of this command is USEQ This command is included to maintain compatibility with other operating systems and has no effect at all in the COS. Note that the syntax demands that there is no space between USE and the specified qualifier which may be any ASCII character. MEM Memory examine/edit M. The syntax of this command is MEM XXXX On pressing return the display will show the address followed by its contents in hexadecimal. If the specified address is in RAM new hexadecimal data may be entered or the return key may be used to obtain a * prompt. Also after MEM either U or V may be entered which increment or decrement the address being examined. In this way machine code programs such as the cassette test may be entered and then executed using the GO command. 6-6 Chapter 7 - COS Control Characters and Screen Editor Five keys on the ASCII keyboard allow cursor movement and editing anywhere on the VDU screen. These are: Control A - cursor left Control S - cursor right Control W - cursor up Control Z - cursor down Control Q - read character Pressing the control key and the A, S, W or Z keys move the cursor around the screen but do not send any new characters down the input channel. Once the cursor is positioned over the desired character, this character may be sent down the input channel using control Q, the cursor is then moved one space to the right automatically. For example, suppose it is required to edit a BASIC line: >LIST 10 REM EXAMPLE 20 FOR I = 0 TO 50 30 PRINT "ORANGES AND LEMONS" 40 NEXT I 50 END > After listing the program the screen is as above with the cursor at the bottom following the BASIC prompt. First move the cursor to the start of the line to be edited using control A, S, W and Z: >LIST 10 REM EXAMPLE 20 FOR I = 0 TO 60 30 PRINT "ORANGES AND LEMONS" 40 NEXT I 50 END Now use control Q to re-enter the line number and first part of line 30: >LIST 10 20 30 PRINT "ORANGES AND LEMONS" 40 50 7-1 Next the new output required is typed: >LIST 10 20 30 PRINT "APPLE OR PLUM"MONS" 40 50 And as no more of the old line is required the return key is now pressed and the program may be listed again. Printer and Screen Control The following ASCII control characters affect the VDU screen when they are output. They are listed together with their keyboard key and decimal value. The operating system also provides for a printer which may be connected using an extra interface card. Control characters for this printer stream are also listed: STX (ctrl B, 2) Start Printer This starts the printer output stream but is not sent out to the printer. It also sets alphanumerics green on the VDU. ETX (ctrl C, 3) End Printer This ends printer output stream. It also sets alphanumerics yellow on the VDU. ACK (ctrl F, 6) Start Screen This starts the output stream to the VDU screen, which is the normal condition initially set by the COS. BS (ctrl H, 8) Back Space This moves the cursor back one character position. HT (ctrl I, 9) Horizontal Tab This moves the cursor forward one character position. LF (ctrl J, 10) Line Feed This moves the cursor down one character position. VT (ctrl K, 11) Vertical Tab This moves the cursor up one character position. 7-2 FF (ctrl L, 12) Form Feed This clears the screen and moves the cursor to the top left hand corner. CR (ctrl M, 13) Carriage Return This moves the cursor to the start of the current line. NAK (ctrl U, 21) End Screen This ends the output stream to the VDU. RS (ctrl ^, 30) Home Cursor This moves the cursor to the top left hand corner of the screen. DEL (DEL, 127) Delete This backspaces the cursor and deletes the character at that position. Printers connected to the system printer port will often respond to other control characters in the output stream so refer to the relevant printer manual. Note that some of these other control characters may produce a response on the VDU if its output stream is enabled. Because some printers will initiate the printing of a line in response to either a carriage return or a line feed character in the output stream the operating system prevents the character specified by location 254 in zero page from reaching the printer. This character is initialised on reset to be a line feed but it may be changed by altering the contents of location 254. Thus it is possible to stop any one character from being printed but note that if neither line feed nor carriage return are specified some printers will do a double line feed after printing. 7-3 Chapter 8 - Teletext Visual Display Unit The teletext standard VDU in the system produces coloured alphanumerics and graphics as well as some other features in response to some control codes. These codes are listed in decimal as follows: 129 Red alphanumerics 145 Red Graphics 130 Green " 146 Green " 131 Yellow " 147 Yellow " 132 Blue " 148 Blue " 133 Magenta " 149 Magenta " 134 Cyan " 150 Cyan " 135 White " 151 White " 136 Flash 152 Conceal display 137 Steady 153 Contiguous Graphics 138 End Box 154 Separated Graphics 139 Start Box 140 Normal Height 156 Black background 141 Double Height 157 New background 158 Hold graphics 159 Release graphics These characters affect the characters displayed to the right of them on a line, and provide the following options:- ALPHA (COLOUR) causes following characters on the line to be in the colour specified. GRAPHICS (COLOUR) In Graphics mode each character space displayed is divided into 6 cells. Each cell is illuminated, in the specified colour, if a corresponding binary bit in the code stored at that location is set. The bit assignments are: +----+----+ | b0 | b1 | +----+----+ | b2 | b3 | +----+----+ | b4 | b6 | +----+----+ Bit 5 in the byte is always set for a graphics character, if bit 5 is clear then the upper case alphabet and characters @ <- 1/2 -> ^ # are available in the same colour. 8-1 FLASH causes the following characters on the line to flash. STEADY terminates the flash option on a line END BOX & Are options for using the circuit to superimpose START BOX text onto a normal TV picture. DOUBLE HEIGHT Must appear on two consecutive lines followed by the same characters in which case the characters fill the two lines specified. NORMAL HEIGHT Clears the double height option on a line. CONCEAL DISPLAY Switches off the characters on a line. These can only be revealed by applying a signal to the character generator chip (or deleting the CONCEAL character). CONTIGUOUS GRAPHICS In this mode the graphics cells in a character are joined up. SEPARATED GRAPHICS In this mode the graphics cells are separated by one character bit width. NEW BACKGROUND Sets the background to the colour of the last colour specifying character. BLACK BACKGROUND Resets the back ground colour to black. HOLD GRAPHICS Causes the last graphics character to be displayed when a control character is entered. RELEASE GRAPHICS Causes a space (Background colour) to be displayed when a control character is entered. The character generator assumes an initial setting at the start of each line of: ALPHA WHITE, STEADY, END BOX, NORMAL HEIGHT, CONTIGUOUS GRAPHICS, BLACK BACKGROUND, RELEASE GRAPHICS. 8-2 The characters produced by the VDU and their decimal codes are tabulated here: 32 space 64 @ 96 _ 33 ! 65 A 97 a 34 " 66 B 98 b 35 £ 67 C 99 c 36 $ 68 D 100 d 37 % 69 E 101 e 38 & 70 F 102 f 39 ' 71 G 103 g 40 ( 72 H 104 h 41 ) 73 I 105 i 42 * 74 J 106 j 43 + 75 K 107 k 44 , 76 L 108 l 45 - 77 M 109 m 46 . 78 N 110 n 47 / 79 0 111 0 48 0 80 P 112 p 44 1 81 Q 113 q 50 2 82 R 114 r 51 3 83 S 115 s 52 4 84 T 116 t 53 5 85 U 117 u 54 6 86 V 118 v 55 7 87 W 119 w 56 8 88 X 120 x 57 9 89 Y 121 y 58 : 90 Z 122 z 59 ; 91 <- 123 1/4 60 < 92 1/2 124 | 61 = 93 -> 125 3/4 62 > 94 ^ 126 ~ 63 ? 95 # ! " £ $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : + < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ? ½ ? ? # — a b c d e f g h I j k l m n o p q r s t u v w x y z ¼ ? ¾ ÷ 8-3 Chapter 9 - OS Software Specification OSCLI Command line interpreter This subroutine interprets a string of characters at address #0100 and terminated by carriage return as an operating system command. Detected errors are met with a BRK. All processor registers are used, and the decimal-mode flag is set to binary on exit. OSWRCH Write character This subroutine sends the byte in the accumulator to the output channel. All registers are preserved. OSCRLF Carriage return -- line feed This subroutine generates a line feed followed by a carriage return using OSWRCH. On exit A will contain #0D, N and Z will be 0, and all other registers are preserved. OSECHO Read character with echo This subroutine reads a byte using OSRDCH and then writes it out using OSWRCH. The routine converts carriage returns to a line feed followed by a carriage return. On exit A will contain the byte read, N, Z, and C are undefined, and all other registers are preserved. OSRDCH Read character This subroutine reads a byte from the input channel and returns it in A. The state of N, Z, and C is undefined; all other reqisters are preserved. OSLOAD Load file This subroutine loads a complete file into a specified area of memory. On entry X must point to the following data in zero page: X+0 address of string of characters, terminated by #0D, which is the file name. X+2 Address in memory of the first byte of the destination. X+4 Flag byte: if bit 7 = 0 use the file's start address. All processor registers are used. A break will occur if the file cannot be found. In interrupt or DMA driven systems a wait until completion will be performed if the carry flag was set on entry. 9-1 OSSAVE Save file This subroutine saves all of an area of memory to a specified file. On entry X must point to the following data in zero page: X+0 Address of string of characters, terminated by #0D, which is the file name. X+2 Address for data to be reloaded to. X+4 Execution address if data is to be executed X+6 Start address of data in memory X+8 End address + 1 of data in memory The data is copied by the operating system without being altered. All registers are used. In interrupt or DMA driven operating systems a wait until completion will be performed if the carry flag was set on entry. A break will occur if no storage space large enough can be found. OSBPUT Put byte This subroutine outputs the byte in the accumulator to a sequential write file. Registers X and Y are saved. OSBGET Get byte The subroutine returns, in A, the next byte from a sequential read file. Registers X and Y are retained. OSFIND Find file This subroutine returns, in A, a 'handle' for a file. The X register points to zero page locations containing the address of the first character of the file name; the file name is terminated by a #0D byte. The 'handle' is zero if the file does not exist; otherwise it is a byte uniquely specifying the file. If the file is to be used for sequential input the carry should be set, or if for sequential output the carry should be clear. OSSHUT Shut file This subroutine removes a reference to a file whose handle is in the Y register. If a handle of zero is supplied, all files are shut. In the COS the call does nothing. OSSTAR Set file arguments This routine sets the value of a file's pointer. On entry, the X Register points to Zero Page locations containing the value and the Y Register contains the file handle. The X and Y Register contents are not lost. 9-2 OSRDAR Read file arguments This subroutine returns the value of a random file's arguments. On entry, the X Register points to locations in Zero Page where the result is to be stored, and the Y Register contains the file handle, and the A register specifies the argument, where: A=0 : the file's sequential pointer in bytes A=1 : the extent (length) of the file A=2 : the region of the file The data, typically 3 bytes is placed at X, X+1, X+2. The X and Y Register contents are retained. The following table gives the addresses of all the operating system calls: Address: Subroutine: Instruction: #FFCB OSSHUT JMP (SHTVEC) #FFCE OSFIND JMP (FNDVEC) #FFD1 OSBPUT JMP (BPTVEC) #FFD4 OSBGET JMP (BGTVEC) #FFD7 OSSTAR JMP (STRVEC) #FFDA OSRDAR JMP (RDRVEC) #FFDD OSSAVE JMP (SAVVEC) #FFED OSLOAD JMP (LODVEC) #FFE3 OSRDCH JMP (RDCVEC) #FFE6 OSECHO JSR OSRDCH #FFE9 OSASCI CMP @#0D #FFEB BNE OSWRCH #FFED OSCRLF LDA @#0A #FFEF JSR OSWRCH #FFF2 LDA @#0D #FFF4 OSWRCH JMP (WRCVEC) #FFF7 OSCLI JMP (COMVEC) The operating system calls are all indirected via addresses held in RAM, and these addresses may be changed to the addresses of user-supplied routines. The addresses are initialised on reset as follows: Address: Subroutine: Function: #0200 NMIVEC NMI service routine #0202 BRKVEC BRK service routine #0204 IRQVEC IRQ service routine #0206 COMVEC Command line interpreter #0208 WRCVEC Write character #020A RDCVEC Read character #020C LODVEC Load file #020E SAVVEC Save file #0210 RDRVEC Read file arguments #0212 STRVEC Set file arguments #0214 BGTVEC Get byte from file #0216 BPTVEC Put byte to file #0218 FNDVEC Open file #021A SHTVEC Shut file 9-3 The following subroutines are not used in the COS, and cause an error if called: OSRDAR Read file's arguments OSSTAR Store file's arguments Interrupts The following action is taken on interrupts: NMI PHA JMP (NMIVEC) IRQ/BRQ STA #FF PLA PHA AND @#10 which interrupt was it BNE BRK LDA #FF PHA JMP (IRQVEC) BRK LDA #FF PLP PHP JMP (BRKVEC) Note that the accumulator is pushed before the jump occurs. Block Zero RAM Locations #00 - #9F 0 – 159 Used by BASIC or user code #B0 - #FF 176 - 255 Cassette system workspace #FE 254 Character not sent to printer #100 - #13F 256 - 319 Input line buffer #140 - #17F 320 - 383 String processing & INPUT statement buffer #180 - #1FF 384 - 511 Stack #200 - #21F 512 - 539 Operating system vectors and workspace #220 - #2FF 576 - 1023 Used by BASIC or user code 9-4 Chapter 10 - Circuit Diagrams & Descriptions Chapter 11 - System Expansion