Home » CEEFAX disks » telesoftware2.adl » BUF\INF

BUF\INF

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » CEEFAX disks » telesoftware2.adl
Filename: BUF\INF
Read OK:
File size: 2CD6 bytes
Load address: 0000
Exec address: 0000
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
                         I/O Printer Buffer  M.J.Rawlings - PAGE : 1






                          I/O PRINTER BUFFER

          Printer  buffers  can be set up anywhere in memory, sideways
ram being the favourite location,  and  there  are  numerous  versions
available.  But if you have no sideways ram or you have already filled
up your sideways ram with utilities you may be wondering how  you  can
set up a printer buffer. This program is the answer, it can be used to
put  a printer buffer anywhere in the I/O memory (the main memory area
for those unfortunates without second processors), it can be as  large
or as small as space allows.

          The  program  as  broadcast is the version I use, it gives a
22.75K buffer and is suitable for a system with second  processor  and
running  a  program  that  uses  mode  7  only, but this can easily be
altered to be compatible with any BBC or  ELECTRON  or  MASTER/COMPACT
setup with or without a second/co processor. Even the smallest printer
buffer  can  make  a  big  difference  to  the waiting time before the
computer is back under your control, although a 2K buffer  (about  one
page  of  loosely spaced text) is probably the minimum practical size.
The code to do all this is 249  bytes  long  and  will  fit  into  any
available page of memory.

                          USING THE PROGRAM

          On  running  the  program the code is automatically saved to
disk or cassette with the correct I/O relocation address regardless of
the addresses chosen. Once the code has been saved the printer  buffer
can be set up simply by pressing <BREAK> then typing:-

                          *PRNTBUF  <RETURN>

          This loads and executes the code to alter the buffer vectors
but  does  not  turn  on  the new printer buffer, any operating system
calls to the buffer vectors are redirected via the new  code  back  to
the old vectors. Two new osbyte calls are then used to turn the buffer
on  or off, *FX128,128 sets up the buffer start addresses and turns on
the printer buffer flag, and *FX128,129 is used to revert to the BBC's
original buffer.





















                         I/O Printer Buffer  M.J.Rawlings - PAGE : 2





          All the usual *FX commands are enabled with the  new  buffer
as well as the ADVAL facility:-
          
          *FX15            Flush all buffers.
          *FX21,3          Flush printer buffer only.
          Osbyte &80 (128) Read ADC channel/get buffer status.
          *FX128,128       Turn on new printer buffer.
          *FX128,129       Turn off new printer buffer.
          *FX138,3,<char>  Insert character into printer buffer.
          Osbyte &91 (145) Remove character from buffer.
          Osbyte &98 (152) Examine buffer status.
          *FX153,3,<char>  Insert character into printer buffer.
          ADVAL(-4)        Returns number of free spaces in printer
                           buffer.
          ESCAPE           Pressing ESCAPE will flush all buffers.
          
Note  that *FX128,128 can also be used to flush the new printer buffer
when in use. Do not try to reset the  printer  buffer  with  a  second
*PRNTBUF  command  as  this  will incorrectly set the vectors and will
cause the computer  to  hang  up.  Pressing  break  will  restore  the
original default vectors.

                          LOCATING THE CODE

          The following addresses are suitable for storing the machine
code, simply change the Code Address (P%).

&900 to &9FF Not for cassette users.
             Not for speech system users.
             Not if sound envelopes 5-16 are in use.
             Not if RS423 port is in use.

&A00 TO &AFF Not for cassette users.
             Not if RS423 port is in use.

&B00 TO &BFF Not if function keys are in use.

&C00 TO &CFF Not if characters 224-255 are redefined.

          Alternatively  the  code  can  be located in the main memory
area before or after the space allocated to the buffer, though a below
PAGE address is safer.

          The program uses 7 bytes of zero page workspace from &78  to
&7E, if this clashes with other utilities or your own program then any
zero page space from &70 to &9F can be used, Econet users should avoid
&90 to &9F and second processor users should avoid &70 to &77.

                     LOCATING THE PRINTER BUFFER

          The  start  and end addresses must be whole page values i.e.
&7800 not &78CD, this is because only the most significant byte of the
address is used to test for the end of the buffer and  to  wrap  round
the read and write addresses back to the start.






                         I/O Printer Buffer  M.J.Rawlings - PAGE : 3






          The  end  address depends purely on the graphics mode in use
and should be at least one page (&100) below the graphics area. If the
code is assembled above the buffer area then P% should be the same  as
the  end  address and at least 2 pages (&200) below the graphics area,
(the program as printed stores the code in this fashion). This  is  to
allow room for the basic stack (basic's temporary storage space).

          Example end addresses:-
          
          Mode0,1,2   &2F00 (&2E00 if code is above buffer)
          Mode3       &3F00 (&3E00 if code is above buffer)
          Mode4,5     &5700 (&5600 if code is above buffer)
          Mode6       &5F00 (&5E00 if code is above buffer)
          Mode7       &7B00 (&7A00 if code is above buffer)
          
          Without  a second processor the start address depends on how
much memory is being used by  your  program.  Variables  used  by  the
program  are  stored  on  the heap (from LOMEM upwards) and the lowest
available address above the  heap  can  be  found  after  running  the
program, by typing:-

          PRINT~!2 AND&FFFF

          To  be  on  the save side set HIMEM and the start address to
the next whole page+1 above this value, this avoids the possibility of
program variables corrupting the buffer. If HIMEM is set in  this  way
then  the  end address can be one page higher than the examples above.
This technique also prevents *COPY, *BACKUP and *COMPACT commands from
corrupting the contents of the  buffer  or  the  code  itself.  Second
processor  users  should, if possible, store the code below page as it
is not possible to reset HIMEM in the I/O processor  from  the  second
processor.  If  the  code does become corrupted then the computer will
hang up as the buffer vectors are constantly in use under the  control
of operating system generated interrupts.

          With a second processor and disk drives connected the lowest
default  start  address  is &1F00 (as printed), this can be lowered to
&1900 after a *FX20 command to implode the  character  definitions.  A
maximum  printer  buffer  size  of 26k is attainable by lowering OSHWM
(operating system high water mark) to &1300 with a  *FX180,19  command
but  this  allows  you  to open only one disk file at a time. Cassette
users should set the start address to &1400 (25.75k buffer)  with  the
character  definitions  exploded or &E00 (27.25k buffer) with imploded
character  definitions.  Naturally  these  address  will  have  to  be
increased  by  one  page  if  you  wish  to locate the code before the
buffer.













                          I/O Printer Buffer  M.J.Rawlings - PAGE : 4





                            ERROR HANDLING

          It is common  practice  to  use  the  BBC's  error  handling
facilites  to return control to a main menu simply by pressing escape,
unfortunately pressing escape will  also  flush  all  buffers  thereby
stopping  printer  output. Two extra bytes of code can be added to the
program to prevent this:-

          320 PLP
          330 RTS

          This alteration also stops *FX15 and *FX21,3  from  flushing
the  printer  buffer  but  does  not affect the normal action of these
commands or ESCAPE on all the other buffers. The printer  buffer  can,
however, still be flushed using *FX128,128.

                        MACHINE CODE ROUTINES

          
          set        Move insert vector from &22A,B to insert1
                     Move remove vector from &22C,D to remove1
                     Move count/purge vector from &22E,F to count1
                     Store insert2 address at &22A,B
                     Store remove2 address at &22C,D
                     Store count2 address at &22E,F
          
          ins2       New insert routine
          
          old1       Divert to original insert routine
          
          rem2       New remove routine
          
          old2       Divert to original remove routine
          
          cnt2       New count/purge routine
          
          flsh       Resets read and write addresses to start
                     sets flag to empty
          
          old3       Divert to old count/purge routine
          
          S          Subroutine to update read and write addresses


















                          I/O Printer Buffer  M.J.Rawlings - PAGE : 5





                              VARIABLES

          
          ins1       Relocated address for old insert vector
          
          rem1       Relocated address for old remove vector
          
          cnt1       Relocated address for old count/purge vector
          
          ins        Address of next free space for insertion
          
          rem        Address of next character to be removed
          
          ext        No of characters still remaining in buffer
          
          f          Indicates state of buffer
                         0 = buffer not in use
                         1 = buffer in use
                         2 = buffer empty
                         3 = buffer full
          
          start      Start address of buffer
          
          end        End address of buffer
          
          init       Address of data for initialising buffer
          
          osc        Address of string used for OSCLI call
          
          sve        Address of string for relocation address
          

                       CUSTOMISING THE PROGRAM

          The  parts of the program that can be customised are clearly
marked with REM statements. The  program  contains  its  own  detailed
tests  which  use  the  buffer in order to test it and will report any
errors found. These tests may overwrite the  program  so  remember  to
save  it  first. Also make sure that your printer is turned off before
running the program. In fact in order  to  avoid  the  possibility  of
saving  a  corrupted  version  of  the  program it is designed to self
destruct after the code has been saved! If  all  is  well  you  should
see:-


               SAVE PRNTBUF 7A00 7AF9 FFFF7A00 FFFF7A00
               
               
               
               Bad program
               >
               
               







                         I/O Printer Buffer  M.J.Rawlings - PAGE : 6





          The  final  test  is, of course, to use the buffer on a long
print run, preferably longer than the buffer size, to confirm  correct
buffer "wrap around".

          Next  week  we will be broadcasting a program that will give
the I/O printer buffer a thorough test:- a program that incorporates a
teletext page storage system capable of storing  up  to  764  teletext
pages  on one disk (depending on type of DFS and drive), together with
instant printout and editing facilities.

00000000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000010  20 20 20 20 20 20 20 20  20 49 2f 4f 20 50 72 69  |         I/O Pri|
00000020  6e 74 65 72 20 42 75 66  66 65 72 20 20 4d 2e 4a  |nter Buffer  M.J|
00000030  2e 52 61 77 6c 69 6e 67  73 20 2d 20 50 41 47 45  |.Rawlings - PAGE|
00000040  20 3a 20 31 0d 0d 0d 0d  0d 0d 0d 20 20 20 20 20  | : 1.......     |
00000050  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000060  20 20 20 20 20 49 2f 4f  20 50 52 49 4e 54 45 52  |     I/O PRINTER|
00000070  20 42 55 46 46 45 52 0d  0d 20 20 20 20 20 20 20  | BUFFER..       |
00000080  20 20 20 50 72 69 6e 74  65 72 20 20 62 75 66 66  |   Printer  buff|
00000090  65 72 73 20 20 63 61 6e  20 62 65 20 73 65 74 20  |ers  can be set |
000000a0  75 70 20 61 6e 79 77 68  65 72 65 20 69 6e 20 6d  |up anywhere in m|
000000b0  65 6d 6f 72 79 2c 20 73  69 64 65 77 61 79 73 0d  |emory, sideways.|
000000c0  72 61 6d 20 62 65 69 6e  67 20 74 68 65 20 66 61  |ram being the fa|
000000d0  76 6f 75 72 69 74 65 20  6c 6f 63 61 74 69 6f 6e  |vourite location|
000000e0  2c 20 20 61 6e 64 20 20  74 68 65 72 65 20 20 61  |,  and  there  a|
000000f0  72 65 20 20 6e 75 6d 65  72 6f 75 73 20 20 76 65  |re  numerous  ve|
00000100  72 73 69 6f 6e 73 0d 61  76 61 69 6c 61 62 6c 65  |rsions.available|
00000110  2e 20 20 42 75 74 20 69  66 20 79 6f 75 20 68 61  |.  But if you ha|
00000120  76 65 20 6e 6f 20 73 69  64 65 77 61 79 73 20 72  |ve no sideways r|
00000130  61 6d 20 6f 72 20 79 6f  75 20 68 61 76 65 20 61  |am or you have a|
00000140  6c 72 65 61 64 79 20 66  69 6c 6c 65 64 0d 75 70  |lready filled.up|
00000150  20 79 6f 75 72 20 73 69  64 65 77 61 79 73 20 72  | your sideways r|
00000160  61 6d 20 77 69 74 68 20  75 74 69 6c 69 74 69 65  |am with utilitie|
00000170  73 20 79 6f 75 20 6d 61  79 20 62 65 20 77 6f 6e  |s you may be won|
00000180  64 65 72 69 6e 67 20 68  6f 77 20 20 79 6f 75 20  |dering how  you |
00000190  20 63 61 6e 0d 73 65 74  20 75 70 20 61 20 70 72  | can.set up a pr|
000001a0  69 6e 74 65 72 20 62 75  66 66 65 72 2e 20 54 68  |inter buffer. Th|
000001b0  69 73 20 70 72 6f 67 72  61 6d 20 69 73 20 74 68  |is program is th|
000001c0  65 20 61 6e 73 77 65 72  2c 20 69 74 20 63 61 6e  |e answer, it can|
000001d0  20 62 65 20 75 73 65 64  20 74 6f 0d 70 75 74 20  | be used to.put |
000001e0  20 61 20 70 72 69 6e 74  65 72 20 62 75 66 66 65  | a printer buffe|
000001f0  72 20 61 6e 79 77 68 65  72 65 20 69 6e 20 74 68  |r anywhere in th|
00000200  65 20 49 2f 4f 20 6d 65  6d 6f 72 79 20 28 74 68  |e I/O memory (th|
00000210  65 20 6d 61 69 6e 20 6d  65 6d 6f 72 79 20 61 72  |e main memory ar|
00000220  65 61 0d 66 6f 72 20 74  68 6f 73 65 20 75 6e 66  |ea.for those unf|
00000230  6f 72 74 75 6e 61 74 65  73 20 77 69 74 68 6f 75  |ortunates withou|
00000240  74 20 73 65 63 6f 6e 64  20 70 72 6f 63 65 73 73  |t second process|
00000250  6f 72 73 29 2c 20 69 74  20 63 61 6e 20 62 65 20  |ors), it can be |
00000260  61 73 20 20 6c 61 72 67  65 0d 6f 72 20 61 73 20  |as  large.or as |
00000270  73 6d 61 6c 6c 20 61 73  20 73 70 61 63 65 20 61  |small as space a|
00000280  6c 6c 6f 77 73 2e 0d 0d  20 20 20 20 20 20 20 20  |llows...        |
00000290  20 20 54 68 65 20 20 70  72 6f 67 72 61 6d 20 20  |  The  program  |
000002a0  61 73 20 20 62 72 6f 61  64 63 61 73 74 20 69 73  |as  broadcast is|
000002b0  20 74 68 65 20 76 65 72  73 69 6f 6e 20 49 20 75  | the version I u|
000002c0  73 65 2c 20 69 74 20 67  69 76 65 73 20 61 0d 32  |se, it gives a.2|
000002d0  32 2e 37 35 4b 20 62 75  66 66 65 72 20 61 6e 64  |2.75K buffer and|
000002e0  20 69 73 20 73 75 69 74  61 62 6c 65 20 66 6f 72  | is suitable for|
000002f0  20 61 20 73 79 73 74 65  6d 20 77 69 74 68 20 73  | a system with s|
00000300  65 63 6f 6e 64 20 20 70  72 6f 63 65 73 73 6f 72  |econd  processor|
00000310  20 20 61 6e 64 0d 72 75  6e 6e 69 6e 67 20 20 61  |  and.running  a|
00000320  20 20 70 72 6f 67 72 61  6d 20 20 74 68 61 74 20  |  program  that |
00000330  20 75 73 65 73 20 20 6d  6f 64 65 20 20 37 20 20  | uses  mode  7  |
00000340  6f 6e 6c 79 2c 20 62 75  74 20 74 68 69 73 20 63  |only, but this c|
00000350  61 6e 20 65 61 73 69 6c  79 20 62 65 0d 61 6c 74  |an easily be.alt|
00000360  65 72 65 64 20 74 6f 20  62 65 20 63 6f 6d 70 61  |ered to be compa|
00000370  74 69 62 6c 65 20 77 69  74 68 20 61 6e 79 20 42  |tible with any B|
00000380  42 43 20 6f 72 20 20 45  4c 45 43 54 52 4f 4e 20  |BC or  ELECTRON |
00000390  20 6f 72 20 20 4d 41 53  54 45 52 2f 43 4f 4d 50  | or  MASTER/COMP|
000003a0  41 43 54 0d 73 65 74 75  70 20 77 69 74 68 20 6f  |ACT.setup with o|
000003b0  72 20 77 69 74 68 6f 75  74 20 61 20 73 65 63 6f  |r without a seco|
000003c0  6e 64 2f 63 6f 20 70 72  6f 63 65 73 73 6f 72 2e  |nd/co processor.|
000003d0  20 45 76 65 6e 20 74 68  65 20 73 6d 61 6c 6c 65  | Even the smalle|
000003e0  73 74 20 70 72 69 6e 74  65 72 0d 62 75 66 66 65  |st printer.buffe|
000003f0  72 20 20 63 61 6e 20 20  6d 61 6b 65 20 20 61 20  |r  can  make  a |
00000400  20 62 69 67 20 20 64 69  66 66 65 72 65 6e 63 65  | big  difference|
00000410  20 20 74 6f 20 20 74 68  65 20 77 61 69 74 69 6e  |  to  the waitin|
00000420  67 20 74 69 6d 65 20 62  65 66 6f 72 65 20 74 68  |g time before th|
00000430  65 0d 63 6f 6d 70 75 74  65 72 20 69 73 20 62 61  |e.computer is ba|
00000440  63 6b 20 75 6e 64 65 72  20 79 6f 75 72 20 63 6f  |ck under your co|
00000450  6e 74 72 6f 6c 2c 20 61  6c 74 68 6f 75 67 68 20  |ntrol, although |
00000460  61 20 32 4b 20 62 75 66  66 65 72 20 20 28 61 62  |a 2K buffer  (ab|
00000470  6f 75 74 20 20 6f 6e 65  0d 70 61 67 65 20 20 6f  |out  one.page  o|
00000480  66 20 20 6c 6f 6f 73 65  6c 79 20 73 70 61 63 65  |f  loosely space|
00000490  64 20 74 65 78 74 29 20  69 73 20 70 72 6f 62 61  |d text) is proba|
000004a0  62 6c 79 20 74 68 65 20  6d 69 6e 69 6d 75 6d 20  |bly the minimum |
000004b0  70 72 61 63 74 69 63 61  6c 20 73 69 7a 65 2e 0d  |practical size..|
000004c0  54 68 65 20 63 6f 64 65  20 74 6f 20 64 6f 20 61  |The code to do a|
000004d0  6c 6c 20 74 68 69 73 20  69 73 20 32 34 39 20 20  |ll this is 249  |
000004e0  62 79 74 65 73 20 20 6c  6f 6e 67 20 20 61 6e 64  |bytes  long  and|
000004f0  20 20 77 69 6c 6c 20 20  66 69 74 20 20 69 6e 74  |  will  fit  int|
00000500  6f 20 20 61 6e 79 0d 61  76 61 69 6c 61 62 6c 65  |o  any.available|
00000510  20 70 61 67 65 20 6f 66  20 6d 65 6d 6f 72 79 2e  | page of memory.|
00000520  0d 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00000530  20 20 20 20 20 20 20 20  20 20 20 20 55 53 49 4e  |            USIN|
00000540  47 20 54 48 45 20 50 52  4f 47 52 41 4d 0d 0d 20  |G THE PROGRAM.. |
00000550  20 20 20 20 20 20 20 20  20 4f 6e 20 20 72 75 6e  |         On  run|
00000560  6e 69 6e 67 20 20 74 68  65 20 20 70 72 6f 67 72  |ning  the  progr|
00000570  61 6d 20 74 68 65 20 63  6f 64 65 20 69 73 20 61  |am the code is a|
00000580  75 74 6f 6d 61 74 69 63  61 6c 6c 79 20 73 61 76  |utomatically sav|
00000590  65 64 20 74 6f 0d 64 69  73 6b 20 6f 72 20 63 61  |ed to.disk or ca|
000005a0  73 73 65 74 74 65 20 77  69 74 68 20 74 68 65 20  |ssette with the |
000005b0  63 6f 72 72 65 63 74 20  49 2f 4f 20 72 65 6c 6f  |correct I/O relo|
000005c0  63 61 74 69 6f 6e 20 61  64 64 72 65 73 73 20 72  |cation address r|
000005d0  65 67 61 72 64 6c 65 73  73 20 6f 66 0d 74 68 65  |egardless of.the|
000005e0  20 61 64 64 72 65 73 73  65 73 20 63 68 6f 73 65  | addresses chose|
000005f0  6e 2e 20 4f 6e 63 65 20  74 68 65 20 63 6f 64 65  |n. Once the code|
00000600  20 68 61 73 20 62 65 65  6e 20 73 61 76 65 64 20  | has been saved |
00000610  74 68 65 20 70 72 69 6e  74 65 72 20 20 62 75 66  |the printer  buf|
00000620  66 65 72 0d 63 61 6e 20  62 65 20 73 65 74 20 75  |fer.can be set u|
00000630  70 20 73 69 6d 70 6c 79  20 62 79 20 70 72 65 73  |p simply by pres|
00000640  73 69 6e 67 20 3c 42 52  45 41 4b 3e 20 74 68 65  |sing <BREAK> the|
00000650  6e 20 74 79 70 69 6e 67  3a 2d 0d 0d 20 20 20 20  |n typing:-..    |
00000660  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000670  20 20 20 20 20 20 2a 50  52 4e 54 42 55 46 20 20  |      *PRNTBUF  |
00000680  3c 52 45 54 55 52 4e 3e  0d 0d 20 20 20 20 20 20  |<RETURN>..      |
00000690  20 20 20 20 54 68 69 73  20 6c 6f 61 64 73 20 61  |    This loads a|
000006a0  6e 64 20 65 78 65 63 75  74 65 73 20 74 68 65 20  |nd executes the |
000006b0  63 6f 64 65 20 74 6f 20  61 6c 74 65 72 20 74 68  |code to alter th|
000006c0  65 20 62 75 66 66 65 72  20 76 65 63 74 6f 72 73  |e buffer vectors|
000006d0  0d 62 75 74 20 20 64 6f  65 73 20 20 6e 6f 74 20  |.but  does  not |
000006e0  20 74 75 72 6e 20 20 6f  6e 20 20 74 68 65 20 6e  | turn  on  the n|
000006f0  65 77 20 70 72 69 6e 74  65 72 20 62 75 66 66 65  |ew printer buffe|
00000700  72 2c 20 61 6e 79 20 6f  70 65 72 61 74 69 6e 67  |r, any operating|
00000710  20 73 79 73 74 65 6d 0d  63 61 6c 6c 73 20 74 6f  | system.calls to|
00000720  20 74 68 65 20 62 75 66  66 65 72 20 76 65 63 74  | the buffer vect|
00000730  6f 72 73 20 61 72 65 20  72 65 64 69 72 65 63 74  |ors are redirect|
00000740  65 64 20 76 69 61 20 74  68 65 20 6e 65 77 20 20  |ed via the new  |
00000750  63 6f 64 65 20 20 62 61  63 6b 20 20 74 6f 0d 74  |code  back  to.t|
00000760  68 65 20 6f 6c 64 20 76  65 63 74 6f 72 73 2e 20  |he old vectors. |
00000770  54 77 6f 20 6e 65 77 20  6f 73 62 79 74 65 20 63  |Two new osbyte c|
00000780  61 6c 6c 73 20 61 72 65  20 74 68 65 6e 20 75 73  |alls are then us|
00000790  65 64 20 74 6f 20 74 75  72 6e 20 74 68 65 20 62  |ed to turn the b|
000007a0  75 66 66 65 72 0d 6f 6e  20 20 6f 72 20 6f 66 66  |uffer.on  or off|
000007b0  2c 20 2a 46 58 31 32 38  2c 31 32 38 20 73 65 74  |, *FX128,128 set|
000007c0  73 20 75 70 20 74 68 65  20 62 75 66 66 65 72 20  |s up the buffer |
000007d0  73 74 61 72 74 20 61 64  64 72 65 73 73 65 73 20  |start addresses |
000007e0  61 6e 64 20 74 75 72 6e  73 20 6f 6e 0d 74 68 65  |and turns on.the|
000007f0  20 70 72 69 6e 74 65 72  20 62 75 66 66 65 72 20  | printer buffer |
00000800  66 6c 61 67 2c 20 61 6e  64 20 2a 46 58 31 32 38  |flag, and *FX128|
00000810  2c 31 32 39 20 69 73 20  75 73 65 64 20 74 6f 20  |,129 is used to |
00000820  72 65 76 65 72 74 20 74  6f 20 74 68 65 20 42 42  |revert to the BB|
00000830  43 27 73 0d 6f 72 69 67  69 6e 61 6c 20 62 75 66  |C's.original buf|
00000840  66 65 72 2e 0d 0d 0d 0d  0d 0d 0d 0d 0d 0d 0d 0d  |fer.............|
00000850  0d 0d 0d 0d 0d 0d 0d 0d  0d 0d 20 20 20 20 20 20  |..........      |
00000860  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000870  20 20 20 49 2f 4f 20 50  72 69 6e 74 65 72 20 42  |   I/O Printer B|
00000880  75 66 66 65 72 20 20 4d  2e 4a 2e 52 61 77 6c 69  |uffer  M.J.Rawli|
00000890  6e 67 73 20 2d 20 50 41  47 45 20 3a 20 32 0d 0d  |ngs - PAGE : 2..|
000008a0  0d 0d 0d 0d 20 20 20 20  20 20 20 20 20 20 41 6c  |....          Al|
000008b0  6c 20 74 68 65 20 75 73  75 61 6c 20 2a 46 58 20  |l the usual *FX |
000008c0  63 6f 6d 6d 61 6e 64 73  20 61 72 65 20 65 6e 61  |commands are ena|
000008d0  62 6c 65 64 20 77 69 74  68 20 74 68 65 20 20 6e  |bled with the  n|
000008e0  65 77 20 20 62 75 66 66  65 72 0d 61 73 20 77 65  |ew  buffer.as we|
000008f0  6c 6c 20 61 73 20 74 68  65 20 41 44 56 41 4c 20  |ll as the ADVAL |
00000900  66 61 63 69 6c 69 74 79  3a 2d 0d 20 20 20 20 20  |facility:-.     |
00000910  20 20 20 20 20 0d 20 20  20 20 20 20 20 20 20 20  |     .          |
00000920  2a 46 58 31 35 20 20 20  20 20 20 20 20 20 20 20  |*FX15           |
00000930  20 46 6c 75 73 68 20 61  6c 6c 20 62 75 66 66 65  | Flush all buffe|
00000940  72 73 2e 0d 20 20 20 20  20 20 20 20 20 20 2a 46  |rs..          *F|
00000950  58 32 31 2c 33 20 20 20  20 20 20 20 20 20 20 46  |X21,3          F|
00000960  6c 75 73 68 20 70 72 69  6e 74 65 72 20 62 75 66  |lush printer buf|
00000970  66 65 72 20 6f 6e 6c 79  2e 0d 20 20 20 20 20 20  |fer only..      |
00000980  20 20 20 20 4f 73 62 79  74 65 20 26 38 30 20 28  |    Osbyte &80 (|
00000990  31 32 38 29 20 52 65 61  64 20 41 44 43 20 63 68  |128) Read ADC ch|
000009a0  61 6e 6e 65 6c 2f 67 65  74 20 62 75 66 66 65 72  |annel/get buffer|
000009b0  20 73 74 61 74 75 73 2e  0d 20 20 20 20 20 20 20  | status..       |
000009c0  20 20 20 2a 46 58 31 32  38 2c 31 32 38 20 20 20  |   *FX128,128   |
000009d0  20 20 20 20 54 75 72 6e  20 6f 6e 20 6e 65 77 20  |    Turn on new |
000009e0  70 72 69 6e 74 65 72 20  62 75 66 66 65 72 2e 0d  |printer buffer..|
000009f0  20 20 20 20 20 20 20 20  20 20 2a 46 58 31 32 38  |          *FX128|
00000a00  2c 31 32 39 20 20 20 20  20 20 20 54 75 72 6e 20  |,129       Turn |
00000a10  6f 66 66 20 6e 65 77 20  70 72 69 6e 74 65 72 20  |off new printer |
00000a20  62 75 66 66 65 72 2e 0d  20 20 20 20 20 20 20 20  |buffer..        |
00000a30  20 20 2a 46 58 31 33 38  2c 33 2c 3c 63 68 61 72  |  *FX138,3,<char|
00000a40  3e 20 20 49 6e 73 65 72  74 20 63 68 61 72 61 63  |>  Insert charac|
00000a50  74 65 72 20 69 6e 74 6f  20 70 72 69 6e 74 65 72  |ter into printer|
00000a60  20 62 75 66 66 65 72 2e  0d 20 20 20 20 20 20 20  | buffer..       |
00000a70  20 20 20 4f 73 62 79 74  65 20 26 39 31 20 28 31  |   Osbyte &91 (1|
00000a80  34 35 29 20 52 65 6d 6f  76 65 20 63 68 61 72 61  |45) Remove chara|
00000a90  63 74 65 72 20 66 72 6f  6d 20 62 75 66 66 65 72  |cter from buffer|
00000aa0  2e 0d 20 20 20 20 20 20  20 20 20 20 4f 73 62 79  |..          Osby|
00000ab0  74 65 20 26 39 38 20 28  31 35 32 29 20 45 78 61  |te &98 (152) Exa|
00000ac0  6d 69 6e 65 20 62 75 66  66 65 72 20 73 74 61 74  |mine buffer stat|
00000ad0  75 73 2e 0d 20 20 20 20  20 20 20 20 20 20 2a 46  |us..          *F|
00000ae0  58 31 35 33 2c 33 2c 3c  63 68 61 72 3e 20 20 49  |X153,3,<char>  I|
00000af0  6e 73 65 72 74 20 63 68  61 72 61 63 74 65 72 20  |nsert character |
00000b00  69 6e 74 6f 20 70 72 69  6e 74 65 72 20 62 75 66  |into printer buf|
00000b10  66 65 72 2e 0d 20 20 20  20 20 20 20 20 20 20 41  |fer..          A|
00000b20  44 56 41 4c 28 2d 34 29  20 20 20 20 20 20 20 20  |DVAL(-4)        |
00000b30  52 65 74 75 72 6e 73 20  6e 75 6d 62 65 72 20 6f  |Returns number o|
00000b40  66 20 66 72 65 65 20 73  70 61 63 65 73 20 69 6e  |f free spaces in|
00000b50  20 70 72 69 6e 74 65 72  0d 20 20 20 20 20 20 20  | printer.       |
00000b60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000b70  20 20 20 20 62 75 66 66  65 72 2e 0d 20 20 20 20  |    buffer..    |
00000b80  20 20 20 20 20 20 45 53  43 41 50 45 20 20 20 20  |      ESCAPE    |
00000b90  20 20 20 20 20 20 20 50  72 65 73 73 69 6e 67 20  |       Pressing |
00000ba0  45 53 43 41 50 45 20 77  69 6c 6c 20 66 6c 75 73  |ESCAPE will flus|
00000bb0  68 20 61 6c 6c 20 62 75  66 66 65 72 73 2e 0d 20  |h all buffers.. |
00000bc0  20 20 20 20 20 20 20 20  20 0d 4e 6f 74 65 20 20  |         .Note  |
00000bd0  74 68 61 74 20 2a 46 58  31 32 38 2c 31 32 38 20  |that *FX128,128 |
00000be0  63 61 6e 20 61 6c 73 6f  20 62 65 20 75 73 65 64  |can also be used|
00000bf0  20 74 6f 20 66 6c 75 73  68 20 74 68 65 20 6e 65  | to flush the ne|
00000c00  77 20 70 72 69 6e 74 65  72 20 62 75 66 66 65 72  |w printer buffer|
00000c10  0d 77 68 65 6e 20 69 6e  20 75 73 65 2e 20 44 6f  |.when in use. Do|
00000c20  20 6e 6f 74 20 74 72 79  20 74 6f 20 72 65 73 65  | not try to rese|
00000c30  74 20 74 68 65 20 20 70  72 69 6e 74 65 72 20 20  |t the  printer  |
00000c40  62 75 66 66 65 72 20 20  77 69 74 68 20 20 61 20  |buffer  with  a |
00000c50  20 73 65 63 6f 6e 64 0d  2a 50 52 4e 54 42 55 46  | second.*PRNTBUF|
00000c60  20 20 63 6f 6d 6d 61 6e  64 20 20 61 73 20 20 74  |  command  as  t|
00000c70  68 69 73 20 20 77 69 6c  6c 20 69 6e 63 6f 72 72  |his  will incorr|
00000c80  65 63 74 6c 79 20 73 65  74 20 74 68 65 20 76 65  |ectly set the ve|
00000c90  63 74 6f 72 73 20 61 6e  64 20 77 69 6c 6c 0d 63  |ctors and will.c|
00000ca0  61 75 73 65 20 74 68 65  20 63 6f 6d 70 75 74 65  |ause the compute|
00000cb0  72 20 20 74 6f 20 20 68  61 6e 67 20 20 75 70 2e  |r  to  hang  up.|
00000cc0  20 20 50 72 65 73 73 69  6e 67 20 20 62 72 65 61  |  Pressing  brea|
00000cd0  6b 20 20 77 69 6c 6c 20  20 72 65 73 74 6f 72 65  |k  will  restore|
00000ce0  20 20 74 68 65 0d 6f 72  69 67 69 6e 61 6c 20 64  |  the.original d|
00000cf0  65 66 61 75 6c 74 20 76  65 63 74 6f 72 73 2e 0d  |efault vectors..|
00000d00  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00000d10  20 20 20 20 20 20 20 20  20 20 20 4c 4f 43 41 54  |           LOCAT|
00000d20  49 4e 47 20 54 48 45 20  43 4f 44 45 0d 0d 20 20  |ING THE CODE..  |
00000d30  20 20 20 20 20 20 20 20  54 68 65 20 66 6f 6c 6c  |        The foll|
00000d40  6f 77 69 6e 67 20 61 64  64 72 65 73 73 65 73 20  |owing addresses |
00000d50  61 72 65 20 73 75 69 74  61 62 6c 65 20 66 6f 72  |are suitable for|
00000d60  20 73 74 6f 72 69 6e 67  20 74 68 65 20 6d 61 63  | storing the mac|
00000d70  68 69 6e 65 0d 63 6f 64  65 2c 20 73 69 6d 70 6c  |hine.code, simpl|
00000d80  79 20 63 68 61 6e 67 65  20 74 68 65 20 43 6f 64  |y change the Cod|
00000d90  65 20 41 64 64 72 65 73  73 20 28 50 25 29 2e 0d  |e Address (P%)..|
00000da0  0d 26 39 30 30 20 74 6f  20 26 39 46 46 20 4e 6f  |.&900 to &9FF No|
00000db0  74 20 66 6f 72 20 63 61  73 73 65 74 74 65 20 75  |t for cassette u|
00000dc0  73 65 72 73 2e 0d 20 20  20 20 20 20 20 20 20 20  |sers..          |
00000dd0  20 20 20 4e 6f 74 20 66  6f 72 20 73 70 65 65 63  |   Not for speec|
00000de0  68 20 73 79 73 74 65 6d  20 75 73 65 72 73 2e 0d  |h system users..|
00000df0  20 20 20 20 20 20 20 20  20 20 20 20 20 4e 6f 74  |             Not|
00000e00  20 69 66 20 73 6f 75 6e  64 20 65 6e 76 65 6c 6f  | if sound envelo|
00000e10  70 65 73 20 35 2d 31 36  20 61 72 65 20 69 6e 20  |pes 5-16 are in |
00000e20  75 73 65 2e 0d 20 20 20  20 20 20 20 20 20 20 20  |use..           |
00000e30  20 20 4e 6f 74 20 69 66  20 52 53 34 32 33 20 70  |  Not if RS423 p|
00000e40  6f 72 74 20 69 73 20 69  6e 20 75 73 65 2e 0d 0d  |ort is in use...|
00000e50  26 41 30 30 20 54 4f 20  26 41 46 46 20 4e 6f 74  |&A00 TO &AFF Not|
00000e60  20 66 6f 72 20 63 61 73  73 65 74 74 65 20 75 73  | for cassette us|
00000e70  65 72 73 2e 0d 20 20 20  20 20 20 20 20 20 20 20  |ers..           |
00000e80  20 20 4e 6f 74 20 69 66  20 52 53 34 32 33 20 70  |  Not if RS423 p|
00000e90  6f 72 74 20 69 73 20 69  6e 20 75 73 65 2e 0d 0d  |ort is in use...|
00000ea0  26 42 30 30 20 54 4f 20  26 42 46 46 20 4e 6f 74  |&B00 TO &BFF Not|
00000eb0  20 69 66 20 66 75 6e 63  74 69 6f 6e 20 6b 65 79  | if function key|
00000ec0  73 20 61 72 65 20 69 6e  20 75 73 65 2e 0d 0d 26  |s are in use...&|
00000ed0  43 30 30 20 54 4f 20 26  43 46 46 20 4e 6f 74 20  |C00 TO &CFF Not |
00000ee0  69 66 20 63 68 61 72 61  63 74 65 72 73 20 32 32  |if characters 22|
00000ef0  34 2d 32 35 35 20 61 72  65 20 72 65 64 65 66 69  |4-255 are redefi|
00000f00  6e 65 64 2e 0d 0d 20 20  20 20 20 20 20 20 20 20  |ned...          |
00000f10  41 6c 74 65 72 6e 61 74  69 76 65 6c 79 20 20 74  |Alternatively  t|
00000f20  68 65 20 20 63 6f 64 65  20 20 63 61 6e 20 20 62  |he  code  can  b|
00000f30  65 20 6c 6f 63 61 74 65  64 20 69 6e 20 74 68 65  |e located in the|
00000f40  20 6d 61 69 6e 20 6d 65  6d 6f 72 79 0d 61 72 65  | main memory.are|
00000f50  61 20 62 65 66 6f 72 65  20 6f 72 20 61 66 74 65  |a before or afte|
00000f60  72 20 74 68 65 20 73 70  61 63 65 20 61 6c 6c 6f  |r the space allo|
00000f70  63 61 74 65 64 20 74 6f  20 74 68 65 20 62 75 66  |cated to the buf|
00000f80  66 65 72 2c 20 74 68 6f  75 67 68 20 61 20 62 65  |fer, though a be|
00000f90  6c 6f 77 0d 50 41 47 45  20 61 64 64 72 65 73 73  |low.PAGE address|
00000fa0  20 69 73 20 73 61 66 65  72 2e 0d 0d 20 20 20 20  | is safer...    |
00000fb0  20 20 20 20 20 20 54 68  65 20 70 72 6f 67 72 61  |      The progra|
00000fc0  6d 20 75 73 65 73 20 37  20 62 79 74 65 73 20 6f  |m uses 7 bytes o|
00000fd0  66 20 7a 65 72 6f 20 70  61 67 65 20 77 6f 72 6b  |f zero page work|
00000fe0  73 70 61 63 65 20 66 72  6f 6d 20 26 37 38 20 20  |space from &78  |
00000ff0  74 6f 0d 26 37 45 2c 20  69 66 20 74 68 69 73 20  |to.&7E, if this |
00001000  63 6c 61 73 68 65 73 20  77 69 74 68 20 6f 74 68  |clashes with oth|
00001010  65 72 20 75 74 69 6c 69  74 69 65 73 20 6f 72 20  |er utilities or |
00001020  79 6f 75 72 20 6f 77 6e  20 70 72 6f 67 72 61 6d  |your own program|
00001030  20 74 68 65 6e 20 61 6e  79 0d 7a 65 72 6f 20 70  | then any.zero p|
00001040  61 67 65 20 73 70 61 63  65 20 66 72 6f 6d 20 26  |age space from &|
00001050  37 30 20 74 6f 20 26 39  46 20 63 61 6e 20 62 65  |70 to &9F can be|
00001060  20 75 73 65 64 2c 20 45  63 6f 6e 65 74 20 75 73  | used, Econet us|
00001070  65 72 73 20 73 68 6f 75  6c 64 20 61 76 6f 69 64  |ers should avoid|
00001080  0d 26 39 30 20 74 6f 20  26 39 46 20 61 6e 64 20  |.&90 to &9F and |
00001090  73 65 63 6f 6e 64 20 70  72 6f 63 65 73 73 6f 72  |second processor|
000010a0  20 75 73 65 72 73 20 73  68 6f 75 6c 64 20 61 76  | users should av|
000010b0  6f 69 64 20 26 37 30 20  74 6f 20 26 37 37 2e 0d  |oid &70 to &77..|
000010c0  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
000010d0  20 20 20 20 20 20 4c 4f  43 41 54 49 4e 47 20 54  |      LOCATING T|
000010e0  48 45 20 50 52 49 4e 54  45 52 20 42 55 46 46 45  |HE PRINTER BUFFE|
000010f0  52 0d 0d 20 20 20 20 20  20 20 20 20 20 54 68 65  |R..          The|
00001100  20 20 73 74 61 72 74 20  20 61 6e 64 20 65 6e 64  |  start  and end|
00001110  20 61 64 64 72 65 73 73  65 73 20 6d 75 73 74 20  | addresses must |
00001120  62 65 20 77 68 6f 6c 65  20 70 61 67 65 20 76 61  |be whole page va|
00001130  6c 75 65 73 20 69 2e 65  2e 0d 26 37 38 30 30 20  |lues i.e..&7800 |
00001140  6e 6f 74 20 26 37 38 43  44 2c 20 74 68 69 73 20  |not &78CD, this |
00001150  69 73 20 62 65 63 61 75  73 65 20 6f 6e 6c 79 20  |is because only |
00001160  74 68 65 20 6d 6f 73 74  20 73 69 67 6e 69 66 69  |the most signifi|
00001170  63 61 6e 74 20 62 79 74  65 20 6f 66 20 74 68 65  |cant byte of the|
00001180  0d 61 64 64 72 65 73 73  20 69 73 20 75 73 65 64  |.address is used|
00001190  20 74 6f 20 74 65 73 74  20 66 6f 72 20 74 68 65  | to test for the|
000011a0  20 65 6e 64 20 6f 66 20  74 68 65 20 62 75 66 66  | end of the buff|
000011b0  65 72 20 61 6e 64 20 20  74 6f 20 20 77 72 61 70  |er and  to  wrap|
000011c0  20 20 72 6f 75 6e 64 0d  74 68 65 20 72 65 61 64  |  round.the read|
000011d0  20 61 6e 64 20 77 72 69  74 65 20 61 64 64 72 65  | and write addre|
000011e0  73 73 65 73 20 62 61 63  6b 20 74 6f 20 74 68 65  |sses back to the|
000011f0  20 73 74 61 72 74 2e 0d  0d 0d 0d 0d 0d 0d 20 20  | start........  |
00001200  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001210  20 20 20 20 20 20 20 49  2f 4f 20 50 72 69 6e 74  |       I/O Print|
00001220  65 72 20 42 75 66 66 65  72 20 20 4d 2e 4a 2e 52  |er Buffer  M.J.R|
00001230  61 77 6c 69 6e 67 73 20  2d 20 50 41 47 45 20 3a  |awlings - PAGE :|
00001240  20 33 0d 0d 0d 0d 0d 0d  0d 20 20 20 20 20 20 20  | 3.......       |
00001250  20 20 20 54 68 65 20 20  65 6e 64 20 20 61 64 64  |   The  end  add|
00001260  72 65 73 73 20 64 65 70  65 6e 64 73 20 70 75 72  |ress depends pur|
00001270  65 6c 79 20 6f 6e 20 74  68 65 20 67 72 61 70 68  |ely on the graph|
00001280  69 63 73 20 6d 6f 64 65  20 69 6e 20 75 73 65 0d  |ics mode in use.|
00001290  61 6e 64 20 73 68 6f 75  6c 64 20 62 65 20 61 74  |and should be at|
000012a0  20 6c 65 61 73 74 20 6f  6e 65 20 70 61 67 65 20  | least one page |
000012b0  28 26 31 30 30 29 20 62  65 6c 6f 77 20 74 68 65  |(&100) below the|
000012c0  20 67 72 61 70 68 69 63  73 20 61 72 65 61 2e 20  | graphics area. |
000012d0  49 66 20 74 68 65 0d 63  6f 64 65 20 69 73 20 61  |If the.code is a|
000012e0  73 73 65 6d 62 6c 65 64  20 61 62 6f 76 65 20 74  |ssembled above t|
000012f0  68 65 20 62 75 66 66 65  72 20 61 72 65 61 20 74  |he buffer area t|
00001300  68 65 6e 20 50 25 20 73  68 6f 75 6c 64 20 62 65  |hen P% should be|
00001310  20 74 68 65 20 73 61 6d  65 20 20 61 73 0d 74 68  | the same  as.th|
00001320  65 20 20 65 6e 64 20 20  61 64 64 72 65 73 73 20  |e  end  address |
00001330  61 6e 64 20 61 74 20 6c  65 61 73 74 20 32 20 70  |and at least 2 p|
00001340  61 67 65 73 20 28 26 32  30 30 29 20 62 65 6c 6f  |ages (&200) belo|
00001350  77 20 74 68 65 20 67 72  61 70 68 69 63 73 20 61  |w the graphics a|
00001360  72 65 61 2c 0d 28 74 68  65 20 70 72 6f 67 72 61  |rea,.(the progra|
00001370  6d 20 61 73 20 70 72 69  6e 74 65 64 20 73 74 6f  |m as printed sto|
00001380  72 65 73 20 74 68 65 20  63 6f 64 65 20 69 6e 20  |res the code in |
00001390  74 68 69 73 20 66 61 73  68 69 6f 6e 29 2e 20 54  |this fashion). T|
000013a0  68 69 73 20 20 69 73 20  20 74 6f 0d 61 6c 6c 6f  |his  is  to.allo|
000013b0  77 20 72 6f 6f 6d 20 66  6f 72 20 74 68 65 20 62  |w room for the b|
000013c0  61 73 69 63 20 73 74 61  63 6b 20 28 62 61 73 69  |asic stack (basi|
000013d0  63 27 73 20 74 65 6d 70  6f 72 61 72 79 20 73 74  |c's temporary st|
000013e0  6f 72 61 67 65 20 73 70  61 63 65 29 2e 0d 0d 20  |orage space)... |
000013f0  20 20 20 20 20 20 20 20  20 45 78 61 6d 70 6c 65  |         Example|
00001400  20 65 6e 64 20 61 64 64  72 65 73 73 65 73 3a 2d  | end addresses:-|
00001410  0d 20 20 20 20 20 20 20  20 20 20 0d 20 20 20 20  |.          .    |
00001420  20 20 20 20 20 20 4d 6f  64 65 30 2c 31 2c 32 20  |      Mode0,1,2 |
00001430  20 20 26 32 46 30 30 20  28 26 32 45 30 30 20 69  |  &2F00 (&2E00 i|
00001440  66 20 63 6f 64 65 20 69  73 20 61 62 6f 76 65 20  |f code is above |
00001450  62 75 66 66 65 72 29 0d  20 20 20 20 20 20 20 20  |buffer).        |
00001460  20 20 4d 6f 64 65 33 20  20 20 20 20 20 20 26 33  |  Mode3       &3|
00001470  46 30 30 20 28 26 33 45  30 30 20 69 66 20 63 6f  |F00 (&3E00 if co|
00001480  64 65 20 69 73 20 61 62  6f 76 65 20 62 75 66 66  |de is above buff|
00001490  65 72 29 0d 20 20 20 20  20 20 20 20 20 20 4d 6f  |er).          Mo|
000014a0  64 65 34 2c 35 20 20 20  20 20 26 35 37 30 30 20  |de4,5     &5700 |
000014b0  28 26 35 36 30 30 20 69  66 20 63 6f 64 65 20 69  |(&5600 if code i|
000014c0  73 20 61 62 6f 76 65 20  62 75 66 66 65 72 29 0d  |s above buffer).|
000014d0  20 20 20 20 20 20 20 20  20 20 4d 6f 64 65 36 20  |          Mode6 |
000014e0  20 20 20 20 20 20 26 35  46 30 30 20 28 26 35 45  |      &5F00 (&5E|
000014f0  30 30 20 69 66 20 63 6f  64 65 20 69 73 20 61 62  |00 if code is ab|
00001500  6f 76 65 20 62 75 66 66  65 72 29 0d 20 20 20 20  |ove buffer).    |
00001510  20 20 20 20 20 20 4d 6f  64 65 37 20 20 20 20 20  |      Mode7     |
00001520  20 20 26 37 42 30 30 20  28 26 37 41 30 30 20 69  |  &7B00 (&7A00 i|
00001530  66 20 63 6f 64 65 20 69  73 20 61 62 6f 76 65 20  |f code is above |
00001540  62 75 66 66 65 72 29 0d  20 20 20 20 20 20 20 20  |buffer).        |
00001550  20 20 0d 20 20 20 20 20  20 20 20 20 20 57 69 74  |  .          Wit|
00001560  68 6f 75 74 20 20 61 20  73 65 63 6f 6e 64 20 70  |hout  a second p|
00001570  72 6f 63 65 73 73 6f 72  20 74 68 65 20 73 74 61  |rocessor the sta|
00001580  72 74 20 61 64 64 72 65  73 73 20 64 65 70 65 6e  |rt address depen|
00001590  64 73 20 6f 6e 20 68 6f  77 0d 6d 75 63 68 20 6d  |ds on how.much m|
000015a0  65 6d 6f 72 79 20 69 73  20 62 65 69 6e 67 20 75  |emory is being u|
000015b0  73 65 64 20 62 79 20 20  79 6f 75 72 20 20 70 72  |sed by  your  pr|
000015c0  6f 67 72 61 6d 2e 20 20  56 61 72 69 61 62 6c 65  |ogram.  Variable|
000015d0  73 20 20 75 73 65 64 20  20 62 79 20 20 74 68 65  |s  used  by  the|
000015e0  0d 70 72 6f 67 72 61 6d  20 20 61 72 65 20 20 73  |.program  are  s|
000015f0  74 6f 72 65 64 20 20 6f  6e 20 20 74 68 65 20 68  |tored  on  the h|
00001600  65 61 70 20 28 66 72 6f  6d 20 4c 4f 4d 45 4d 20  |eap (from LOMEM |
00001610  75 70 77 61 72 64 73 29  20 61 6e 64 20 74 68 65  |upwards) and the|
00001620  20 6c 6f 77 65 73 74 0d  61 76 61 69 6c 61 62 6c  | lowest.availabl|
00001630  65 20 61 64 64 72 65 73  73 20 61 62 6f 76 65 20  |e address above |
00001640  74 68 65 20 20 68 65 61  70 20 20 63 61 6e 20 20  |the  heap  can  |
00001650  62 65 20 20 66 6f 75 6e  64 20 20 61 66 74 65 72  |be  found  after|
00001660  20 20 72 75 6e 6e 69 6e  67 20 20 74 68 65 0d 70  |  running  the.p|
00001670  72 6f 67 72 61 6d 2c 20  62 79 20 74 79 70 69 6e  |rogram, by typin|
00001680  67 3a 2d 0d 0d 20 20 20  20 20 20 20 20 20 20 50  |g:-..          P|
00001690  52 49 4e 54 7e 21 32 20  41 4e 44 26 46 46 46 46  |RINT~!2 AND&FFFF|
000016a0  0d 0d 20 20 20 20 20 20  20 20 20 20 54 6f 20 20  |..          To  |
000016b0  62 65 20 20 6f 6e 20 20  74 68 65 20 73 61 76 65  |be  on  the save|
000016c0  20 73 69 64 65 20 73 65  74 20 48 49 4d 45 4d 20  | side set HIMEM |
000016d0  61 6e 64 20 74 68 65 20  73 74 61 72 74 20 61 64  |and the start ad|
000016e0  64 72 65 73 73 20 74 6f  0d 74 68 65 20 6e 65 78  |dress to.the nex|
000016f0  74 20 77 68 6f 6c 65 20  70 61 67 65 2b 31 20 61  |t whole page+1 a|
00001700  62 6f 76 65 20 74 68 69  73 20 76 61 6c 75 65 2c  |bove this value,|
00001710  20 74 68 69 73 20 61 76  6f 69 64 73 20 74 68 65  | this avoids the|
00001720  20 70 6f 73 73 69 62 69  6c 69 74 79 20 6f 66 0d  | possibility of.|
00001730  70 72 6f 67 72 61 6d 20  76 61 72 69 61 62 6c 65  |program variable|
00001740  73 20 63 6f 72 72 75 70  74 69 6e 67 20 74 68 65  |s corrupting the|
00001750  20 62 75 66 66 65 72 2e  20 49 66 20 48 49 4d 45  | buffer. If HIME|
00001760  4d 20 69 73 20 73 65 74  20 69 6e 20 20 74 68 69  |M is set in  thi|
00001770  73 20 20 77 61 79 0d 74  68 65 6e 20 20 74 68 65  |s  way.then  the|
00001780  20 20 65 6e 64 20 61 64  64 72 65 73 73 20 63 61  |  end address ca|
00001790  6e 20 62 65 20 6f 6e 65  20 70 61 67 65 20 68 69  |n be one page hi|
000017a0  67 68 65 72 20 74 68 61  6e 20 74 68 65 20 65 78  |gher than the ex|
000017b0  61 6d 70 6c 65 73 20 61  62 6f 76 65 2e 0d 54 68  |amples above..Th|
000017c0  69 73 20 74 65 63 68 6e  69 71 75 65 20 61 6c 73  |is technique als|
000017d0  6f 20 70 72 65 76 65 6e  74 73 20 2a 43 4f 50 59  |o prevents *COPY|
000017e0  2c 20 2a 42 41 43 4b 55  50 20 61 6e 64 20 2a 43  |, *BACKUP and *C|
000017f0  4f 4d 50 41 43 54 20 63  6f 6d 6d 61 6e 64 73 20  |OMPACT commands |
00001800  66 72 6f 6d 0d 63 6f 72  72 75 70 74 69 6e 67 20  |from.corrupting |
00001810  74 68 65 20 63 6f 6e 74  65 6e 74 73 20 6f 66 20  |the contents of |
00001820  74 68 65 20 20 62 75 66  66 65 72 20 20 6f 72 20  |the  buffer  or |
00001830  20 74 68 65 20 20 63 6f  64 65 20 20 69 74 73 65  | the  code  itse|
00001840  6c 66 2e 20 20 53 65 63  6f 6e 64 0d 70 72 6f 63  |lf.  Second.proc|
00001850  65 73 73 6f 72 20 20 75  73 65 72 73 20 20 73 68  |essor  users  sh|
00001860  6f 75 6c 64 2c 20 69 66  20 70 6f 73 73 69 62 6c  |ould, if possibl|
00001870  65 2c 20 73 74 6f 72 65  20 74 68 65 20 63 6f 64  |e, store the cod|
00001880  65 20 62 65 6c 6f 77 20  70 61 67 65 20 61 73 20  |e below page as |
00001890  69 74 0d 69 73 20 6e 6f  74 20 70 6f 73 73 69 62  |it.is not possib|
000018a0  6c 65 20 74 6f 20 72 65  73 65 74 20 48 49 4d 45  |le to reset HIME|
000018b0  4d 20 69 6e 20 74 68 65  20 49 2f 4f 20 70 72 6f  |M in the I/O pro|
000018c0  63 65 73 73 6f 72 20 20  66 72 6f 6d 20 20 74 68  |cessor  from  th|
000018d0  65 20 20 73 65 63 6f 6e  64 0d 70 72 6f 63 65 73  |e  second.proces|
000018e0  73 6f 72 2e 20 20 49 66  20 20 74 68 65 20 20 63  |sor.  If  the  c|
000018f0  6f 64 65 20 64 6f 65 73  20 62 65 63 6f 6d 65 20  |ode does become |
00001900  63 6f 72 72 75 70 74 65  64 20 74 68 65 6e 20 74  |corrupted then t|
00001910  68 65 20 63 6f 6d 70 75  74 65 72 20 77 69 6c 6c  |he computer will|
00001920  0d 68 61 6e 67 20 75 70  20 61 73 20 74 68 65 20  |.hang up as the |
00001930  62 75 66 66 65 72 20 76  65 63 74 6f 72 73 20 61  |buffer vectors a|
00001940  72 65 20 63 6f 6e 73 74  61 6e 74 6c 79 20 69 6e  |re constantly in|
00001950  20 75 73 65 20 75 6e 64  65 72 20 74 68 65 20 20  | use under the  |
00001960  63 6f 6e 74 72 6f 6c 0d  6f 66 20 6f 70 65 72 61  |control.of opera|
00001970  74 69 6e 67 20 73 79 73  74 65 6d 20 67 65 6e 65  |ting system gene|
00001980  72 61 74 65 64 20 69 6e  74 65 72 72 75 70 74 73  |rated interrupts|
00001990  2e 0d 0d 20 20 20 20 20  20 20 20 20 20 57 69 74  |...          Wit|
000019a0  68 20 61 20 73 65 63 6f  6e 64 20 70 72 6f 63 65  |h a second proce|
000019b0  73 73 6f 72 20 61 6e 64  20 64 69 73 6b 20 64 72  |ssor and disk dr|
000019c0  69 76 65 73 20 63 6f 6e  6e 65 63 74 65 64 20 74  |ives connected t|
000019d0  68 65 20 6c 6f 77 65 73  74 0d 64 65 66 61 75 6c  |he lowest.defaul|
000019e0  74 20 20 73 74 61 72 74  20 20 61 64 64 72 65 73  |t  start  addres|
000019f0  73 20 20 69 73 20 26 31  46 30 30 20 28 61 73 20  |s  is &1F00 (as |
00001a00  70 72 69 6e 74 65 64 29  2c 20 74 68 69 73 20 63  |printed), this c|
00001a10  61 6e 20 62 65 20 6c 6f  77 65 72 65 64 20 74 6f  |an be lowered to|
00001a20  0d 26 31 39 30 30 20 61  66 74 65 72 20 61 20 2a  |.&1900 after a *|
00001a30  46 58 32 30 20 63 6f 6d  6d 61 6e 64 20 74 6f 20  |FX20 command to |
00001a40  69 6d 70 6c 6f 64 65 20  74 68 65 20 20 63 68 61  |implode the  cha|
00001a50  72 61 63 74 65 72 20 20  64 65 66 69 6e 69 74 69  |racter  definiti|
00001a60  6f 6e 73 2e 20 20 41 0d  6d 61 78 69 6d 75 6d 20  |ons.  A.maximum |
00001a70  20 70 72 69 6e 74 65 72  20 20 62 75 66 66 65 72  | printer  buffer|
00001a80  20 20 73 69 7a 65 20 20  6f 66 20 32 36 6b 20 69  |  size  of 26k i|
00001a90  73 20 61 74 74 61 69 6e  61 62 6c 65 20 62 79 20  |s attainable by |
00001aa0  6c 6f 77 65 72 69 6e 67  20 4f 53 48 57 4d 0d 28  |lowering OSHWM.(|
00001ab0  6f 70 65 72 61 74 69 6e  67 20 73 79 73 74 65 6d  |operating system|
00001ac0  20 68 69 67 68 20 77 61  74 65 72 20 6d 61 72 6b  | high water mark|
00001ad0  29 20 74 6f 20 26 31 33  30 30 20 77 69 74 68 20  |) to &1300 with |
00001ae0  61 20 20 2a 46 58 31 38  30 2c 31 39 20 20 63 6f  |a  *FX180,19  co|
00001af0  6d 6d 61 6e 64 0d 62 75  74 20 20 74 68 69 73 20  |mmand.but  this |
00001b00  20 61 6c 6c 6f 77 73 20  20 79 6f 75 20 20 74 6f  | allows  you  to|
00001b10  20 6f 70 65 6e 20 6f 6e  6c 79 20 6f 6e 65 20 64  | open only one d|
00001b20  69 73 6b 20 66 69 6c 65  20 61 74 20 61 20 74 69  |isk file at a ti|
00001b30  6d 65 2e 20 43 61 73 73  65 74 74 65 0d 75 73 65  |me. Cassette.use|
00001b40  72 73 20 73 68 6f 75 6c  64 20 73 65 74 20 74 68  |rs should set th|
00001b50  65 20 73 74 61 72 74 20  61 64 64 72 65 73 73 20  |e start address |
00001b60  74 6f 20 26 31 34 30 30  20 28 32 35 2e 37 35 6b  |to &1400 (25.75k|
00001b70  20 62 75 66 66 65 72 29  20 20 77 69 74 68 20 20  | buffer)  with  |
00001b80  74 68 65 0d 63 68 61 72  61 63 74 65 72 20 20 64  |the.character  d|
00001b90  65 66 69 6e 69 74 69 6f  6e 73 20 20 65 78 70 6c  |efinitions  expl|
00001ba0  6f 64 65 64 20 6f 72 20  26 45 30 30 20 28 32 37  |oded or &E00 (27|
00001bb0  2e 32 35 6b 20 62 75 66  66 65 72 29 20 77 69 74  |.25k buffer) wit|
00001bc0  68 20 69 6d 70 6c 6f 64  65 64 0d 63 68 61 72 61  |h imploded.chara|
00001bd0  63 74 65 72 20 20 64 65  66 69 6e 69 74 69 6f 6e  |cter  definition|
00001be0  73 2e 20 20 4e 61 74 75  72 61 6c 6c 79 20 20 74  |s.  Naturally  t|
00001bf0  68 65 73 65 20 20 61 64  64 72 65 73 73 20 20 77  |hese  address  w|
00001c00  69 6c 6c 20 20 68 61 76  65 20 20 74 6f 20 20 62  |ill  have  to  b|
00001c10  65 0d 69 6e 63 72 65 61  73 65 64 20 20 62 79 20  |e.increased  by |
00001c20  20 6f 6e 65 20 20 70 61  67 65 20 20 69 66 20 20  | one  page  if  |
00001c30  79 6f 75 20 20 77 69 73  68 20 20 74 6f 20 6c 6f  |you  wish  to lo|
00001c40  63 61 74 65 20 74 68 65  20 63 6f 64 65 20 62 65  |cate the code be|
00001c50  66 6f 72 65 20 74 68 65  0d 62 75 66 66 65 72 2e  |fore the.buffer.|
00001c60  0d 0d 0d 0d 0d 0d 0d 0d  0d 0d 0d 0d 0d 0d 20 20  |..............  |
00001c70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001c80  20 20 20 20 20 20 20 20  49 2f 4f 20 50 72 69 6e  |        I/O Prin|
00001c90  74 65 72 20 42 75 66 66  65 72 20 20 4d 2e 4a 2e  |ter Buffer  M.J.|
00001ca0  52 61 77 6c 69 6e 67 73  20 2d 20 50 41 47 45 20  |Rawlings - PAGE |
00001cb0  3a 20 34 0d 0d 0d 0d 0d  0d 20 20 20 20 20 20 20  |: 4......       |
00001cc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001cd0  20 20 20 20 20 45 52 52  4f 52 20 48 41 4e 44 4c  |     ERROR HANDL|
00001ce0  49 4e 47 0d 0d 20 20 20  20 20 20 20 20 20 20 49  |ING..          I|
00001cf0  74 20 69 73 20 63 6f 6d  6d 6f 6e 20 20 70 72 61  |t is common  pra|
00001d00  63 74 69 63 65 20 20 74  6f 20 20 75 73 65 20 20  |ctice  to  use  |
00001d10  74 68 65 20 20 42 42 43  27 73 20 20 65 72 72 6f  |the  BBC's  erro|
00001d20  72 20 20 68 61 6e 64 6c  69 6e 67 0d 66 61 63 69  |r  handling.faci|
00001d30  6c 69 74 65 73 20 20 74  6f 20 72 65 74 75 72 6e  |lites  to return|
00001d40  20 63 6f 6e 74 72 6f 6c  20 74 6f 20 61 20 6d 61  | control to a ma|
00001d50  69 6e 20 6d 65 6e 75 20  73 69 6d 70 6c 79 20 62  |in menu simply b|
00001d60  79 20 70 72 65 73 73 69  6e 67 20 65 73 63 61 70  |y pressing escap|
00001d70  65 2c 0d 75 6e 66 6f 72  74 75 6e 61 74 65 6c 79  |e,.unfortunately|
00001d80  20 70 72 65 73 73 69 6e  67 20 65 73 63 61 70 65  | pressing escape|
00001d90  20 77 69 6c 6c 20 20 61  6c 73 6f 20 20 66 6c 75  | will  also  flu|
00001da0  73 68 20 20 61 6c 6c 20  20 62 75 66 66 65 72 73  |sh  all  buffers|
00001db0  20 20 74 68 65 72 65 62  79 0d 73 74 6f 70 70 69  |  thereby.stoppi|
00001dc0  6e 67 20 20 70 72 69 6e  74 65 72 20 20 6f 75 74  |ng  printer  out|
00001dd0  70 75 74 2e 20 54 77 6f  20 65 78 74 72 61 20 62  |put. Two extra b|
00001de0  79 74 65 73 20 6f 66 20  63 6f 64 65 20 63 61 6e  |ytes of code can|
00001df0  20 62 65 20 61 64 64 65  64 20 74 6f 20 74 68 65  | be added to the|
00001e00  0d 70 72 6f 67 72 61 6d  20 74 6f 20 70 72 65 76  |.program to prev|
00001e10  65 6e 74 20 74 68 69 73  3a 2d 0d 0d 20 20 20 20  |ent this:-..    |
00001e20  20 20 20 20 20 20 33 32  30 20 50 4c 50 0d 20 20  |      320 PLP.  |
00001e30  20 20 20 20 20 20 20 20  33 33 30 20 52 54 53 0d  |        330 RTS.|
00001e40  0d 20 20 20 20 20 20 20  20 20 20 54 68 69 73 20  |.          This |
00001e50  61 6c 74 65 72 61 74 69  6f 6e 20 61 6c 73 6f 20  |alteration also |
00001e60  73 74 6f 70 73 20 2a 46  58 31 35 20 61 6e 64 20  |stops *FX15 and |
00001e70  2a 46 58 32 31 2c 33 20  20 66 72 6f 6d 20 20 66  |*FX21,3  from  f|
00001e80  6c 75 73 68 69 6e 67 0d  74 68 65 20 20 70 72 69  |lushing.the  pri|
00001e90  6e 74 65 72 20 20 62 75  66 66 65 72 20 20 62 75  |nter  buffer  bu|
00001ea0  74 20 20 64 6f 65 73 20  20 6e 6f 74 20 61 66 66  |t  does  not aff|
00001eb0  65 63 74 20 74 68 65 20  6e 6f 72 6d 61 6c 20 61  |ect the normal a|
00001ec0  63 74 69 6f 6e 20 6f 66  20 74 68 65 73 65 0d 63  |ction of these.c|
00001ed0  6f 6d 6d 61 6e 64 73 20  6f 72 20 45 53 43 41 50  |ommands or ESCAP|
00001ee0  45 20 6f 6e 20 61 6c 6c  20 74 68 65 20 6f 74 68  |E on all the oth|
00001ef0  65 72 20 62 75 66 66 65  72 73 2e 20 54 68 65 20  |er buffers. The |
00001f00  70 72 69 6e 74 65 72 20  20 62 75 66 66 65 72 20  |printer  buffer |
00001f10  20 63 61 6e 2c 0d 68 6f  77 65 76 65 72 2c 20 73  | can,.however, s|
00001f20  74 69 6c 6c 20 62 65 20  66 6c 75 73 68 65 64 20  |till be flushed |
00001f30  75 73 69 6e 67 20 2a 46  58 31 32 38 2c 31 32 38  |using *FX128,128|
00001f40  2e 0d 0d 20 20 20 20 20  20 20 20 20 20 20 20 20  |...             |
00001f50  20 20 20 20 20 20 20 20  20 20 20 4d 41 43 48 49  |           MACHI|
00001f60  4e 45 20 43 4f 44 45 20  52 4f 55 54 49 4e 45 53  |NE CODE ROUTINES|
00001f70  0d 0d 20 20 20 20 20 20  20 20 20 20 0d 20 20 20  |..          .   |
00001f80  20 20 20 20 20 20 20 73  65 74 20 20 20 20 20 20  |       set      |
00001f90  20 20 4d 6f 76 65 20 69  6e 73 65 72 74 20 76 65  |  Move insert ve|
00001fa0  63 74 6f 72 20 66 72 6f  6d 20 26 32 32 41 2c 42  |ctor from &22A,B|
00001fb0  20 74 6f 20 69 6e 73 65  72 74 31 0d 20 20 20 20  | to insert1.    |
00001fc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001fd0  20 4d 6f 76 65 20 72 65  6d 6f 76 65 20 76 65 63  | Move remove vec|
00001fe0  74 6f 72 20 66 72 6f 6d  20 26 32 32 43 2c 44 20  |tor from &22C,D |
00001ff0  74 6f 20 72 65 6d 6f 76  65 31 0d 20 20 20 20 20  |to remove1.     |
00002000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002010  4d 6f 76 65 20 63 6f 75  6e 74 2f 70 75 72 67 65  |Move count/purge|
00002020  20 76 65 63 74 6f 72 20  66 72 6f 6d 20 26 32 32  | vector from &22|
00002030  45 2c 46 20 74 6f 20 63  6f 75 6e 74 31 0d 20 20  |E,F to count1.  |
00002040  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002050  20 20 20 53 74 6f 72 65  20 69 6e 73 65 72 74 32  |   Store insert2|
00002060  20 61 64 64 72 65 73 73  20 61 74 20 26 32 32 41  | address at &22A|
00002070  2c 42 0d 20 20 20 20 20  20 20 20 20 20 20 20 20  |,B.             |
00002080  20 20 20 20 20 20 20 20  53 74 6f 72 65 20 72 65  |        Store re|
00002090  6d 6f 76 65 32 20 61 64  64 72 65 73 73 20 61 74  |move2 address at|
000020a0  20 26 32 32 43 2c 44 0d  20 20 20 20 20 20 20 20  | &22C,D.        |
000020b0  20 20 20 20 20 20 20 20  20 20 20 20 20 53 74 6f  |             Sto|
000020c0  72 65 20 63 6f 75 6e 74  32 20 61 64 64 72 65 73  |re count2 addres|
000020d0  73 20 61 74 20 26 32 32  45 2c 46 0d 20 20 20 20  |s at &22E,F.    |
000020e0  20 20 20 20 20 20 0d 20  20 20 20 20 20 20 20 20  |      .         |
000020f0  20 69 6e 73 32 20 20 20  20 20 20 20 4e 65 77 20  | ins2       New |
00002100  69 6e 73 65 72 74 20 72  6f 75 74 69 6e 65 0d 20  |insert routine. |
00002110  20 20 20 20 20 20 20 20  20 0d 20 20 20 20 20 20  |         .      |
00002120  20 20 20 20 6f 6c 64 31  20 20 20 20 20 20 20 44  |    old1       D|
00002130  69 76 65 72 74 20 74 6f  20 6f 72 69 67 69 6e 61  |ivert to origina|
00002140  6c 20 69 6e 73 65 72 74  20 72 6f 75 74 69 6e 65  |l insert routine|
00002150  0d 20 20 20 20 20 20 20  20 20 20 0d 20 20 20 20  |.          .    |
00002160  20 20 20 20 20 20 72 65  6d 32 20 20 20 20 20 20  |      rem2      |
00002170  20 4e 65 77 20 72 65 6d  6f 76 65 20 72 6f 75 74  | New remove rout|
00002180  69 6e 65 0d 20 20 20 20  20 20 20 20 20 20 0d 20  |ine.          . |
00002190  20 20 20 20 20 20 20 20  20 6f 6c 64 32 20 20 20  |         old2   |
000021a0  20 20 20 20 44 69 76 65  72 74 20 74 6f 20 6f 72  |    Divert to or|
000021b0  69 67 69 6e 61 6c 20 72  65 6d 6f 76 65 20 72 6f  |iginal remove ro|
000021c0  75 74 69 6e 65 0d 20 20  20 20 20 20 20 20 20 20  |utine.          |
000021d0  0d 20 20 20 20 20 20 20  20 20 20 63 6e 74 32 20  |.          cnt2 |
000021e0  20 20 20 20 20 20 4e 65  77 20 63 6f 75 6e 74 2f  |      New count/|
000021f0  70 75 72 67 65 20 72 6f  75 74 69 6e 65 0d 20 20  |purge routine.  |
00002200  20 20 20 20 20 20 20 20  0d 20 20 20 20 20 20 20  |        .       |
00002210  20 20 20 66 6c 73 68 20  20 20 20 20 20 20 52 65  |   flsh       Re|
00002220  73 65 74 73 20 72 65 61  64 20 61 6e 64 20 77 72  |sets read and wr|
00002230  69 74 65 20 61 64 64 72  65 73 73 65 73 20 74 6f  |ite addresses to|
00002240  20 73 74 61 72 74 0d 20  20 20 20 20 20 20 20 20  | start.         |
00002250  20 20 20 20 20 20 20 20  20 20 20 20 73 65 74 73  |            sets|
00002260  20 66 6c 61 67 20 74 6f  20 65 6d 70 74 79 0d 20  | flag to empty. |
00002270  20 20 20 20 20 20 20 20  20 0d 20 20 20 20 20 20  |         .      |
00002280  20 20 20 20 6f 6c 64 33  20 20 20 20 20 20 20 44  |    old3       D|
00002290  69 76 65 72 74 20 74 6f  20 6f 6c 64 20 63 6f 75  |ivert to old cou|
000022a0  6e 74 2f 70 75 72 67 65  20 72 6f 75 74 69 6e 65  |nt/purge routine|
000022b0  0d 20 20 20 20 20 20 20  20 20 20 0d 20 20 20 20  |.          .    |
000022c0  20 20 20 20 20 20 53 20  20 20 20 20 20 20 20 20  |      S         |
000022d0  20 53 75 62 72 6f 75 74  69 6e 65 20 74 6f 20 75  | Subroutine to u|
000022e0  70 64 61 74 65 20 72 65  61 64 20 61 6e 64 20 77  |pdate read and w|
000022f0  72 69 74 65 20 61 64 64  72 65 73 73 65 73 0d 0d  |rite addresses..|
00002300  0d 0d 0d 0d 0d 0d 0d 0d  0d 0d 0d 0d 0d 0d 0d 0d  |................|
00002310  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00002320  20 20 20 20 20 20 20 20  20 20 20 49 2f 4f 20 50  |           I/O P|
00002330  72 69 6e 74 65 72 20 42  75 66 66 65 72 20 20 4d  |rinter Buffer  M|
00002340  2e 4a 2e 52 61 77 6c 69  6e 67 73 20 2d 20 50 41  |.J.Rawlings - PA|
00002350  47 45 20 3a 20 35 0d 0d  0d 0d 0d 0d 20 20 20 20  |GE : 5......    |
00002360  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002370  20 20 20 20 20 20 20 20  20 20 56 41 52 49 41 42  |          VARIAB|
00002380  4c 45 53 0d 0d 20 20 20  20 20 20 20 20 20 20 0d  |LES..          .|
00002390  20 20 20 20 20 20 20 20  20 20 69 6e 73 31 20 20  |          ins1  |
000023a0  20 20 20 20 20 52 65 6c  6f 63 61 74 65 64 20 61  |     Relocated a|
000023b0  64 64 72 65 73 73 20 66  6f 72 20 6f 6c 64 20 69  |ddress for old i|
000023c0  6e 73 65 72 74 20 76 65  63 74 6f 72 0d 20 20 20  |nsert vector.   |
000023d0  20 20 20 20 20 20 20 0d  20 20 20 20 20 20 20 20  |       .        |
000023e0  20 20 72 65 6d 31 20 20  20 20 20 20 20 52 65 6c  |  rem1       Rel|
000023f0  6f 63 61 74 65 64 20 61  64 64 72 65 73 73 20 66  |ocated address f|
00002400  6f 72 20 6f 6c 64 20 72  65 6d 6f 76 65 20 76 65  |or old remove ve|
00002410  63 74 6f 72 0d 20 20 20  20 20 20 20 20 20 20 0d  |ctor.          .|
00002420  20 20 20 20 20 20 20 20  20 20 63 6e 74 31 20 20  |          cnt1  |
00002430  20 20 20 20 20 52 65 6c  6f 63 61 74 65 64 20 61  |     Relocated a|
00002440  64 64 72 65 73 73 20 66  6f 72 20 6f 6c 64 20 63  |ddress for old c|
00002450  6f 75 6e 74 2f 70 75 72  67 65 20 76 65 63 74 6f  |ount/purge vecto|
00002460  72 0d 20 20 20 20 20 20  20 20 20 20 0d 20 20 20  |r.          .   |
00002470  20 20 20 20 20 20 20 69  6e 73 20 20 20 20 20 20  |       ins      |
00002480  20 20 41 64 64 72 65 73  73 20 6f 66 20 6e 65 78  |  Address of nex|
00002490  74 20 66 72 65 65 20 73  70 61 63 65 20 66 6f 72  |t free space for|
000024a0  20 69 6e 73 65 72 74 69  6f 6e 0d 20 20 20 20 20  | insertion.     |
000024b0  20 20 20 20 20 0d 20 20  20 20 20 20 20 20 20 20  |     .          |
000024c0  72 65 6d 20 20 20 20 20  20 20 20 41 64 64 72 65  |rem        Addre|
000024d0  73 73 20 6f 66 20 6e 65  78 74 20 63 68 61 72 61  |ss of next chara|
000024e0  63 74 65 72 20 74 6f 20  62 65 20 72 65 6d 6f 76  |cter to be remov|
000024f0  65 64 0d 20 20 20 20 20  20 20 20 20 20 0d 20 20  |ed.          .  |
00002500  20 20 20 20 20 20 20 20  65 78 74 20 20 20 20 20  |        ext     |
00002510  20 20 20 4e 6f 20 6f 66  20 63 68 61 72 61 63 74  |   No of charact|
00002520  65 72 73 20 73 74 69 6c  6c 20 72 65 6d 61 69 6e  |ers still remain|
00002530  69 6e 67 20 69 6e 20 62  75 66 66 65 72 0d 20 20  |ing in buffer.  |
00002540  20 20 20 20 20 20 20 20  0d 20 20 20 20 20 20 20  |        .       |
00002550  20 20 20 66 20 20 20 20  20 20 20 20 20 20 49 6e  |   f          In|
00002560  64 69 63 61 74 65 73 20  73 74 61 74 65 20 6f 66  |dicates state of|
00002570  20 62 75 66 66 65 72 0d  20 20 20 20 20 20 20 20  | buffer.        |
00002580  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002590  20 30 20 3d 20 62 75 66  66 65 72 20 6e 6f 74 20  | 0 = buffer not |
000025a0  69 6e 20 75 73 65 0d 20  20 20 20 20 20 20 20 20  |in use.         |
000025b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000025c0  31 20 3d 20 62 75 66 66  65 72 20 69 6e 20 75 73  |1 = buffer in us|
000025d0  65 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |e.              |
000025e0  20 20 20 20 20 20 20 20  20 20 20 32 20 3d 20 62  |           2 = b|
000025f0  75 66 66 65 72 20 65 6d  70 74 79 0d 20 20 20 20  |uffer empty.    |
00002600  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002610  20 20 20 20 20 33 20 3d  20 62 75 66 66 65 72 20  |     3 = buffer |
00002620  66 75 6c 6c 0d 20 20 20  20 20 20 20 20 20 20 0d  |full.          .|
00002630  20 20 20 20 20 20 20 20  20 20 73 74 61 72 74 20  |          start |
00002640  20 20 20 20 20 53 74 61  72 74 20 61 64 64 72 65  |     Start addre|
00002650  73 73 20 6f 66 20 62 75  66 66 65 72 0d 20 20 20  |ss of buffer.   |
00002660  20 20 20 20 20 20 20 0d  20 20 20 20 20 20 20 20  |       .        |
00002670  20 20 65 6e 64 20 20 20  20 20 20 20 20 45 6e 64  |  end        End|
00002680  20 61 64 64 72 65 73 73  20 6f 66 20 62 75 66 66  | address of buff|
00002690  65 72 0d 20 20 20 20 20  20 20 20 20 20 0d 20 20  |er.          .  |
000026a0  20 20 20 20 20 20 20 20  69 6e 69 74 20 20 20 20  |        init    |
000026b0  20 20 20 41 64 64 72 65  73 73 20 6f 66 20 64 61  |   Address of da|
000026c0  74 61 20 66 6f 72 20 69  6e 69 74 69 61 6c 69 73  |ta for initialis|
000026d0  69 6e 67 20 62 75 66 66  65 72 0d 20 20 20 20 20  |ing buffer.     |
000026e0  20 20 20 20 20 0d 20 20  20 20 20 20 20 20 20 20  |     .          |
000026f0  6f 73 63 20 20 20 20 20  20 20 20 41 64 64 72 65  |osc        Addre|
00002700  73 73 20 6f 66 20 73 74  72 69 6e 67 20 75 73 65  |ss of string use|
00002710  64 20 66 6f 72 20 4f 53  43 4c 49 20 63 61 6c 6c  |d for OSCLI call|
00002720  0d 20 20 20 20 20 20 20  20 20 20 0d 20 20 20 20  |.          .    |
00002730  20 20 20 20 20 20 73 76  65 20 20 20 20 20 20 20  |      sve       |
00002740  20 41 64 64 72 65 73 73  20 6f 66 20 73 74 72 69  | Address of stri|
00002750  6e 67 20 66 6f 72 20 72  65 6c 6f 63 61 74 69 6f  |ng for relocatio|
00002760  6e 20 61 64 64 72 65 73  73 0d 20 20 20 20 20 20  |n address.      |
00002770  20 20 20 20 0d 0d 20 20  20 20 20 20 20 20 20 20  |    ..          |
00002780  20 20 20 20 20 20 20 20  20 20 20 20 20 43 55 53  |             CUS|
00002790  54 4f 4d 49 53 49 4e 47  20 54 48 45 20 50 52 4f  |TOMISING THE PRO|
000027a0  47 52 41 4d 0d 0d 20 20  20 20 20 20 20 20 20 20  |GRAM..          |
000027b0  54 68 65 20 20 70 61 72  74 73 20 6f 66 20 74 68  |The  parts of th|
000027c0  65 20 70 72 6f 67 72 61  6d 20 74 68 61 74 20 63  |e program that c|
000027d0  61 6e 20 62 65 20 63 75  73 74 6f 6d 69 73 65 64  |an be customised|
000027e0  20 61 72 65 20 63 6c 65  61 72 6c 79 0d 6d 61 72  | are clearly.mar|
000027f0  6b 65 64 20 77 69 74 68  20 52 45 4d 20 73 74 61  |ked with REM sta|
00002800  74 65 6d 65 6e 74 73 2e  20 54 68 65 20 20 70 72  |tements. The  pr|
00002810  6f 67 72 61 6d 20 20 63  6f 6e 74 61 69 6e 73 20  |ogram  contains |
00002820  20 69 74 73 20 20 6f 77  6e 20 20 64 65 74 61 69  | its  own  detai|
00002830  6c 65 64 0d 74 65 73 74  73 20 20 77 68 69 63 68  |led.tests  which|
00002840  20 20 75 73 65 20 20 74  68 65 20 20 62 75 66 66  |  use  the  buff|
00002850  65 72 20 69 6e 20 6f 72  64 65 72 20 74 6f 20 74  |er in order to t|
00002860  65 73 74 20 69 74 20 61  6e 64 20 77 69 6c 6c 20  |est it and will |
00002870  72 65 70 6f 72 74 20 61  6e 79 0d 65 72 72 6f 72  |report any.error|
00002880  73 20 66 6f 75 6e 64 2e  20 54 68 65 73 65 20 74  |s found. These t|
00002890  65 73 74 73 20 6d 61 79  20 6f 76 65 72 77 72 69  |ests may overwri|
000028a0  74 65 20 74 68 65 20 20  70 72 6f 67 72 61 6d 20  |te the  program |
000028b0  20 73 6f 20 20 72 65 6d  65 6d 62 65 72 20 20 74  | so  remember  t|
000028c0  6f 0d 73 61 76 65 20 20  69 74 20 20 66 69 72 73  |o.save  it  firs|
000028d0  74 2e 20 41 6c 73 6f 20  6d 61 6b 65 20 73 75 72  |t. Also make sur|
000028e0  65 20 74 68 61 74 20 79  6f 75 72 20 70 72 69 6e  |e that your prin|
000028f0  74 65 72 20 69 73 20 74  75 72 6e 65 64 20 6f 66  |ter is turned of|
00002900  66 20 62 65 66 6f 72 65  0d 72 75 6e 6e 69 6e 67  |f before.running|
00002910  20 74 68 65 20 70 72 6f  67 72 61 6d 2e 20 49 6e  | the program. In|
00002920  20 66 61 63 74 20 69 6e  20 6f 72 64 65 72 20 20  | fact in order  |
00002930  74 6f 20 20 61 76 6f 69  64 20 20 74 68 65 20 20  |to  avoid  the  |
00002940  70 6f 73 73 69 62 69 6c  69 74 79 20 20 6f 66 0d  |possibility  of.|
00002950  73 61 76 69 6e 67 20 20  61 20 20 63 6f 72 72 75  |saving  a  corru|
00002960  70 74 65 64 20 20 76 65  72 73 69 6f 6e 20 20 6f  |pted  version  o|
00002970  66 20 20 74 68 65 20 20  70 72 6f 67 72 61 6d 20  |f  the  program |
00002980  69 74 20 69 73 20 64 65  73 69 67 6e 65 64 20 74  |it is designed t|
00002990  6f 20 73 65 6c 66 0d 64  65 73 74 72 75 63 74 20  |o self.destruct |
000029a0  61 66 74 65 72 20 74 68  65 20 63 6f 64 65 20 68  |after the code h|
000029b0  61 73 20 62 65 65 6e 20  73 61 76 65 64 21 20 49  |as been saved! I|
000029c0  66 20 20 61 6c 6c 20 20  69 73 20 20 77 65 6c 6c  |f  all  is  well|
000029d0  20 20 79 6f 75 20 20 73  68 6f 75 6c 64 0d 73 65  |  you  should.se|
000029e0  65 3a 2d 0d 0d 0d 20 20  20 20 20 20 20 20 20 20  |e:-...          |
000029f0  20 20 20 20 20 53 41 56  45 20 50 52 4e 54 42 55  |     SAVE PRNTBU|
00002a00  46 20 37 41 30 30 20 37  41 46 39 20 46 46 46 46  |F 7A00 7AF9 FFFF|
00002a10  37 41 30 30 20 46 46 46  46 37 41 30 30 0d 20 20  |7A00 FFFF7A00.  |
00002a20  20 20 20 20 20 20 20 20  20 20 20 20 20 0d 20 20  |             .  |
*
00002a50  20 20 20 20 20 20 20 20  20 20 20 20 20 42 61 64  |             Bad|
00002a60  20 70 72 6f 67 72 61 6d  0d 20 20 20 20 20 20 20  | program.       |
00002a70  20 20 20 20 20 20 20 20  3e 0d 20 20 20 20 20 20  |        >.      |
00002a80  20 20 20 20 20 20 20 20  20 0d 20 20 20 20 20 20  |         .      |
00002a90  20 20 20 20 20 20 20 20  20 0d 0d 0d 0d 0d 0d 0d  |         .......|
00002aa0  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00002ab0  20 20 20 20 20 20 20 20  20 20 49 2f 4f 20 50 72  |          I/O Pr|
00002ac0  69 6e 74 65 72 20 42 75  66 66 65 72 20 20 4d 2e  |inter Buffer  M.|
00002ad0  4a 2e 52 61 77 6c 69 6e  67 73 20 2d 20 50 41 47  |J.Rawlings - PAG|
00002ae0  45 20 3a 20 36 0d 0d 0d  0d 0d 0d 20 20 20 20 20  |E : 6......     |
00002af0  20 20 20 20 20 54 68 65  20 20 66 69 6e 61 6c 20  |     The  final |
00002b00  20 74 65 73 74 20 20 69  73 2c 20 6f 66 20 63 6f  | test  is, of co|
00002b10  75 72 73 65 2c 20 74 6f  20 75 73 65 20 74 68 65  |urse, to use the|
00002b20  20 62 75 66 66 65 72 20  6f 6e 20 61 20 6c 6f 6e  | buffer on a lon|
00002b30  67 0d 70 72 69 6e 74 20  72 75 6e 2c 20 70 72 65  |g.print run, pre|
00002b40  66 65 72 61 62 6c 79 20  6c 6f 6e 67 65 72 20 74  |ferably longer t|
00002b50  68 61 6e 20 74 68 65 20  62 75 66 66 65 72 20 73  |han the buffer s|
00002b60  69 7a 65 2c 20 74 6f 20  63 6f 6e 66 69 72 6d 20  |ize, to confirm |
00002b70  20 63 6f 72 72 65 63 74  0d 62 75 66 66 65 72 20  | correct.buffer |
00002b80  22 77 72 61 70 20 61 72  6f 75 6e 64 22 2e 0d 0d  |"wrap around"...|
00002b90  20 20 20 20 20 20 20 20  20 20 4e 65 78 74 20 20  |          Next  |
00002ba0  77 65 65 6b 20 20 77 65  20 77 69 6c 6c 20 62 65  |week  we will be|
00002bb0  20 62 72 6f 61 64 63 61  73 74 69 6e 67 20 61 20  | broadcasting a |
00002bc0  70 72 6f 67 72 61 6d 20  74 68 61 74 20 77 69 6c  |program that wil|
00002bd0  6c 20 67 69 76 65 0d 74  68 65 20 49 2f 4f 20 70  |l give.the I/O p|
00002be0  72 69 6e 74 65 72 20 62  75 66 66 65 72 20 61 20  |rinter buffer a |
00002bf0  74 68 6f 72 6f 75 67 68  20 74 65 73 74 3a 2d 20  |thorough test:- |
00002c00  61 20 70 72 6f 67 72 61  6d 20 74 68 61 74 20 69  |a program that i|
00002c10  6e 63 6f 72 70 6f 72 61  74 65 73 20 61 0d 74 65  |ncorporates a.te|
00002c20  6c 65 74 65 78 74 20 70  61 67 65 20 73 74 6f 72  |letext page stor|
00002c30  61 67 65 20 73 79 73 74  65 6d 20 63 61 70 61 62  |age system capab|
00002c40  6c 65 20 6f 66 20 73 74  6f 72 69 6e 67 20 20 75  |le of storing  u|
00002c50  70 20 20 74 6f 20 20 37  36 34 20 20 74 65 6c 65  |p  to  764  tele|
00002c60  74 65 78 74 0d 70 61 67  65 73 20 20 6f 6e 20 6f  |text.pages  on o|
00002c70  6e 65 20 64 69 73 6b 20  28 64 65 70 65 6e 64 69  |ne disk (dependi|
00002c80  6e 67 20 6f 6e 20 74 79  70 65 20 6f 66 20 44 46  |ng on type of DF|
00002c90  53 20 61 6e 64 20 64 72  69 76 65 29 2c 20 74 6f  |S and drive), to|
00002ca0  67 65 74 68 65 72 20 77  69 74 68 0d 69 6e 73 74  |gether with.inst|
00002cb0  61 6e 74 20 70 72 69 6e  74 6f 75 74 20 61 6e 64  |ant printout and|
00002cc0  20 65 64 69 74 69 6e 67  20 66 61 63 69 6c 69 74  | editing facilit|
00002cd0  69 65 73 2e 0d 0d                                 |ies...|
00002cd6
BUF\INF.m0
BUF\INF.m1
BUF\INF.m2
BUF\INF.m4
BUF\INF.m5