Within this publication the term  'BBC'  is used as an abbreviation
for. British Broadcasting Corporation'.

© Copyright ACORN Computers Limited 1985

Neither the whole or any part of the information contained in, or
the product described  in, this manual may be adapted or reproduced
in any material form  except  with  the  prior  written approval of
ACORN Computers Limited (ACORN Computers).

The product described in  this manual and products for use with it,
are  subject  to  continuous  development   and  improvement.   All
information of a technical nature  and  particulars  of the product
and its use ( including the information and particulars in this
manual) are given by ACORN Computers in good faith. However, it is
acknowledged that there may be errors or omissions in this manual.
A list of details of any amendments or revisions to this manual can
be obtained upon request from  ACORN Computers Technical Enquiries.
ACORN Computers welcome comments and suggestions relating to the
product and this manual.

All correspondence should be addressed to:-

Technical Enquiries
ACORN Computers Limited
Newmarket Road
Cambridge
CB5 8PD

All maintenance and  service  on the product must be carried out by
ACORN Computers' authorised dealers.  ACORN Computers can accept no
liability whatsoever for any loss  or  damage  caused by service or
maintenance by unauthorised personnel. This manual is intended
only to assist the reader in the use of this product, and therefore
ACORN  Computers  shall  not be  liable  for  any  loss  or  damage
whatsoever arising from the  use  of any information or particulars
in, or any error or omission  in, this manual, or any incorrect use
of the product.

This manual is for the sole use of ACORN Computers' authorised
dealers and  must  only  be  used  by  them  in connection with the
product  described  within.

ACORN is a trade mark of ACORN Computers Limited

First published 1985
Published by ACORN Computers Limited
Cover design concept by Carrods Graphic Design

65C102 co-processor user guide

Part No. 0043,030
Issue No.2
April 1986

CONTENTS

Section						Page

INTRODUCTION 					3
Dismantling the microcomputer 			5
Installing the co-processor printed circuit board	5
SYSTEM MEMORY 					9
The 65Cl02 co-processor support disc 		11

INTRODUCTION

What is a co-processor

The job of the co-processor  is  to  run  languages  such as BASIC,
assembly language. word processing, and to run user programs. The
TUBE handles the two-way communication between the microcomputer
and  the  co-processor thereby leaving the  microcomputer  and  the
co-processor to continue with their respective tasks.

with the co-processor fitted, the  job  of  the microcomputer is to
serve as an I/O processor, that is, to  handle  all  the inputs and
outputs  (keyboard,  RS423,  text  and graphics output to monitors,
printer output, disc drives, cassette recorders, local area network
and so on).

This co-processor consists of a  65Cl02  microprocessor system with
64 Kbytes of Random Access Memory (RAM).  In  addition, it contains
an interface between itself and the microcomputer called the TUBE.

From this point on the microcomputer will be referred to as the
I/O processor.

Fitting a co-processor

Note  that  any  modification or upgrade carried out to the printed
circuit board of any Acorn equipment is undertaken at the sole risk
of the person carrying out the modification or upgrade. No claim
for loss or damage to the equipment caused by the modification or
upgrade of the printed circuit board by unqualified personnel shall
be accepted by Acorn Computers limited.

WARNING - A number of the components used within ACORN equipment
are  STATIC  SENSITIVE. All  usual anti-static precautions must be
taken to prevent damage to these devices.

Before attempting this upgrade, please  read  all  the instructions
carefully. If you are in doubt about your  ability to carry it out,
the  co-processor  and  the  microcomputer  should be taken to your
nearest authorised Acorn dealer.

A  charge   may   be  levied  by  the  dealer  for  installing  the
co-processor; such  a charge shall be entirely at the discretion of
the dealer concerned.

Dismantling the microcomputer

Before  attempting  to  fit the co-processor to your machine, first
ensure that the unit is  disconnected  from the mains power supply.

The upper half of the case must be removed from  the  unit to allow
access    to    the  main printed circuit board, To do this, turn the
computer upside down  and  place it on a firm, flat surface; locate
and remove the four fixing  screws  that hold the upper half of the
case in place. These screws are located  on  the  underside  of the
unit, two at the rear and two at the front of  the machine, and are
labelled  'FIX'.  Please  note that the two fixing screws fitted to
the rear fixing positions are longer than the other two.

When the fixing screws  have  been removed, carefully re-invert the
computer whilst holding the two halves  of  the  case together. The
upper half of the case  may  now  be removed by lifting it directly
upwards from the machine.

Installing the co-processor printed circuit board

Included  in  the  co-processor upgrade kit are a number of plastic
printed circuit board support  posts.  These  must be fitted to the
main  printed  circuit  board  before  installing  the co-processor
board.

The positions at which these  posts  are  to be fitted are shown in
figure 1. The posts should be fitted to  the positions in numerical
order.   The  first  four  positions are common to all co-processor
options, with  positions  five  and  six  only  in use with certain
co-processors.   When  fitting  the P.C.B supports, ensure that the
base flange does not  interfere with any component on the P.C.B. To
fit the support, insert one  end  into  the  hole  in the P.C.B and
press down gently.

When  the support is correctly fitted, it will not  be  possible to
withdraw  it  from  the  hole  in the P.C.B. Care must therefore be
taken to ensure the correct positioning of the P.C.B support before
pressing it home.

When all the  P.C.B  supports  are installed on the main P.C.B, the
co-processor should be placed in position ensuring that:

1.  The  pins of PLl on  the  co-processor  are  aligned  with   the
corresponding holes in SK1 on the main P.C.B.

2. The pins  of  PL2  on  the  co-processor  are  aligned  with the
corresponding holes in SK2 on the main P.C.B.

3.  The  P.C.B supports are aligned with the corresponding holes on
the co-processor P.C.B.

When you are satisfied that all the pins and supports are correctly
aligned, the  co-processor  P.C.B may be pressed gently into place.
The co-processor is correctly  seated  when the barbs on the tip of
the P.C.B supports have cleared the  surface  of  the  co-processor

P.C.B. An  audible click should be heard when the barbs spring into
place securing the P.C.B.

Take care  not  to  exert  too much pressure when pressing home the
co-processor  P.C.B,  this  may  lead  to  damage  to  the  various
connectors.

When the co-processor  P.C.B  has  been  installed, the re-assembly
procedure is the reverse of the dismantling procedure.

When the 65C102 co-processor has been installed, the machine should
be set up as described  in  the  WELCOME GUIDE. When the machine IS
switched on a message, similar to the following,  should  appear on
the screen.

ACORN MOS
ACORN ADFS
BASIC
>_

As can be seen from the above message, the 65C102 co-processor does
not appear to be present.  The  reason for the apparent absence of
the co-processor is the CONFIGURATION status of the machine.

To reconfigure the machine to allow for the inclusion of the 65Cl02
you must use either a  *CONFIGURE  command,  or  the  control panel
included  with  the  WELCOME package. To use the *CONFIGURE command
you should enter:

*CONFIGURE TUBE <RETURN>
followed by
*CONFIGURE INTUBE <RETURN>

after entering these two commands  you must perform a hard reset by
holding down the CTRL key whilst  pressing  and releasing the BREAK
key. This reset is needed to enable the  I/O processor to recognise
the presence of the co-processor.

After performing the reset, the following message, or something
similar, should be displayed:

ACORN TUBE 65C102 CO-PROCESSOR
ACORN ADFS
BASIC
>_

The  top  line of the  display  shows  that  the  TUBE  and  65C102
co-processor are now  recognised  by the machine. If the message on
your  machine  does  not  indicate   the  presence  of  the  65C102
co-processor then first use the *STATUS command to determine
whether the TUBE is  correctly  configured,  and  assuming that the
configuration is correct, refer to the earlier part  of this section
to check that the upgrade has been carried out correctly.

If  neither  of  these courses of action uncover the cause  of  the
problem, the complete machine should be taken to your nearest Acorn
registered dealer for testing and, if necessary, repair.

 The *CONFIGURE command

The *CONFIGURE command may  be  used to enable and disable the TUBE
communications. It may also be used to select between internal and
external  TUBE  communication. To  enable  or  disable   the  TUBE
communication, *CONFIGURE with TUBE or NOTUBE respectively may be
used.

To allow you to add an external co-processor, sometimes referred to
as a second processor, you may switch from  using the internal TUBE
to the external TUBE. This is also carried out using the *CONFIGURE
command, this time with INTUBE and EXTUBE respectively.

For further information on the *CONFIGURE command see the REFERENCE
MANUAL Part 1.

SYSTEM MEMORY

The following information explains the  way  in which the memory of
both the 1/O processor and the co-processor  are  configured. It is
only intended as a general introduction to the memory  usage of the
two processors. For a more full explanation of the way in which the
memory is configured please refer to the REFERENCE MANUAL.

Please note that whilst a  general  understanding  of  the systems'
memory configuration may be of use, it is by no means essential.

Figure 2 shows the memory  map  for  the  I/O  processor when it is
working with the 65Cl02 co-processor.

DISTINGUISHING BETWEEN MEMORIES

You  will have noticed from  the  memory  map  that  both  the  I/O
processor and  the  co-processor  are numbered from &0000 to &FFFF.
With the co-processor working, the various filing systems must have
a way of distinguishing between  the  two memories in order to SAVE
or LOAD programs into the correct place.  This  is done by defining
the co-processor memory as running from &0000 to &FFFF, and the I/O
processor memory from &FFFF0000 to &FFFFFFFF.

For example, memory   location  &C000 resides, by definition, in the
co-processor:   memory   location  &FFFFC000  resides    in    the  I/O
processor.

Suppose  you  run  a machine-code  program  which  resides  in  the
co processor from memory location  &6000  to  &6500.  This  program
draws  a pretty picture on the screen in MODE 1, and you would like
to save both the program and the resulting picture onto disc.

To save the program onto disc, you would type:

*SAVE GRAFPRG 6000 6500 <RETURN>

where GRAFPRG   is the filename you have chosen. To load and run the

program from disc, you would type:

*RUN GRAFPRG <RETURN>

The program would  be loaded back into the co-processor rather than
the I/o processor (no  leading  'FFFFs'  in the load address and end
address), and would run.

To save the resulting picture onto  disc,  you  would  have to save
the  screen  memory  used  in  MODE  1,  this  resides in  the  I/O
processor.

MODE 1 screen memory starts at &FFFF30O0 and ends  at &FFFF7FFF (i.e.
memory locations &3000 to &7FFF in the I/O processor). To  save the
resulting picture, you would type:

*SAVE PICTURE FFFF3000+5000 <RETURN>

where  PICTURE  is  the filename you have chosen. If you now reload
this by typing:

*LOAD PICTURE <RETURN>

the file PICTURE will be loaded into the I/O processor, and as long
as you are already in MODE 1, the picture will reappear. (From this
you can probably deduce  why some programs that directly access the
screen will not work with the co-processor.)

Note: It is not possible  to  save  a shadow screen in this way. To
save or load a shadow screen you must make use of either the OSWORD
calls &5 and &6, or the *FXl14 command to 'switch' SHADOW RAM into
the  main  memory map. For further information, please refer to the
REFERENCE GUIDE.

You may have noticed that when  you execute a *INFO on a disc file,
addresses are preceded by either  00  or  FF,   rather than 0000 and
FFFF. For example typing:

*INFO PICTURE <RETURN>

might display
$.PICTURE    FF3000 FF3000 FF4FFF 07A

and typing
*INFO GRAFPRG <RETURN>
might display
$. GRAFPRG    006000 006000 000500 05B

The  disc  filing  system ignores the two most significant bytes of
the addressing,  the cassette   filing system displays the addressing
in full.
IMPORTANT:  It is only the  filing  systems  that  recognise  these
'extended' addresses. Current versions of BASIC an HI-BASIC make no
such distinction.  Only  the  memory  in  the  co-processor  can be
directly accessed from BASIC. This means that using the  ?,!  and $
indirection  operators  to  access  memory  locations  in  the  I/O
processor from the co-processor doesn't work, for example:

?&FFFF2000=&55 <RETURN>

will  put  the  value  &55  into  memory   location  &2000  in  the
co-processor  and  not into the location &2000 in the I/O processor
as specified by the leading FFFFs.

The same applies  to saving and loading BASIC programs. If you save
a  BASIC  program  to disc  or  cassette   from  the  microcomputer,
executing a *INFO will display addresses with leading FFs. Saving a
BASIC program from the  co-processor  and  executing  a  *INFO will
display addresses with leading 00s. However, BASIC will always load
either program into whichever processor is currently running BASIC.

It is possible to read  and  write  to  memory locations in the I/O
processor memory, this is done using OSWORD calls 5  and  6. OSWORD
calls   are   dealt  with  in  the REFERENCE MANUAL Part  1. A more
advanced description of  TUBE communication techniques is contained
within the ADVANCED REFERENCE MANUAL.

The 65C102 co-processor support disc

The disc supplied with the  65C102  contains  3 pieces of software,
these are:

HiBASIC
HiEDIT
Printer buffer utility

Hi languages

HiBASIC and HiEDIT are the  same   languages BASIC and EDIT that are
already  resident  in  your  machine.  They only  differ  from  the
inherent versions in the position that they expect to occupy within
the memory map.

If  we consider the memory  map  of  the  microcomputer  without  a
co-processor  attached  (fig.2), we can  see  that  BASIC  normally
resides between &8000  and  &BFFF. If BASIC were allowed to do this
within the co-processor,  it would substantially reduce the amount of
RAM  available  to  the users  programs.  HiBASIC  is  supplied  to
overcome this situation,  it  does  so  by   locating  itself between
addresses  &B800 and &F7FF in the co-processor thereby allowing the
user to  maximise  the RAM available. HiEDIT,  in this respect, acts
in exactly the same way as HiBASIC.

To use either HiBASIC or HiEDIT,  insert  the 65Cl02 support disc
into the disc drive and enter:

*HiBASIC <RETURN>

(or)

*HiEDIT <RETURN>

depending on the language you wish to use.

Printer buffer utility

On the 65Cl02 Support Disc, along with HiBASIC and HiEDIT, you will
find a file called BUFFER.

A buffer is an area of RAM that  is used as a 'holding area' for
data that is in transit between the microcomputer and an external
device. The RAM may be part of either the microcomputer, or the
external device, and is part of the communications pathway through
which the two devices communicate.

The size of a particular buffer can make a considerable difference
to the speed and efficiency of a given data transfer. In the case
of the microcomputers' printer buffer, there is a 256 byte area of
RAM allocated to this purpase. This means that as  soon as the
microcomputer has transmitted 256 bytes of data mare than the
printer has accepted,  the buffer will became full,  and  the
microcamputer will be forced ta wait until more space becomes
available in the printer buffer.

The length of time the computer, and therefore the operator, spends
waiting is dependant upon three things:

a) The speed at which the printer can print
b) The size of the recieve buffer contained within the printer
c) The size af the transmit buffer in the microcomputer

Both a) and b) are determined by the design of the printer and are
not easily changed; the size of  the default printer buffer in the
microcomputer is also fixed. It  is however possible to re-allocate
the area af the microcomputers' memory  to be used as a printer
buffer; this is the function of the printer buffer utility.

This utility provides you with an approximately 24 Kbyte buffer in
the I/O processor for use with your currently selected printer.
This  dramatic increase in buffer size means that the computer will
not have to wait  for the printer unless the data to be printed
exceeds 24 Kbytes. In the instance of a text file, this may be
considered  to be roughly  equivalent to 24 A4 pages of text,
sufficient to hold the entire textual content of this manual with
room to spare!

This buffer uses RAM in  the  I/o processor between &4000 and &8000
and should not be used where your own application makes use of this
area of I/O memory. Since the area  of  memory  used by the printer
buffer utility is the same  as  that  available  to the user when a
co-processor is not in use;  this  utility  may  only  be  used  in
conjunction with a co-processor.

To make use of the printer buffer utility, you should enter:

*BUFFER

It is important to realise  that,  whilst  you are able to continue
using  a  word  processor,  or  other  language  resident   in  the
co-processor, it is not possible to make use of the main RAM in the
I/O  processor  whilst  the  printer buffer is in  use.  This  will
preclude the use of a  number  of other utilities such as AFORM and
the Q parameter available with the sideways  RAM  utilities.  Also,
you should realise that a 20 Kbyte text file can take as much as 15
minutes  to  print on a slower printer. The microcomputer should be
neither reset or switched off whilst the printer is still printing.

For further information on the use of printers, please refer to the
WELCOME GUIDE that accompanied the microcomputer.