Home » CEEFAX disks » telesoftware3.adl » 23_10_87/T\SWR01

23_10_87/T\SWR01

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 » telesoftware3.adl
Filename: 23_10_87/T\SWR01
Read OK:
File size: 4789 bytes
Load address: 0000
Exec address: 0000
Duplicates

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

File contents
Mastering Sideways ROM & RAM - Module 01 - Introduction
-------------------------------------------------------

  It is possible to write sideways ram software on a BBC B or B+ 64k
without sideways ram but, if you use one of these machines, it will
save you a great deal of time blowing and erasing eproms if SWR is
available to test the software as it is being developed.

  Adding SWR to the BBC B+ 64k is very straightforward as Acorn
produce a 64k SWR upgrade which can be fitted by Acorn dealers. Don't
attempt to fit it yourself unless you are absolutely sure you have the
skill needed to complete the job.

  Fitting an SWR upgrade to the BBC B is a job most users can attempt
without incuring a dealer's service charge. There are many sideways
ram and rom boards available which can be fitted without soldering any
components. You should look carefully at the facilities offered by the
various manufacturers of SWR boards and choose the board that best
suits your needs. I recommend that you consider the following points
when you look for a SWR board.

1.  A mimimum of 16k of sideways ram is required. 32k or 64k is useful
but not essential. Most boards which use static rams do so because the
design is much simpler. There is an old designer's joke that the
difference between static and dynamic ram is that static ram works.
Don't let this nonsense prevent you buying a dynamic ram board.

2.  Physical switching for read and write protection of the SWR is
highly desirable. Read protection will be used to switch out the
offending memory when you load an invalid rom image which causes the
computer to hang up. Write protection is useful if you want to develop
rom images that are protected against running in SWR. Software
switching of read and write protection is a poor substitute for real
switches that click.

3.  Look carefully at the way in which flying leads are attached to
the main computer circuit board. Compare the different methods
manufacturers use. Some boards use quite unprofessional design
techniques.

4.  Battery backup of SWR is useful, but not essential.

5.  Many SWR boards have sockets for extra roms. The BBC B MOS will
support up to sixteen sideways rom or ram banks. The main circuit
board has only four sideways rom sockets, two of which are taken up
with BASIC and the DFS. The extra sockets on a sideways ram/rom board
will be useful if you have more roms than rom sockets.

  There are a number of manufacturers who produce boards which meet
these requirements to a greater or lesser extent. Which manufacturer
you choose is up to you. You can be sure that all the boards produced
by reputable companies will perform adequately but it is not possible
to recommend one board as better in every respect than any other.

  When you have fitted the upgrade board into your computer you might
want to store the programs contained in your roms on disc or tape and
then load and run the rom images in SWR. All Acorn supported languages
will run in unprotected SWR and most rom images will run in write
protected SWR.

  Where the copyright of the software  contained in a rom is not owned
by Acorn, specific permission must be obtained from the owner of the
copyright before copying it onto disc or tape.

  In Acorn's User Guide (Part no. 408000, Issue no. 2, March 1984,
page 20) it states "... you can keep a library of paged roms on disc,
which can be called up in the same way as roms installed inside the
BBC Microcomputer. However, in using this facility you must ensure
that you do not infringe the rights of the owner of the copyright of
the program contained in the rom".

  As long as you do not infringe the rights of the owner of the
copyright of the program, roms can be saved onto a library disc and
run in ram. Some software producers take a less enlightened view than
Acorn take to running their roms in SWR and attempt to protect them
against it. Most of this protection does little to deter professional
software pirates but it should be taken as an indicator of the
copyright owner's unwillingness to allow his or her work to be used in
SWR.

  If you want to ensure that your own work will only run in eproms and
not in SWR there are a number of techniques you can try. An 8k rom
image is duplicated from &A000 and one of the methods of protecting 8k
rom images is to add &2000 to the subroutine and jump addresses.
Another, far less common, method is to prevent the rom image running
in socket &0F. This socket is commonly used for SWR on rom boards and
the only way to get these rom images to run in socket &0F is to
disassemble and modify them. When you have completed this course you
will certainly know what to look for in a rom disassembly if you
wanted to do this but it is quite a good way of detering most amateur
rom pilferers.

  I will now begin to explore the programming techniques needed to use
SWR. There are a number of MOS subroutines, memory locations and
registers associated with SWR. Rather than examine them all now I will
consider the calls and locations as they arise throughout the course.
In this module I will look at the paged rom select register at &FE30,
the paged memory select register at &FE34, the MOS subroutine Osrdrm,
and Osbytes &72 and &AA.

  There are differences in the way in which the paged rom select
register and the paged memory select register are used in the BBC B,
the BBC B+ and the Master computers. The reason for the differences
can be seen by examining the memory maps of these machines (figures
1.1, 1.2 and 1.3).



                              &FFFF +-------+ &FFFF
                                    !       !  
                                    !  MOS  !
                                    !       !         
    &BFFF --+-------+-------+-------+-------+ &C000
            ! ROM &C! ROM &D! ROM &E! ROM &F!
            !       !       !       !       !
            !       !       !  DFS  ! BASIC !
    &8000 --+-------+-------+-------+-------+ &7FFF
    Up to 16 sideways rom/ram banks !       !
                                    !  User !
                                    ! memory!
                                    !       !
                                    !       !
                              &1900 +-------+ Oshwm 
                                    !       !       
                              &0000 +-------+ &0000

Figure 1.1 Memory map of the BBC B
----------------------------------


  The BBC B MOS supports up to sixteen paged roms although an
expansion board is required if more than four roms are to be used. The
paged rom select register at &FE30 is a 4 bit write only register
which determines which of the 16 roms is switched into the main memory
map. If you want to read the contents of this register you should read
the zero page copy of it at &F4. The most significant nybble of the
paged rom select register is not used on the BBC B.



                              &FFFF +-------+ &FFFF
                                    !       !  
                                    !  MOS  !
                                    !       !         
    &BFFF --+-------+-------+-------+-------+ &C000
            ! ROM &C! ROM &D! ROM &E! ROM &F+-------+ &AFFF
            !       !       !       !       ! Paged !
            !       !       !  DFS  ! BASIC ! memory! 
    &8000 --+-------+-------+-------+-------+-------+ &8000
    Up to 16 sideways rom/ram banks !       !       !
                                    !  User ! Shadow!
                                    ! memory!  ram  !
                                    !       !       !
                                    !       +-------+ &3000
                              &1900 +-------+ Oshwm 
                                    !       !       
                              &0000 +-------+ &0000

Figure 1.2 Memory map of the BBC B+
-----------------------------------


  The BBC B+ has a similar memory map to the BBC B but in addition to
the paged roms it also supports paged or shadow memory. The paged
memory (shadow ram) select register at &FE34 is used to determine
whether or not the shadow ram is used as screen memory. This register
should only be altered using Osbyte &72 (*FX114) or the command
*SHADOW. The BBC B+ has a "spare" 12k of paged memory from &8000 to
&AFFF. This can be switched in or out of the main memory map using the
most significant bit of the paged rom select register at &FE30.
Setting the most significant bit of the paged rom select register has
no effect on the BBC B but on the BBC B+ it switches the paged memory
from &8000 to &AFFF into the main memory map. BBC Telesoftware has
broadcast a program that uses this technique to allow BBC B+ 64k
computer users to load and run 8k service roms in this area of paged
memory.

  The Master computer uses a slightly different memory map to the B
series. The "spare" 12k of paged memory has now been split into two
areas, one from &8000 to &8FFF and the other from &C000 to &DFFF. The
paged ram from &8000 to &8FFF is used by the MOS as a soft key buffer,
character font, and VDU workspace. The paged ram from &C000 to &DCFF
is available as paged rom workspace and the paged ram from &DD00 to
&DFFF is used as MOS workspace.




                              &FFFF +-------+ &FFFF
                                    !       !  
                                    !  MOS  +-------+ &DFFF
                                    !       !Wkspace! 
    &BFFF --+-------+-------+-------+-------+-------+ &C000
            ! ROM &C! ROM &D! ROM &E! ROM &F!
            !       !       !       !       !
            ! BASIC ! ADFS  ! View  ! Term. +-------+ &8FFF
    &8000 --+-------+-------+-------+-------+-------+ &8000
    Up to 16 Sideways rom/ram banks !       !       !
                                    !  User ! Shadow!
                                    ! memory!  ram  !
                                    !       !       !
                                    !       +-------+ &3000
                                    !       !
                              &0E00 +-------+ Oshwm 
                              &0000 +-------+ &0000

Figure 1.3 Memory map of the BBC Master
---------------------------------------


  Paged rom workspace on the BBC B and B+ is just below the user
memory. The BBC B DFS claims 2.75k of workspace from &0E00 to &1900.
This workspace can be in paged memory on the Master series allowing
Oshwm to stay at &0E00 with all filing systems. Bit 3 of the paged
memory select register at &FE34 is used to overlay the paged rom
workspace onto the Master MOS so that it appears above the paged rom
using it. Bit 3 of the paged memory select register can be toggled
directly but you must not directly alter any other bit in this
register. This topic will be covered in more detail in modules 11 and
12 which deal with paged rom workspace.

  The use of the least significant nybble of the paged rom select
register at is common to all BBC micros. The operating system uses
this register, and the zero page copy of it at &F4, to keep track of
which paged rom is being used at any time. If you want to alter this
register directly you can only do so from machine code. If you alter
it from BASIC or any other language rom you will cause the computer to
hang up.

  The order in which the paged rom select register and its copy at &F4
are altered is important. You must store the same number in both
locations and alter &F4 first. Immediatly after altering &F4 you must
store the same value in &FE30. For example:

  LDA #&0A
  STA &F4
  STA &FE30

  This code will switch bank &0A into the main memory map. If you
reverse the order of the last two instructions you will find that 99%
of the time everything works properly but, sooner or later, an
interupt occuring between the two store instructions will cause to
computer to hang up. Switching a paged rom into the main memory map in
this way can be quite useful if you want to transfer the contents of a
rom into user memory or transfer the contents of user memory into a
particular sideways ram.

  There is an official way to read a byte of memory from any paged
rom. This uses the operating system call Osrdrm at &FFB9 with the
relevant paged rom number in the Y register and the address of the
byte in the paged rom in locations &F6 and &F7 (the paged rom
pointers). The value of the byte read by Osrdrm is returned in the
accumulator. The X, Y and status registers will be undefined after the
call.

  Both these techniques are demonstrated in the program READROM. When
the program is running it uses Osrdrm to read the title string in
every rom socket that has an active rom image and then prompts the
user to choose which rom number, from 0-15, to switch into the main
memory map. The chosen rom is switched in and copied from &8000 to
&3C00 and then switched back out again. The rom image can then be
examined and, if required, saved to the currently active filing
system. Although some of the program is in BASIC the switching and
copying can only be done in machine code.

  The program uses Osbyte &AA to find the start of the rom information
table. This call returns the origin of a 16 byte table containing one
byte per paged rom. Each byte contains the rom type byte contained in
location &8006 of the rom or contains zero if an active rom is not
present. Rom type bytes are an important part of the rom header and
will be dealt with in more detail when rom headers are considered in
module 2.

  Chain the program READROM and satisfy yourself that it works
properly. It must run in the I/O processor and will not work in a
second processor.

  There are two machine code routines used in the program. The first
(lines 200-430) is called once for each possible rom number from 0 to
15. It looks up the address of the start of the rom information table
with Osbyte &AA (lines 210-240) and then uses the number of the rom as
an offset in the Y register to see if there is a valid rom in the
socket being considered (line 280). If there is a valid rom image
present the routine reads the title of the rom using Osrdrm and
displays it on the screen (lines 340-430). The rom title always starts
at &8009 in a valid rom image and always ends with a binary zero.

  The second machine code routine is in lines 440-700. This stores the
current rom number (lines 450-460) before switching the chosen rom
into the main memory map (lines 470-490). It then copies the chosen
rom image into user memory (lines 500-660), and finally switches the
original rom back into the main memory map (lines 670-690).

  The BASIC part of the program is mainly concerned with displaying
the copy of the rom image on the screen (lines 860-990) and, if
required, with saving a copy of the rom image onto disc or tape
(PROCsave, lines 1000-1190). Before it makes a copy of the rom image
onto disc the program compares the first &100 bytes of the image with
&100 bytes 8k higher in memory (lines 1090-1110). If every pair of
&100 bytes is identical the rom is recognised as an 8k image and only
the first &2000 bytes are saved.

  The program READROM, as well as illustrating the techniques
described above, will be useful in later modules when you will want to
examine or save the contents of sideways ram banks. The program can be
modified to produce another program to load rom images into any
sideways ram bank, including the paged memory bank of the BBC B+. This
has been left as an exercise for you to complete.



   10 REM: READROM
   20 MODE7
   30 HIMEM=&3C00
   40 DIM mcode &100
   50 select=&FE30
   60 osrdrm=&FFB9
   70 osasci=&FFE3
   80 osbyte=&FFF4
   90 oscli=&FFF7
  100 copy=&70
  110 temp=&71
  120 read=&72
  130 write=&74
  140 romnumber=&F4
  150 rompoint=&F6
  160 ON ERROR PRINT : END
  170 FOR pass=0 TO 2 STEP 2
  180 P%=mcode
  190 [       OPT pass
  200 .number
  210         LDA #&AA
  220         LDX #0
  230         LDY #&FF
  240         JSR osbyte    \ Find rom table
  250         STX read
  260         STY read+1
  270         LDY copy
  280         LDA (read),Y
  290         BEQ finish
  300         LDA #8
  310         STA rompoint
  320         LDA #&80
  330         STA rompoint+1
  340 .readname
  350         INC rompoint
  360         LDY copy
  370         JSR osrdrm
  380         CMP #ASC(" ")
  390         BCC finish
  400         JSR osasci
  410         JMP readname
  420 .finish
  430         RTS
  440 .move
  450         LDA romnumber
  460         STA temp
  470         LDA copy
  480         STA romnumber
  490         STA select
  500         LDA #&80
  510         STA read+1
  520         LDA #&3C
  530         STA write+1
  540         LDY #0
  550         STY read
  560         STY write
  570 .relocate
  580         LDA (read),Y
  590         STA (write),Y
  600         INY
  610         BNE relocate
  620         INC read+1
  630         INC write+1
  640         LDA read+1
  650         CMP #&C0
  660         BNE relocate
  670         LDA temp
  680         STA romnumber
  690         STA select
  700         RTS
  710 ]
  720 NEXT
  730 FOR socket=0 TO 15
  740 ?copy=socket
  750 IF socket<10 PRINT;" ";
  760 PRINT;socket;" ";
  770 CALL number
  780 PRINT
  790 NEXT
  800 VDU14
  810 REPEAT
  820 INPUT'"Which ROM &(0-15) "socket
  830 UNTIL socket >= 0 AND socket < 16
  840 ?copy=socket
  850 CALL move
  860 PRINT'"<SHIFT> to scroll, <ESCAPE> to exit"
  870 ON ERROR PROCsave
  880 FOR block=&3C00 TO &7BFF STEP 8
  890 PRINT';~block+&4400;"  ";
  900 FOR memory=0 TO 7
  910 byte=block?memory
  920 IF byte<16 VDU48
  930 PRINT;~byte;" ";
  940 NEXT
  950 FOR memory=0 TO 7
  960 byte=memory?block
  970 IF byte>31 AND byte<127 VDUbyte ELSE VDU46
  980 NEXT
  990 NEXT
 1000 PROCsave
 1010 END
 1020 DEFPROCsave
 1030 ON ERROR PRINT : END
 1040 VDU15
 1050 INPUT''"Save ROM? (Y/N) "yes$
 1060 REPEAT
 1070 IF yes$="Y" INPUT"Filename? : "filename$ ELSE INPUT"An
      other? (Y/N) "yes$ : IF yes$<>"Y" END ELSE RUN
 1080 size=FALSE
 1090 FOR block=&3C00 TO &3D00
 1100 IF ?block <> ?(block+&2000) size= TRUE
 1110 NEXT
 1120 IF size=TRUE size=&4000 ELSE size=&2000
 1130 $mcode="SAVE "+filename$+" 3C00+"+STR$~(size)+" FFFF80
      00 FFFF8000"
 1140 X%=mcode MOD 256
 1150 Y%=mcode DIV 256
 1160 CALL oscli
 1170 yes$=""
 1180 UNTIL FALSE
 1190 ENDPROC
00000000  4d 61 73 74 65 72 69 6e  67 20 53 69 64 65 77 61  |Mastering Sidewa|
00000010  79 73 20 52 4f 4d 20 26  20 52 41 4d 20 2d 20 4d  |ys ROM & RAM - M|
00000020  6f 64 75 6c 65 20 30 31  20 2d 20 49 6e 74 72 6f  |odule 01 - Intro|
00000030  64 75 63 74 69 6f 6e 0d  2d 2d 2d 2d 2d 2d 2d 2d  |duction.--------|
00000040  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000060  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
00000070  0d 20 20 49 74 20 69 73  20 70 6f 73 73 69 62 6c  |.  It is possibl|
00000080  65 20 74 6f 20 77 72 69  74 65 20 73 69 64 65 77  |e to write sidew|
00000090  61 79 73 20 72 61 6d 20  73 6f 66 74 77 61 72 65  |ays ram software|
000000a0  20 6f 6e 20 61 20 42 42  43 20 42 20 6f 72 20 42  | on a BBC B or B|
000000b0  2b 20 36 34 6b 0d 77 69  74 68 6f 75 74 20 73 69  |+ 64k.without si|
000000c0  64 65 77 61 79 73 20 72  61 6d 20 62 75 74 2c 20  |deways ram but, |
000000d0  69 66 20 79 6f 75 20 75  73 65 20 6f 6e 65 20 6f  |if you use one o|
000000e0  66 20 74 68 65 73 65 20  6d 61 63 68 69 6e 65 73  |f these machines|
000000f0  2c 20 69 74 20 77 69 6c  6c 0d 73 61 76 65 20 79  |, it will.save y|
00000100  6f 75 20 61 20 67 72 65  61 74 20 64 65 61 6c 20  |ou a great deal |
00000110  6f 66 20 74 69 6d 65 20  62 6c 6f 77 69 6e 67 20  |of time blowing |
00000120  61 6e 64 20 65 72 61 73  69 6e 67 20 65 70 72 6f  |and erasing epro|
00000130  6d 73 20 69 66 20 53 57  52 20 69 73 0d 61 76 61  |ms if SWR is.ava|
00000140  69 6c 61 62 6c 65 20 74  6f 20 74 65 73 74 20 74  |ilable to test t|
00000150  68 65 20 73 6f 66 74 77  61 72 65 20 61 73 20 69  |he software as i|
00000160  74 20 69 73 20 62 65 69  6e 67 20 64 65 76 65 6c  |t is being devel|
00000170  6f 70 65 64 2e 0d 0d 20  20 41 64 64 69 6e 67 20  |oped...  Adding |
00000180  53 57 52 20 74 6f 20 74  68 65 20 42 42 43 20 42  |SWR to the BBC B|
00000190  2b 20 36 34 6b 20 69 73  20 76 65 72 79 20 73 74  |+ 64k is very st|
000001a0  72 61 69 67 68 74 66 6f  72 77 61 72 64 20 61 73  |raightforward as|
000001b0  20 41 63 6f 72 6e 0d 70  72 6f 64 75 63 65 20 61  | Acorn.produce a|
000001c0  20 36 34 6b 20 53 57 52  20 75 70 67 72 61 64 65  | 64k SWR upgrade|
000001d0  20 77 68 69 63 68 20 63  61 6e 20 62 65 20 66 69  | which can be fi|
000001e0  74 74 65 64 20 62 79 20  41 63 6f 72 6e 20 64 65  |tted by Acorn de|
000001f0  61 6c 65 72 73 2e 20 44  6f 6e 27 74 0d 61 74 74  |alers. Don't.att|
00000200  65 6d 70 74 20 74 6f 20  66 69 74 20 69 74 20 79  |empt to fit it y|
00000210  6f 75 72 73 65 6c 66 20  75 6e 6c 65 73 73 20 79  |ourself unless y|
00000220  6f 75 20 61 72 65 20 61  62 73 6f 6c 75 74 65 6c  |ou are absolutel|
00000230  79 20 73 75 72 65 20 79  6f 75 20 68 61 76 65 20  |y sure you have |
00000240  74 68 65 0d 73 6b 69 6c  6c 20 6e 65 65 64 65 64  |the.skill needed|
00000250  20 74 6f 20 63 6f 6d 70  6c 65 74 65 20 74 68 65  | to complete the|
00000260  20 6a 6f 62 2e 0d 0d 20  20 46 69 74 74 69 6e 67  | job...  Fitting|
00000270  20 61 6e 20 53 57 52 20  75 70 67 72 61 64 65 20  | an SWR upgrade |
00000280  74 6f 20 74 68 65 20 42  42 43 20 42 20 69 73 20  |to the BBC B is |
00000290  61 20 6a 6f 62 20 6d 6f  73 74 20 75 73 65 72 73  |a job most users|
000002a0  20 63 61 6e 20 61 74 74  65 6d 70 74 0d 77 69 74  | can attempt.wit|
000002b0  68 6f 75 74 20 69 6e 63  75 72 69 6e 67 20 61 20  |hout incuring a |
000002c0  64 65 61 6c 65 72 27 73  20 73 65 72 76 69 63 65  |dealer's service|
000002d0  20 63 68 61 72 67 65 2e  20 54 68 65 72 65 20 61  | charge. There a|
000002e0  72 65 20 6d 61 6e 79 20  73 69 64 65 77 61 79 73  |re many sideways|
000002f0  0d 72 61 6d 20 61 6e 64  20 72 6f 6d 20 62 6f 61  |.ram and rom boa|
00000300  72 64 73 20 61 76 61 69  6c 61 62 6c 65 20 77 68  |rds available wh|
00000310  69 63 68 20 63 61 6e 20  62 65 20 66 69 74 74 65  |ich can be fitte|
00000320  64 20 77 69 74 68 6f 75  74 20 73 6f 6c 64 65 72  |d without solder|
00000330  69 6e 67 20 61 6e 79 0d  63 6f 6d 70 6f 6e 65 6e  |ing any.componen|
00000340  74 73 2e 20 59 6f 75 20  73 68 6f 75 6c 64 20 6c  |ts. You should l|
00000350  6f 6f 6b 20 63 61 72 65  66 75 6c 6c 79 20 61 74  |ook carefully at|
00000360  20 74 68 65 20 66 61 63  69 6c 69 74 69 65 73 20  | the facilities |
00000370  6f 66 66 65 72 65 64 20  62 79 20 74 68 65 0d 76  |offered by the.v|
00000380  61 72 69 6f 75 73 20 6d  61 6e 75 66 61 63 74 75  |arious manufactu|
00000390  72 65 72 73 20 6f 66 20  53 57 52 20 62 6f 61 72  |rers of SWR boar|
000003a0  64 73 20 61 6e 64 20 63  68 6f 6f 73 65 20 74 68  |ds and choose th|
000003b0  65 20 62 6f 61 72 64 20  74 68 61 74 20 62 65 73  |e board that bes|
000003c0  74 0d 73 75 69 74 73 20  79 6f 75 72 20 6e 65 65  |t.suits your nee|
000003d0  64 73 2e 20 49 20 72 65  63 6f 6d 6d 65 6e 64 20  |ds. I recommend |
000003e0  74 68 61 74 20 79 6f 75  20 63 6f 6e 73 69 64 65  |that you conside|
000003f0  72 20 74 68 65 20 66 6f  6c 6c 6f 77 69 6e 67 20  |r the following |
00000400  70 6f 69 6e 74 73 0d 77  68 65 6e 20 79 6f 75 20  |points.when you |
00000410  6c 6f 6f 6b 20 66 6f 72  20 61 20 53 57 52 20 62  |look for a SWR b|
00000420  6f 61 72 64 2e 0d 0d 31  2e 20 20 41 20 6d 69 6d  |oard...1.  A mim|
00000430  69 6d 75 6d 20 6f 66 20  31 36 6b 20 6f 66 20 73  |imum of 16k of s|
00000440  69 64 65 77 61 79 73 20  72 61 6d 20 69 73 20 72  |ideways ram is r|
00000450  65 71 75 69 72 65 64 2e  20 33 32 6b 20 6f 72 20  |equired. 32k or |
00000460  36 34 6b 20 69 73 20 75  73 65 66 75 6c 0d 62 75  |64k is useful.bu|
00000470  74 20 6e 6f 74 20 65 73  73 65 6e 74 69 61 6c 2e  |t not essential.|
00000480  20 4d 6f 73 74 20 62 6f  61 72 64 73 20 77 68 69  | Most boards whi|
00000490  63 68 20 75 73 65 20 73  74 61 74 69 63 20 72 61  |ch use static ra|
000004a0  6d 73 20 64 6f 20 73 6f  20 62 65 63 61 75 73 65  |ms do so because|
000004b0  20 74 68 65 0d 64 65 73  69 67 6e 20 69 73 20 6d  | the.design is m|
000004c0  75 63 68 20 73 69 6d 70  6c 65 72 2e 20 54 68 65  |uch simpler. The|
000004d0  72 65 20 69 73 20 61 6e  20 6f 6c 64 20 64 65 73  |re is an old des|
000004e0  69 67 6e 65 72 27 73 20  6a 6f 6b 65 20 74 68 61  |igner's joke tha|
000004f0  74 20 74 68 65 0d 64 69  66 66 65 72 65 6e 63 65  |t the.difference|
00000500  20 62 65 74 77 65 65 6e  20 73 74 61 74 69 63 20  | between static |
00000510  61 6e 64 20 64 79 6e 61  6d 69 63 20 72 61 6d 20  |and dynamic ram |
00000520  69 73 20 74 68 61 74 20  73 74 61 74 69 63 20 72  |is that static r|
00000530  61 6d 20 77 6f 72 6b 73  2e 0d 44 6f 6e 27 74 20  |am works..Don't |
00000540  6c 65 74 20 74 68 69 73  20 6e 6f 6e 73 65 6e 73  |let this nonsens|
00000550  65 20 70 72 65 76 65 6e  74 20 79 6f 75 20 62 75  |e prevent you bu|
00000560  79 69 6e 67 20 61 20 64  79 6e 61 6d 69 63 20 72  |ying a dynamic r|
00000570  61 6d 20 62 6f 61 72 64  2e 0d 0d 32 2e 20 20 50  |am board...2.  P|
00000580  68 79 73 69 63 61 6c 20  73 77 69 74 63 68 69 6e  |hysical switchin|
00000590  67 20 66 6f 72 20 72 65  61 64 20 61 6e 64 20 77  |g for read and w|
000005a0  72 69 74 65 20 70 72 6f  74 65 63 74 69 6f 6e 20  |rite protection |
000005b0  6f 66 20 74 68 65 20 53  57 52 20 69 73 0d 68 69  |of the SWR is.hi|
000005c0  67 68 6c 79 20 64 65 73  69 72 61 62 6c 65 2e 20  |ghly desirable. |
000005d0  52 65 61 64 20 70 72 6f  74 65 63 74 69 6f 6e 20  |Read protection |
000005e0  77 69 6c 6c 20 62 65 20  75 73 65 64 20 74 6f 20  |will be used to |
000005f0  73 77 69 74 63 68 20 6f  75 74 20 74 68 65 0d 6f  |switch out the.o|
00000600  66 66 65 6e 64 69 6e 67  20 6d 65 6d 6f 72 79 20  |ffending memory |
00000610  77 68 65 6e 20 79 6f 75  20 6c 6f 61 64 20 61 6e  |when you load an|
00000620  20 69 6e 76 61 6c 69 64  20 72 6f 6d 20 69 6d 61  | invalid rom ima|
00000630  67 65 20 77 68 69 63 68  20 63 61 75 73 65 73 20  |ge which causes |
00000640  74 68 65 0d 63 6f 6d 70  75 74 65 72 20 74 6f 20  |the.computer to |
00000650  68 61 6e 67 20 75 70 2e  20 57 72 69 74 65 20 70  |hang up. Write p|
00000660  72 6f 74 65 63 74 69 6f  6e 20 69 73 20 75 73 65  |rotection is use|
00000670  66 75 6c 20 69 66 20 79  6f 75 20 77 61 6e 74 20  |ful if you want |
00000680  74 6f 20 64 65 76 65 6c  6f 70 0d 72 6f 6d 20 69  |to develop.rom i|
00000690  6d 61 67 65 73 20 74 68  61 74 20 61 72 65 20 70  |mages that are p|
000006a0  72 6f 74 65 63 74 65 64  20 61 67 61 69 6e 73 74  |rotected against|
000006b0  20 72 75 6e 6e 69 6e 67  20 69 6e 20 53 57 52 2e  | running in SWR.|
000006c0  20 53 6f 66 74 77 61 72  65 0d 73 77 69 74 63 68  | Software.switch|
000006d0  69 6e 67 20 6f 66 20 72  65 61 64 20 61 6e 64 20  |ing of read and |
000006e0  77 72 69 74 65 20 70 72  6f 74 65 63 74 69 6f 6e  |write protection|
000006f0  20 69 73 20 61 20 70 6f  6f 72 20 73 75 62 73 74  | is a poor subst|
00000700  69 74 75 74 65 20 66 6f  72 20 72 65 61 6c 0d 73  |itute for real.s|
00000710  77 69 74 63 68 65 73 20  74 68 61 74 20 63 6c 69  |witches that cli|
00000720  63 6b 2e 0d 0d 33 2e 20  20 4c 6f 6f 6b 20 63 61  |ck...3.  Look ca|
00000730  72 65 66 75 6c 6c 79 20  61 74 20 74 68 65 20 77  |refully at the w|
00000740  61 79 20 69 6e 20 77 68  69 63 68 20 66 6c 79 69  |ay in which flyi|
00000750  6e 67 20 6c 65 61 64 73  20 61 72 65 20 61 74 74  |ng leads are att|
00000760  61 63 68 65 64 20 74 6f  0d 74 68 65 20 6d 61 69  |ached to.the mai|
00000770  6e 20 63 6f 6d 70 75 74  65 72 20 63 69 72 63 75  |n computer circu|
00000780  69 74 20 62 6f 61 72 64  2e 20 43 6f 6d 70 61 72  |it board. Compar|
00000790  65 20 74 68 65 20 64 69  66 66 65 72 65 6e 74 20  |e the different |
000007a0  6d 65 74 68 6f 64 73 0d  6d 61 6e 75 66 61 63 74  |methods.manufact|
000007b0  75 72 65 72 73 20 75 73  65 2e 20 53 6f 6d 65 20  |urers use. Some |
000007c0  62 6f 61 72 64 73 20 75  73 65 20 71 75 69 74 65  |boards use quite|
000007d0  20 75 6e 70 72 6f 66 65  73 73 69 6f 6e 61 6c 20  | unprofessional |
000007e0  64 65 73 69 67 6e 0d 74  65 63 68 6e 69 71 75 65  |design.technique|
000007f0  73 2e 0d 0d 34 2e 20 20  42 61 74 74 65 72 79 20  |s...4.  Battery |
00000800  62 61 63 6b 75 70 20 6f  66 20 53 57 52 20 69 73  |backup of SWR is|
00000810  20 75 73 65 66 75 6c 2c  20 62 75 74 20 6e 6f 74  | useful, but not|
00000820  20 65 73 73 65 6e 74 69  61 6c 2e 0d 0d 35 2e 20  | essential...5. |
00000830  20 4d 61 6e 79 20 53 57  52 20 62 6f 61 72 64 73  | Many SWR boards|
00000840  20 68 61 76 65 20 73 6f  63 6b 65 74 73 20 66 6f  | have sockets fo|
00000850  72 20 65 78 74 72 61 20  72 6f 6d 73 2e 20 54 68  |r extra roms. Th|
00000860  65 20 42 42 43 20 42 20  4d 4f 53 20 77 69 6c 6c  |e BBC B MOS will|
00000870  0d 73 75 70 70 6f 72 74  20 75 70 20 74 6f 20 73  |.support up to s|
00000880  69 78 74 65 65 6e 20 73  69 64 65 77 61 79 73 20  |ixteen sideways |
00000890  72 6f 6d 20 6f 72 20 72  61 6d 20 62 61 6e 6b 73  |rom or ram banks|
000008a0  2e 20 54 68 65 20 6d 61  69 6e 20 63 69 72 63 75  |. The main circu|
000008b0  69 74 0d 62 6f 61 72 64  20 68 61 73 20 6f 6e 6c  |it.board has onl|
000008c0  79 20 66 6f 75 72 20 73  69 64 65 77 61 79 73 20  |y four sideways |
000008d0  72 6f 6d 20 73 6f 63 6b  65 74 73 2c 20 74 77 6f  |rom sockets, two|
000008e0  20 6f 66 20 77 68 69 63  68 20 61 72 65 20 74 61  | of which are ta|
000008f0  6b 65 6e 20 75 70 0d 77  69 74 68 20 42 41 53 49  |ken up.with BASI|
00000900  43 20 61 6e 64 20 74 68  65 20 44 46 53 2e 20 54  |C and the DFS. T|
00000910  68 65 20 65 78 74 72 61  20 73 6f 63 6b 65 74 73  |he extra sockets|
00000920  20 6f 6e 20 61 20 73 69  64 65 77 61 79 73 20 72  | on a sideways r|
00000930  61 6d 2f 72 6f 6d 20 62  6f 61 72 64 0d 77 69 6c  |am/rom board.wil|
00000940  6c 20 62 65 20 75 73 65  66 75 6c 20 69 66 20 79  |l be useful if y|
00000950  6f 75 20 68 61 76 65 20  6d 6f 72 65 20 72 6f 6d  |ou have more rom|
00000960  73 20 74 68 61 6e 20 72  6f 6d 20 73 6f 63 6b 65  |s than rom socke|
00000970  74 73 2e 0d 0d 20 20 54  68 65 72 65 20 61 72 65  |ts...  There are|
00000980  20 61 20 6e 75 6d 62 65  72 20 6f 66 20 6d 61 6e  | a number of man|
00000990  75 66 61 63 74 75 72 65  72 73 20 77 68 6f 20 70  |ufacturers who p|
000009a0  72 6f 64 75 63 65 20 62  6f 61 72 64 73 20 77 68  |roduce boards wh|
000009b0  69 63 68 20 6d 65 65 74  0d 74 68 65 73 65 20 72  |ich meet.these r|
000009c0  65 71 75 69 72 65 6d 65  6e 74 73 20 74 6f 20 61  |equirements to a|
000009d0  20 67 72 65 61 74 65 72  20 6f 72 20 6c 65 73 73  | greater or less|
000009e0  65 72 20 65 78 74 65 6e  74 2e 20 57 68 69 63 68  |er extent. Which|
000009f0  20 6d 61 6e 75 66 61 63  74 75 72 65 72 0d 79 6f  | manufacturer.yo|
00000a00  75 20 63 68 6f 6f 73 65  20 69 73 20 75 70 20 74  |u choose is up t|
00000a10  6f 20 79 6f 75 2e 20 59  6f 75 20 63 61 6e 20 62  |o you. You can b|
00000a20  65 20 73 75 72 65 20 74  68 61 74 20 61 6c 6c 20  |e sure that all |
00000a30  74 68 65 20 62 6f 61 72  64 73 20 70 72 6f 64 75  |the boards produ|
00000a40  63 65 64 0d 62 79 20 72  65 70 75 74 61 62 6c 65  |ced.by reputable|
00000a50  20 63 6f 6d 70 61 6e 69  65 73 20 77 69 6c 6c 20  | companies will |
00000a60  70 65 72 66 6f 72 6d 20  61 64 65 71 75 61 74 65  |perform adequate|
00000a70  6c 79 20 62 75 74 20 69  74 20 69 73 20 6e 6f 74  |ly but it is not|
00000a80  20 70 6f 73 73 69 62 6c  65 0d 74 6f 20 72 65 63  | possible.to rec|
00000a90  6f 6d 6d 65 6e 64 20 6f  6e 65 20 62 6f 61 72 64  |ommend one board|
00000aa0  20 61 73 20 62 65 74 74  65 72 20 69 6e 20 65 76  | as better in ev|
00000ab0  65 72 79 20 72 65 73 70  65 63 74 20 74 68 61 6e  |ery respect than|
00000ac0  20 61 6e 79 20 6f 74 68  65 72 2e 0d 0d 20 20 57  | any other...  W|
00000ad0  68 65 6e 20 79 6f 75 20  68 61 76 65 20 66 69 74  |hen you have fit|
00000ae0  74 65 64 20 74 68 65 20  75 70 67 72 61 64 65 20  |ted the upgrade |
00000af0  62 6f 61 72 64 20 69 6e  74 6f 20 79 6f 75 72 20  |board into your |
00000b00  63 6f 6d 70 75 74 65 72  20 79 6f 75 20 6d 69 67  |computer you mig|
00000b10  68 74 0d 77 61 6e 74 20  74 6f 20 73 74 6f 72 65  |ht.want to store|
00000b20  20 74 68 65 20 70 72 6f  67 72 61 6d 73 20 63 6f  | the programs co|
00000b30  6e 74 61 69 6e 65 64 20  69 6e 20 79 6f 75 72 20  |ntained in your |
00000b40  72 6f 6d 73 20 6f 6e 20  64 69 73 63 20 6f 72 20  |roms on disc or |
00000b50  74 61 70 65 20 61 6e 64  0d 74 68 65 6e 20 6c 6f  |tape and.then lo|
00000b60  61 64 20 61 6e 64 20 72  75 6e 20 74 68 65 20 72  |ad and run the r|
00000b70  6f 6d 20 69 6d 61 67 65  73 20 69 6e 20 53 57 52  |om images in SWR|
00000b80  2e 20 41 6c 6c 20 41 63  6f 72 6e 20 73 75 70 70  |. All Acorn supp|
00000b90  6f 72 74 65 64 20 6c 61  6e 67 75 61 67 65 73 0d  |orted languages.|
00000ba0  77 69 6c 6c 20 72 75 6e  20 69 6e 20 75 6e 70 72  |will run in unpr|
00000bb0  6f 74 65 63 74 65 64 20  53 57 52 20 61 6e 64 20  |otected SWR and |
00000bc0  6d 6f 73 74 20 72 6f 6d  20 69 6d 61 67 65 73 20  |most rom images |
00000bd0  77 69 6c 6c 20 72 75 6e  20 69 6e 20 77 72 69 74  |will run in writ|
00000be0  65 0d 70 72 6f 74 65 63  74 65 64 20 53 57 52 2e  |e.protected SWR.|
00000bf0  0d 0d 20 20 57 68 65 72  65 20 74 68 65 20 63 6f  |..  Where the co|
00000c00  70 79 72 69 67 68 74 20  6f 66 20 74 68 65 20 73  |pyright of the s|
00000c10  6f 66 74 77 61 72 65 20  20 63 6f 6e 74 61 69 6e  |oftware  contain|
00000c20  65 64 20 69 6e 20 61 20  72 6f 6d 20 69 73 20 6e  |ed in a rom is n|
00000c30  6f 74 20 6f 77 6e 65 64  0d 62 79 20 41 63 6f 72  |ot owned.by Acor|
00000c40  6e 2c 20 73 70 65 63 69  66 69 63 20 70 65 72 6d  |n, specific perm|
00000c50  69 73 73 69 6f 6e 20 6d  75 73 74 20 62 65 20 6f  |ission must be o|
00000c60  62 74 61 69 6e 65 64 20  66 72 6f 6d 20 74 68 65  |btained from the|
00000c70  20 6f 77 6e 65 72 20 6f  66 20 74 68 65 0d 63 6f  | owner of the.co|
00000c80  70 79 72 69 67 68 74 20  62 65 66 6f 72 65 20 63  |pyright before c|
00000c90  6f 70 79 69 6e 67 20 69  74 20 6f 6e 74 6f 20 64  |opying it onto d|
00000ca0  69 73 63 20 6f 72 20 74  61 70 65 2e 0d 0d 20 20  |isc or tape...  |
00000cb0  49 6e 20 41 63 6f 72 6e  27 73 20 55 73 65 72 20  |In Acorn's User |
00000cc0  47 75 69 64 65 20 28 50  61 72 74 20 6e 6f 2e 20  |Guide (Part no. |
00000cd0  34 30 38 30 30 30 2c 20  49 73 73 75 65 20 6e 6f  |408000, Issue no|
00000ce0  2e 20 32 2c 20 4d 61 72  63 68 20 31 39 38 34 2c  |. 2, March 1984,|
00000cf0  0d 70 61 67 65 20 32 30  29 20 69 74 20 73 74 61  |.page 20) it sta|
00000d00  74 65 73 20 22 2e 2e 2e  20 79 6f 75 20 63 61 6e  |tes "... you can|
00000d10  20 6b 65 65 70 20 61 20  6c 69 62 72 61 72 79 20  | keep a library |
00000d20  6f 66 20 70 61 67 65 64  20 72 6f 6d 73 20 6f 6e  |of paged roms on|
00000d30  20 64 69 73 63 2c 0d 77  68 69 63 68 20 63 61 6e  | disc,.which can|
00000d40  20 62 65 20 63 61 6c 6c  65 64 20 75 70 20 69 6e  | be called up in|
00000d50  20 74 68 65 20 73 61 6d  65 20 77 61 79 20 61 73  | the same way as|
00000d60  20 72 6f 6d 73 20 69 6e  73 74 61 6c 6c 65 64 20  | roms installed |
00000d70  69 6e 73 69 64 65 20 74  68 65 0d 42 42 43 20 4d  |inside the.BBC M|
00000d80  69 63 72 6f 63 6f 6d 70  75 74 65 72 2e 20 48 6f  |icrocomputer. Ho|
00000d90  77 65 76 65 72 2c 20 69  6e 20 75 73 69 6e 67 20  |wever, in using |
00000da0  74 68 69 73 20 66 61 63  69 6c 69 74 79 20 79 6f  |this facility yo|
00000db0  75 20 6d 75 73 74 20 65  6e 73 75 72 65 0d 74 68  |u must ensure.th|
00000dc0  61 74 20 79 6f 75 20 64  6f 20 6e 6f 74 20 69 6e  |at you do not in|
00000dd0  66 72 69 6e 67 65 20 74  68 65 20 72 69 67 68 74  |fringe the right|
00000de0  73 20 6f 66 20 74 68 65  20 6f 77 6e 65 72 20 6f  |s of the owner o|
00000df0  66 20 74 68 65 20 63 6f  70 79 72 69 67 68 74 20  |f the copyright |
00000e00  6f 66 0d 74 68 65 20 70  72 6f 67 72 61 6d 20 63  |of.the program c|
00000e10  6f 6e 74 61 69 6e 65 64  20 69 6e 20 74 68 65 20  |ontained in the |
00000e20  72 6f 6d 22 2e 0d 0d 20  20 41 73 20 6c 6f 6e 67  |rom"...  As long|
00000e30  20 61 73 20 79 6f 75 20  64 6f 20 6e 6f 74 20 69  | as you do not i|
00000e40  6e 66 72 69 6e 67 65 20  74 68 65 20 72 69 67 68  |nfringe the righ|
00000e50  74 73 20 6f 66 20 74 68  65 20 6f 77 6e 65 72 20  |ts of the owner |
00000e60  6f 66 20 74 68 65 0d 63  6f 70 79 72 69 67 68 74  |of the.copyright|
00000e70  20 6f 66 20 74 68 65 20  70 72 6f 67 72 61 6d 2c  | of the program,|
00000e80  20 72 6f 6d 73 20 63 61  6e 20 62 65 20 73 61 76  | roms can be sav|
00000e90  65 64 20 6f 6e 74 6f 20  61 20 6c 69 62 72 61 72  |ed onto a librar|
00000ea0  79 20 64 69 73 63 20 61  6e 64 0d 72 75 6e 20 69  |y disc and.run i|
00000eb0  6e 20 72 61 6d 2e 20 53  6f 6d 65 20 73 6f 66 74  |n ram. Some soft|
00000ec0  77 61 72 65 20 70 72 6f  64 75 63 65 72 73 20 74  |ware producers t|
00000ed0  61 6b 65 20 61 20 6c 65  73 73 20 65 6e 6c 69 67  |ake a less enlig|
00000ee0  68 74 65 6e 65 64 20 76  69 65 77 20 74 68 61 6e  |htened view than|
00000ef0  0d 41 63 6f 72 6e 20 74  61 6b 65 20 74 6f 20 72  |.Acorn take to r|
00000f00  75 6e 6e 69 6e 67 20 74  68 65 69 72 20 72 6f 6d  |unning their rom|
00000f10  73 20 69 6e 20 53 57 52  20 61 6e 64 20 61 74 74  |s in SWR and att|
00000f20  65 6d 70 74 20 74 6f 20  70 72 6f 74 65 63 74 20  |empt to protect |
00000f30  74 68 65 6d 0d 61 67 61  69 6e 73 74 20 69 74 2e  |them.against it.|
00000f40  20 4d 6f 73 74 20 6f 66  20 74 68 69 73 20 70 72  | Most of this pr|
00000f50  6f 74 65 63 74 69 6f 6e  20 64 6f 65 73 20 6c 69  |otection does li|
00000f60  74 74 6c 65 20 74 6f 20  64 65 74 65 72 20 70 72  |ttle to deter pr|
00000f70  6f 66 65 73 73 69 6f 6e  61 6c 0d 73 6f 66 74 77  |ofessional.softw|
00000f80  61 72 65 20 70 69 72 61  74 65 73 20 62 75 74 20  |are pirates but |
00000f90  69 74 20 73 68 6f 75 6c  64 20 62 65 20 74 61 6b  |it should be tak|
00000fa0  65 6e 20 61 73 20 61 6e  20 69 6e 64 69 63 61 74  |en as an indicat|
00000fb0  6f 72 20 6f 66 20 74 68  65 0d 63 6f 70 79 72 69  |or of the.copyri|
00000fc0  67 68 74 20 6f 77 6e 65  72 27 73 20 75 6e 77 69  |ght owner's unwi|
00000fd0  6c 6c 69 6e 67 6e 65 73  73 20 74 6f 20 61 6c 6c  |llingness to all|
00000fe0  6f 77 20 68 69 73 20 6f  72 20 68 65 72 20 77 6f  |ow his or her wo|
00000ff0  72 6b 20 74 6f 20 62 65  20 75 73 65 64 20 69 6e  |rk to be used in|
00001000  0d 53 57 52 2e 0d 0d 20  20 49 66 20 79 6f 75 20  |.SWR...  If you |
00001010  77 61 6e 74 20 74 6f 20  65 6e 73 75 72 65 20 74  |want to ensure t|
00001020  68 61 74 20 79 6f 75 72  20 6f 77 6e 20 77 6f 72  |hat your own wor|
00001030  6b 20 77 69 6c 6c 20 6f  6e 6c 79 20 72 75 6e 20  |k will only run |
00001040  69 6e 20 65 70 72 6f 6d  73 20 61 6e 64 0d 6e 6f  |in eproms and.no|
00001050  74 20 69 6e 20 53 57 52  20 74 68 65 72 65 20 61  |t in SWR there a|
00001060  72 65 20 61 20 6e 75 6d  62 65 72 20 6f 66 20 74  |re a number of t|
00001070  65 63 68 6e 69 71 75 65  73 20 79 6f 75 20 63 61  |echniques you ca|
00001080  6e 20 74 72 79 2e 20 41  6e 20 38 6b 20 72 6f 6d  |n try. An 8k rom|
00001090  0d 69 6d 61 67 65 20 69  73 20 64 75 70 6c 69 63  |.image is duplic|
000010a0  61 74 65 64 20 66 72 6f  6d 20 26 41 30 30 30 20  |ated from &A000 |
000010b0  61 6e 64 20 6f 6e 65 20  6f 66 20 74 68 65 20 6d  |and one of the m|
000010c0  65 74 68 6f 64 73 20 6f  66 20 70 72 6f 74 65 63  |ethods of protec|
000010d0  74 69 6e 67 20 38 6b 0d  72 6f 6d 20 69 6d 61 67  |ting 8k.rom imag|
000010e0  65 73 20 69 73 20 74 6f  20 61 64 64 20 26 32 30  |es is to add &20|
000010f0  30 30 20 74 6f 20 74 68  65 20 73 75 62 72 6f 75  |00 to the subrou|
00001100  74 69 6e 65 20 61 6e 64  20 6a 75 6d 70 20 61 64  |tine and jump ad|
00001110  64 72 65 73 73 65 73 2e  0d 41 6e 6f 74 68 65 72  |dresses..Another|
00001120  2c 20 66 61 72 20 6c 65  73 73 20 63 6f 6d 6d 6f  |, far less commo|
00001130  6e 2c 20 6d 65 74 68 6f  64 20 69 73 20 74 6f 20  |n, method is to |
00001140  70 72 65 76 65 6e 74 20  74 68 65 20 72 6f 6d 20  |prevent the rom |
00001150  69 6d 61 67 65 20 72 75  6e 6e 69 6e 67 0d 69 6e  |image running.in|
00001160  20 73 6f 63 6b 65 74 20  26 30 46 2e 20 54 68 69  | socket &0F. Thi|
00001170  73 20 73 6f 63 6b 65 74  20 69 73 20 63 6f 6d 6d  |s socket is comm|
00001180  6f 6e 6c 79 20 75 73 65  64 20 66 6f 72 20 53 57  |only used for SW|
00001190  52 20 6f 6e 20 72 6f 6d  20 62 6f 61 72 64 73 20  |R on rom boards |
000011a0  61 6e 64 0d 74 68 65 20  6f 6e 6c 79 20 77 61 79  |and.the only way|
000011b0  20 74 6f 20 67 65 74 20  74 68 65 73 65 20 72 6f  | to get these ro|
000011c0  6d 20 69 6d 61 67 65 73  20 74 6f 20 72 75 6e 20  |m images to run |
000011d0  69 6e 20 73 6f 63 6b 65  74 20 26 30 46 20 69 73  |in socket &0F is|
000011e0  20 74 6f 0d 64 69 73 61  73 73 65 6d 62 6c 65 20  | to.disassemble |
000011f0  61 6e 64 20 6d 6f 64 69  66 79 20 74 68 65 6d 2e  |and modify them.|
00001200  20 57 68 65 6e 20 79 6f  75 20 68 61 76 65 20 63  | When you have c|
00001210  6f 6d 70 6c 65 74 65 64  20 74 68 69 73 20 63 6f  |ompleted this co|
00001220  75 72 73 65 20 79 6f 75  0d 77 69 6c 6c 20 63 65  |urse you.will ce|
00001230  72 74 61 69 6e 6c 79 20  6b 6e 6f 77 20 77 68 61  |rtainly know wha|
00001240  74 20 74 6f 20 6c 6f 6f  6b 20 66 6f 72 20 69 6e  |t to look for in|
00001250  20 61 20 72 6f 6d 20 64  69 73 61 73 73 65 6d 62  | a rom disassemb|
00001260  6c 79 20 69 66 20 79 6f  75 0d 77 61 6e 74 65 64  |ly if you.wanted|
00001270  20 74 6f 20 64 6f 20 74  68 69 73 20 62 75 74 20  | to do this but |
00001280  69 74 20 69 73 20 71 75  69 74 65 20 61 20 67 6f  |it is quite a go|
00001290  6f 64 20 77 61 79 20 6f  66 20 64 65 74 65 72 69  |od way of deteri|
000012a0  6e 67 20 6d 6f 73 74 20  61 6d 61 74 65 75 72 0d  |ng most amateur.|
000012b0  72 6f 6d 20 70 69 6c 66  65 72 65 72 73 2e 0d 0d  |rom pilferers...|
000012c0  20 20 49 20 77 69 6c 6c  20 6e 6f 77 20 62 65 67  |  I will now beg|
000012d0  69 6e 20 74 6f 20 65 78  70 6c 6f 72 65 20 74 68  |in to explore th|
000012e0  65 20 70 72 6f 67 72 61  6d 6d 69 6e 67 20 74 65  |e programming te|
000012f0  63 68 6e 69 71 75 65 73  20 6e 65 65 64 65 64 20  |chniques needed |
00001300  74 6f 20 75 73 65 0d 53  57 52 2e 20 54 68 65 72  |to use.SWR. Ther|
00001310  65 20 61 72 65 20 61 20  6e 75 6d 62 65 72 20 6f  |e are a number o|
00001320  66 20 4d 4f 53 20 73 75  62 72 6f 75 74 69 6e 65  |f MOS subroutine|
00001330  73 2c 20 6d 65 6d 6f 72  79 20 6c 6f 63 61 74 69  |s, memory locati|
00001340  6f 6e 73 20 61 6e 64 0d  72 65 67 69 73 74 65 72  |ons and.register|
00001350  73 20 61 73 73 6f 63 69  61 74 65 64 20 77 69 74  |s associated wit|
00001360  68 20 53 57 52 2e 20 52  61 74 68 65 72 20 74 68  |h SWR. Rather th|
00001370  61 6e 20 65 78 61 6d 69  6e 65 20 74 68 65 6d 20  |an examine them |
00001380  61 6c 6c 20 6e 6f 77 20  49 20 77 69 6c 6c 0d 63  |all now I will.c|
00001390  6f 6e 73 69 64 65 72 20  74 68 65 20 63 61 6c 6c  |onsider the call|
000013a0  73 20 61 6e 64 20 6c 6f  63 61 74 69 6f 6e 73 20  |s and locations |
000013b0  61 73 20 74 68 65 79 20  61 72 69 73 65 20 74 68  |as they arise th|
000013c0  72 6f 75 67 68 6f 75 74  20 74 68 65 20 63 6f 75  |roughout the cou|
000013d0  72 73 65 2e 0d 49 6e 20  74 68 69 73 20 6d 6f 64  |rse..In this mod|
000013e0  75 6c 65 20 49 20 77 69  6c 6c 20 6c 6f 6f 6b 20  |ule I will look |
000013f0  61 74 20 74 68 65 20 70  61 67 65 64 20 72 6f 6d  |at the paged rom|
00001400  20 73 65 6c 65 63 74 20  72 65 67 69 73 74 65 72  | select register|
00001410  20 61 74 20 26 46 45 33  30 2c 0d 74 68 65 20 70  | at &FE30,.the p|
00001420  61 67 65 64 20 6d 65 6d  6f 72 79 20 73 65 6c 65  |aged memory sele|
00001430  63 74 20 72 65 67 69 73  74 65 72 20 61 74 20 26  |ct register at &|
00001440  46 45 33 34 2c 20 74 68  65 20 4d 4f 53 20 73 75  |FE34, the MOS su|
00001450  62 72 6f 75 74 69 6e 65  20 4f 73 72 64 72 6d 2c  |broutine Osrdrm,|
00001460  0d 61 6e 64 20 4f 73 62  79 74 65 73 20 26 37 32  |.and Osbytes &72|
00001470  20 61 6e 64 20 26 41 41  2e 0d 0d 20 20 54 68 65  | and &AA...  The|
00001480  72 65 20 61 72 65 20 64  69 66 66 65 72 65 6e 63  |re are differenc|
00001490  65 73 20 69 6e 20 74 68  65 20 77 61 79 20 69 6e  |es in the way in|
000014a0  20 77 68 69 63 68 20 74  68 65 20 70 61 67 65 64  | which the paged|
000014b0  20 72 6f 6d 20 73 65 6c  65 63 74 0d 72 65 67 69  | rom select.regi|
000014c0  73 74 65 72 20 61 6e 64  20 74 68 65 20 70 61 67  |ster and the pag|
000014d0  65 64 20 6d 65 6d 6f 72  79 20 73 65 6c 65 63 74  |ed memory select|
000014e0  20 72 65 67 69 73 74 65  72 20 61 72 65 20 75 73  | register are us|
000014f0  65 64 20 69 6e 20 74 68  65 20 42 42 43 20 42 2c  |ed in the BBC B,|
00001500  0d 74 68 65 20 42 42 43  20 42 2b 20 61 6e 64 20  |.the BBC B+ and |
00001510  74 68 65 20 4d 61 73 74  65 72 20 63 6f 6d 70 75  |the Master compu|
00001520  74 65 72 73 2e 20 54 68  65 20 72 65 61 73 6f 6e  |ters. The reason|
00001530  20 66 6f 72 20 74 68 65  20 64 69 66 66 65 72 65  | for the differe|
00001540  6e 63 65 73 0d 63 61 6e  20 62 65 20 73 65 65 6e  |nces.can be seen|
00001550  20 62 79 20 65 78 61 6d  69 6e 69 6e 67 20 74 68  | by examining th|
00001560  65 20 6d 65 6d 6f 72 79  20 6d 61 70 73 20 6f 66  |e memory maps of|
00001570  20 74 68 65 73 65 20 6d  61 63 68 69 6e 65 73 20  | these machines |
00001580  28 66 69 67 75 72 65 73  0d 31 2e 31 2c 20 31 2e  |(figures.1.1, 1.|
00001590  32 20 61 6e 64 20 31 2e  33 29 2e 0d 0d 0d 0d 20  |2 and 1.3)..... |
000015a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000015b0  20 20 20 20 20 20 20 20  20 20 20 20 20 26 46 46  |             &FF|
000015c0  46 46 20 2b 2d 2d 2d 2d  2d 2d 2d 2b 20 26 46 46  |FF +-------+ &FF|
000015d0  46 46 0d 20 20 20 20 20  20 20 20 20 20 20 20 20  |FF.             |
000015e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000015f0  20 20 20 20 20 20 20 21  20 20 20 20 20 20 20 21  |       !       !|
00001600  20 20 0d 20 20 20 20 20  20 20 20 20 20 20 20 20  |  .             |
00001610  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001620  20 20 20 20 20 20 20 21  20 20 4d 4f 53 20 20 21  |       !  MOS  !|
00001630  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00001640  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001650  20 20 20 20 20 21 20 20  20 20 20 20 20 21 20 20  |     !       !  |
00001660  20 20 20 20 20 20 20 0d  20 20 20 20 26 42 46 46  |       .    &BFF|
00001670  46 20 2d 2d 2b 2d 2d 2d  2d 2d 2d 2d 2b 2d 2d 2d  |F --+-------+---|
00001680  2d 2d 2d 2d 2b 2d 2d 2d  2d 2d 2d 2d 2b 2d 2d 2d  |----+-------+---|
00001690  2d 2d 2d 2d 2b 20 26 43  30 30 30 0d 20 20 20 20  |----+ &C000.    |
000016a0  20 20 20 20 20 20 20 20  21 20 52 4f 4d 20 26 43  |        ! ROM &C|
000016b0  21 20 52 4f 4d 20 26 44  21 20 52 4f 4d 20 26 45  |! ROM &D! ROM &E|
000016c0  21 20 52 4f 4d 20 26 46  21 0d 20 20 20 20 20 20  |! ROM &F!.      |
000016d0  20 20 20 20 20 20 21 20  20 20 20 20 20 20 21 20  |      !       ! |
*
000016f0  20 20 20 20 20 20 21 0d  20 20 20 20 20 20 20 20  |      !.        |
00001700  20 20 20 20 21 20 20 20  20 20 20 20 21 20 20 20  |    !       !   |
00001710  20 20 20 20 21 20 20 44  46 53 20 20 21 20 42 41  |    !  DFS  ! BA|
00001720  53 49 43 20 21 0d 20 20  20 20 26 38 30 30 30 20  |SIC !.    &8000 |
00001730  2d 2d 2b 2d 2d 2d 2d 2d  2d 2d 2b 2d 2d 2d 2d 2d  |--+-------+-----|
*
00001750  2d 2d 2b 20 26 37 46 46  46 0d 20 20 20 20 55 70  |--+ &7FFF.    Up|
00001760  20 74 6f 20 31 36 20 73  69 64 65 77 61 79 73 20  | to 16 sideways |
00001770  72 6f 6d 2f 72 61 6d 20  62 61 6e 6b 73 20 21 20  |rom/ram banks ! |
00001780  20 20 20 20 20 20 21 0d  20 20 20 20 20 20 20 20  |      !.        |
00001790  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000017a0  20 20 20 20 20 20 20 20  20 20 20 20 21 20 20 55  |            !  U|
000017b0  73 65 72 20 21 0d 20 20  20 20 20 20 20 20 20 20  |ser !.          |
000017c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000017d0  20 20 20 20 20 20 20 20  20 20 21 20 6d 65 6d 6f  |          ! memo|
000017e0  72 79 21 0d 20 20 20 20  20 20 20 20 20 20 20 20  |ry!.            |
000017f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001800  20 20 20 20 20 20 20 20  21 20 20 20 20 20 20 20  |        !       |
00001810  21 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |!.              |
00001820  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001830  20 20 20 20 20 20 21 20  20 20 20 20 20 20 21 0d  |      !       !.|
00001840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 26 31  |              &1|
00001860  39 30 30 20 2b 2d 2d 2d  2d 2d 2d 2d 2b 20 4f 73  |900 +-------+ Os|
00001870  68 77 6d 20 0d 20 20 20  20 20 20 20 20 20 20 20  |hwm .           |
00001880  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001890  20 20 20 20 20 20 20 20  20 21 20 20 20 20 20 20  |         !      |
000018a0  20 21 20 20 20 20 20 20  20 0d 20 20 20 20 20 20  | !       .      |
000018b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000018c0  20 20 20 20 20 20 20 20  26 30 30 30 30 20 2b 2d  |        &0000 +-|
000018d0  2d 2d 2d 2d 2d 2d 2b 20  26 30 30 30 30 0d 0d 46  |------+ &0000..F|
000018e0  69 67 75 72 65 20 31 2e  31 20 4d 65 6d 6f 72 79  |igure 1.1 Memory|
000018f0  20 6d 61 70 20 6f 66 20  74 68 65 20 42 42 43 20  | map of the BBC |
00001900  42 0d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |B.--------------|
00001910  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001920  2d 2d 2d 2d 0d 0d 0d 20  20 54 68 65 20 42 42 43  |----...  The BBC|
00001930  20 42 20 4d 4f 53 20 73  75 70 70 6f 72 74 73 20  | B MOS supports |
00001940  75 70 20 74 6f 20 73 69  78 74 65 65 6e 20 70 61  |up to sixteen pa|
00001950  67 65 64 20 72 6f 6d 73  20 61 6c 74 68 6f 75 67  |ged roms althoug|
00001960  68 20 61 6e 0d 65 78 70  61 6e 73 69 6f 6e 20 62  |h an.expansion b|
00001970  6f 61 72 64 20 69 73 20  72 65 71 75 69 72 65 64  |oard is required|
00001980  20 69 66 20 6d 6f 72 65  20 74 68 61 6e 20 66 6f  | if more than fo|
00001990  75 72 20 72 6f 6d 73 20  61 72 65 20 74 6f 20 62  |ur roms are to b|
000019a0  65 20 75 73 65 64 2e 20  54 68 65 0d 70 61 67 65  |e used. The.page|
000019b0  64 20 72 6f 6d 20 73 65  6c 65 63 74 20 72 65 67  |d rom select reg|
000019c0  69 73 74 65 72 20 61 74  20 26 46 45 33 30 20 69  |ister at &FE30 i|
000019d0  73 20 61 20 34 20 62 69  74 20 77 72 69 74 65 20  |s a 4 bit write |
000019e0  6f 6e 6c 79 20 72 65 67  69 73 74 65 72 0d 77 68  |only register.wh|
000019f0  69 63 68 20 64 65 74 65  72 6d 69 6e 65 73 20 77  |ich determines w|
00001a00  68 69 63 68 20 6f 66 20  74 68 65 20 31 36 20 72  |hich of the 16 r|
00001a10  6f 6d 73 20 69 73 20 73  77 69 74 63 68 65 64 20  |oms is switched |
00001a20  69 6e 74 6f 20 74 68 65  20 6d 61 69 6e 20 6d 65  |into the main me|
00001a30  6d 6f 72 79 0d 6d 61 70  2e 20 49 66 20 79 6f 75  |mory.map. If you|
00001a40  20 77 61 6e 74 20 74 6f  20 72 65 61 64 20 74 68  | want to read th|
00001a50  65 20 63 6f 6e 74 65 6e  74 73 20 6f 66 20 74 68  |e contents of th|
00001a60  69 73 20 72 65 67 69 73  74 65 72 20 79 6f 75 20  |is register you |
00001a70  73 68 6f 75 6c 64 20 72  65 61 64 0d 74 68 65 20  |should read.the |
00001a80  7a 65 72 6f 20 70 61 67  65 20 63 6f 70 79 20 6f  |zero page copy o|
00001a90  66 20 69 74 20 61 74 20  26 46 34 2e 20 54 68 65  |f it at &F4. The|
00001aa0  20 6d 6f 73 74 20 73 69  67 6e 69 66 69 63 61 6e  | most significan|
00001ab0  74 20 6e 79 62 62 6c 65  20 6f 66 20 74 68 65 0d  |t nybble of the.|
00001ac0  70 61 67 65 64 20 72 6f  6d 20 73 65 6c 65 63 74  |paged rom select|
00001ad0  20 72 65 67 69 73 74 65  72 20 69 73 20 6e 6f 74  | register is not|
00001ae0  20 75 73 65 64 20 6f 6e  20 74 68 65 20 42 42 43  | used on the BBC|
00001af0  20 42 2e 0d 0d 0d 0d 20  20 20 20 20 20 20 20 20  | B.....         |
00001b00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001b10  20 20 20 20 20 26 46 46  46 46 20 2b 2d 2d 2d 2d  |     &FFFF +----|
00001b20  2d 2d 2d 2b 20 26 46 46  46 46 0d 20 20 20 20 20  |---+ &FFFF.     |
00001b30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001b40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 21  |               !|
00001b50  20 20 20 20 20 20 20 21  20 20 0d 20 20 20 20 20  |       !  .     |
00001b60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001b70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 21  |               !|
00001b80  20 20 4d 4f 53 20 20 21  0d 20 20 20 20 20 20 20  |  MOS  !.       |
00001b90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001ba0  20 20 20 20 20 20 20 20  20 20 20 20 20 21 20 20  |             !  |
00001bb0  20 20 20 20 20 21 20 20  20 20 20 20 20 20 20 0d  |     !         .|
00001bc0  20 20 20 20 26 42 46 46  46 20 2d 2d 2b 2d 2d 2d  |    &BFFF --+---|
00001bd0  2d 2d 2d 2d 2b 2d 2d 2d  2d 2d 2d 2d 2b 2d 2d 2d  |----+-------+---|
00001be0  2d 2d 2d 2d 2b 2d 2d 2d  2d 2d 2d 2d 2b 20 26 43  |----+-------+ &C|
00001bf0  30 30 30 0d 20 20 20 20  20 20 20 20 20 20 20 20  |000.            |
00001c00  21 20 52 4f 4d 20 26 43  21 20 52 4f 4d 20 26 44  |! ROM &C! ROM &D|
00001c10  21 20 52 4f 4d 20 26 45  21 20 52 4f 4d 20 26 46  |! ROM &E! ROM &F|
00001c20  2b 2d 2d 2d 2d 2d 2d 2d  2b 20 26 41 46 46 46 0d  |+-------+ &AFFF.|
00001c30  20 20 20 20 20 20 20 20  20 20 20 20 21 20 20 20  |            !   |
00001c40  20 20 20 20 21 20 20 20  20 20 20 20 21 20 20 20  |    !       !   |
00001c50  20 20 20 20 21 20 20 20  20 20 20 20 21 20 50 61  |    !       ! Pa|
00001c60  67 65 64 20 21 0d 20 20  20 20 20 20 20 20 20 20  |ged !.          |
00001c70  20 20 21 20 20 20 20 20  20 20 21 20 20 20 20 20  |  !       !     |
00001c80  20 20 21 20 20 44 46 53  20 20 21 20 42 41 53 49  |  !  DFS  ! BASI|
00001c90  43 20 21 20 6d 65 6d 6f  72 79 21 20 0d 20 20 20  |C ! memory! .   |
00001ca0  20 26 38 30 30 30 20 2d  2d 2b 2d 2d 2d 2d 2d 2d  | &8000 --+------|
00001cb0  2d 2b 2d 2d 2d 2d 2d 2d  2d 2b 2d 2d 2d 2d 2d 2d  |-+-------+------|
*
00001cd0  2d 2b 20 26 38 30 30 30  0d 20 20 20 20 55 70 20  |-+ &8000.    Up |
00001ce0  74 6f 20 31 36 20 73 69  64 65 77 61 79 73 20 72  |to 16 sideways r|
00001cf0  6f 6d 2f 72 61 6d 20 62  61 6e 6b 73 20 21 20 20  |om/ram banks !  |
00001d00  20 20 20 20 20 21 20 20  20 20 20 20 20 21 0d 20  |     !       !. |
00001d10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00001d30  20 20 20 21 20 20 55 73  65 72 20 21 20 53 68 61  |   !  User ! Sha|
00001d40  64 6f 77 21 0d 20 20 20  20 20 20 20 20 20 20 20  |dow!.           |
00001d50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001d60  20 20 20 20 20 20 20 20  20 21 20 6d 65 6d 6f 72  |         ! memor|
00001d70  79 21 20 20 72 61 6d 20  20 21 0d 20 20 20 20 20  |y!  ram  !.     |
00001d80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001d90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 21  |               !|
00001da0  20 20 20 20 20 20 20 21  20 20 20 20 20 20 20 21  |       !       !|
00001db0  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00001dc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001dd0  20 20 20 20 20 21 20 20  20 20 20 20 20 2b 2d 2d  |     !       +--|
00001de0  2d 2d 2d 2d 2d 2b 20 26  33 30 30 30 0d 20 20 20  |-----+ &3000.   |
00001df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001e00  20 20 20 20 20 20 20 20  20 20 20 26 31 39 30 30  |           &1900|
00001e10  20 2b 2d 2d 2d 2d 2d 2d  2d 2b 20 4f 73 68 77 6d  | +-------+ Oshwm|
00001e20  20 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | .              |
00001e30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001e40  20 20 20 20 20 20 21 20  20 20 20 20 20 20 21 20  |      !       ! |
00001e50  20 20 20 20 20 20 0d 20  20 20 20 20 20 20 20 20  |      .         |
00001e60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001e70  20 20 20 20 20 26 30 30  30 30 20 2b 2d 2d 2d 2d  |     &0000 +----|
00001e80  2d 2d 2d 2b 20 26 30 30  30 30 0d 0d 46 69 67 75  |---+ &0000..Figu|
00001e90  72 65 20 31 2e 32 20 4d  65 6d 6f 72 79 20 6d 61  |re 1.2 Memory ma|
00001ea0  70 20 6f 66 20 74 68 65  20 42 42 43 20 42 2b 0d  |p of the BBC B+.|
00001eb0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001ed0  2d 2d 2d 0d 0d 0d 20 20  54 68 65 20 42 42 43 20  |---...  The BBC |
00001ee0  42 2b 20 68 61 73 20 61  20 73 69 6d 69 6c 61 72  |B+ has a similar|
00001ef0  20 6d 65 6d 6f 72 79 20  6d 61 70 20 74 6f 20 74  | memory map to t|
00001f00  68 65 20 42 42 43 20 42  20 62 75 74 20 69 6e 20  |he BBC B but in |
00001f10  61 64 64 69 74 69 6f 6e  20 74 6f 0d 74 68 65 20  |addition to.the |
00001f20  70 61 67 65 64 20 72 6f  6d 73 20 69 74 20 61 6c  |paged roms it al|
00001f30  73 6f 20 73 75 70 70 6f  72 74 73 20 70 61 67 65  |so supports page|
00001f40  64 20 6f 72 20 73 68 61  64 6f 77 20 6d 65 6d 6f  |d or shadow memo|
00001f50  72 79 2e 20 54 68 65 20  70 61 67 65 64 0d 6d 65  |ry. The paged.me|
00001f60  6d 6f 72 79 20 28 73 68  61 64 6f 77 20 72 61 6d  |mory (shadow ram|
00001f70  29 20 73 65 6c 65 63 74  20 72 65 67 69 73 74 65  |) select registe|
00001f80  72 20 61 74 20 26 46 45  33 34 20 69 73 20 75 73  |r at &FE34 is us|
00001f90  65 64 20 74 6f 20 64 65  74 65 72 6d 69 6e 65 0d  |ed to determine.|
00001fa0  77 68 65 74 68 65 72 20  6f 72 20 6e 6f 74 20 74  |whether or not t|
00001fb0  68 65 20 73 68 61 64 6f  77 20 72 61 6d 20 69 73  |he shadow ram is|
00001fc0  20 75 73 65 64 20 61 73  20 73 63 72 65 65 6e 20  | used as screen |
00001fd0  6d 65 6d 6f 72 79 2e 20  54 68 69 73 20 72 65 67  |memory. This reg|
00001fe0  69 73 74 65 72 0d 73 68  6f 75 6c 64 20 6f 6e 6c  |ister.should onl|
00001ff0  79 20 62 65 20 61 6c 74  65 72 65 64 20 75 73 69  |y be altered usi|
00002000  6e 67 20 4f 73 62 79 74  65 20 26 37 32 20 28 2a  |ng Osbyte &72 (*|
00002010  46 58 31 31 34 29 20 6f  72 20 74 68 65 20 63 6f  |FX114) or the co|
00002020  6d 6d 61 6e 64 0d 2a 53  48 41 44 4f 57 2e 20 54  |mmand.*SHADOW. T|
00002030  68 65 20 42 42 43 20 42  2b 20 68 61 73 20 61 20  |he BBC B+ has a |
00002040  22 73 70 61 72 65 22 20  31 32 6b 20 6f 66 20 70  |"spare" 12k of p|
00002050  61 67 65 64 20 6d 65 6d  6f 72 79 20 66 72 6f 6d  |aged memory from|
00002060  20 26 38 30 30 30 20 74  6f 0d 26 41 46 46 46 2e  | &8000 to.&AFFF.|
00002070  20 54 68 69 73 20 63 61  6e 20 62 65 20 73 77 69  | This can be swi|
00002080  74 63 68 65 64 20 69 6e  20 6f 72 20 6f 75 74 20  |tched in or out |
00002090  6f 66 20 74 68 65 20 6d  61 69 6e 20 6d 65 6d 6f  |of the main memo|
000020a0  72 79 20 6d 61 70 20 75  73 69 6e 67 20 74 68 65  |ry map using the|
000020b0  0d 6d 6f 73 74 20 73 69  67 6e 69 66 69 63 61 6e  |.most significan|
000020c0  74 20 62 69 74 20 6f 66  20 74 68 65 20 70 61 67  |t bit of the pag|
000020d0  65 64 20 72 6f 6d 20 73  65 6c 65 63 74 20 72 65  |ed rom select re|
000020e0  67 69 73 74 65 72 20 61  74 20 26 46 45 33 30 2e  |gister at &FE30.|
000020f0  0d 53 65 74 74 69 6e 67  20 74 68 65 20 6d 6f 73  |.Setting the mos|
00002100  74 20 73 69 67 6e 69 66  69 63 61 6e 74 20 62 69  |t significant bi|
00002110  74 20 6f 66 20 74 68 65  20 70 61 67 65 64 20 72  |t of the paged r|
00002120  6f 6d 20 73 65 6c 65 63  74 20 72 65 67 69 73 74  |om select regist|
00002130  65 72 20 68 61 73 0d 6e  6f 20 65 66 66 65 63 74  |er has.no effect|
00002140  20 6f 6e 20 74 68 65 20  42 42 43 20 42 20 62 75  | on the BBC B bu|
00002150  74 20 6f 6e 20 74 68 65  20 42 42 43 20 42 2b 20  |t on the BBC B+ |
00002160  69 74 20 73 77 69 74 63  68 65 73 20 74 68 65 20  |it switches the |
00002170  70 61 67 65 64 20 6d 65  6d 6f 72 79 0d 66 72 6f  |paged memory.fro|
00002180  6d 20 26 38 30 30 30 20  74 6f 20 26 41 46 46 46  |m &8000 to &AFFF|
00002190  20 69 6e 74 6f 20 74 68  65 20 6d 61 69 6e 20 6d  | into the main m|
000021a0  65 6d 6f 72 79 20 6d 61  70 2e 20 42 42 43 20 54  |emory map. BBC T|
000021b0  65 6c 65 73 6f 66 74 77  61 72 65 20 68 61 73 0d  |elesoftware has.|
000021c0  62 72 6f 61 64 63 61 73  74 20 61 20 70 72 6f 67  |broadcast a prog|
000021d0  72 61 6d 20 74 68 61 74  20 75 73 65 73 20 74 68  |ram that uses th|
000021e0  69 73 20 74 65 63 68 6e  69 71 75 65 20 74 6f 20  |is technique to |
000021f0  61 6c 6c 6f 77 20 42 42  43 20 42 2b 20 36 34 6b  |allow BBC B+ 64k|
00002200  0d 63 6f 6d 70 75 74 65  72 20 75 73 65 72 73 20  |.computer users |
00002210  74 6f 20 6c 6f 61 64 20  61 6e 64 20 72 75 6e 20  |to load and run |
00002220  38 6b 20 73 65 72 76 69  63 65 20 72 6f 6d 73 20  |8k service roms |
00002230  69 6e 20 74 68 69 73 20  61 72 65 61 20 6f 66 20  |in this area of |
00002240  70 61 67 65 64 0d 6d 65  6d 6f 72 79 2e 0d 0d 20  |paged.memory... |
00002250  20 54 68 65 20 4d 61 73  74 65 72 20 63 6f 6d 70  | The Master comp|
00002260  75 74 65 72 20 75 73 65  73 20 61 20 73 6c 69 67  |uter uses a slig|
00002270  68 74 6c 79 20 64 69 66  66 65 72 65 6e 74 20 6d  |htly different m|
00002280  65 6d 6f 72 79 20 6d 61  70 20 74 6f 20 74 68 65  |emory map to the|
00002290  20 42 0d 73 65 72 69 65  73 2e 20 54 68 65 20 22  | B.series. The "|
000022a0  73 70 61 72 65 22 20 31  32 6b 20 6f 66 20 70 61  |spare" 12k of pa|
000022b0  67 65 64 20 6d 65 6d 6f  72 79 20 68 61 73 20 6e  |ged memory has n|
000022c0  6f 77 20 62 65 65 6e 20  73 70 6c 69 74 20 69 6e  |ow been split in|
000022d0  74 6f 20 74 77 6f 0d 61  72 65 61 73 2c 20 6f 6e  |to two.areas, on|
000022e0  65 20 66 72 6f 6d 20 26  38 30 30 30 20 74 6f 20  |e from &8000 to |
000022f0  26 38 46 46 46 20 61 6e  64 20 74 68 65 20 6f 74  |&8FFF and the ot|
00002300  68 65 72 20 66 72 6f 6d  20 26 43 30 30 30 20 74  |her from &C000 t|
00002310  6f 20 26 44 46 46 46 2e  20 54 68 65 0d 70 61 67  |o &DFFF. The.pag|
00002320  65 64 20 72 61 6d 20 66  72 6f 6d 20 26 38 30 30  |ed ram from &800|
00002330  30 20 74 6f 20 26 38 46  46 46 20 69 73 20 75 73  |0 to &8FFF is us|
00002340  65 64 20 62 79 20 74 68  65 20 4d 4f 53 20 61 73  |ed by the MOS as|
00002350  20 61 20 73 6f 66 74 20  6b 65 79 20 62 75 66 66  | a soft key buff|
00002360  65 72 2c 0d 63 68 61 72  61 63 74 65 72 20 66 6f  |er,.character fo|
00002370  6e 74 2c 20 61 6e 64 20  56 44 55 20 77 6f 72 6b  |nt, and VDU work|
00002380  73 70 61 63 65 2e 20 54  68 65 20 70 61 67 65 64  |space. The paged|
00002390  20 72 61 6d 20 66 72 6f  6d 20 26 43 30 30 30 20  | ram from &C000 |
000023a0  74 6f 20 26 44 43 46 46  0d 69 73 20 61 76 61 69  |to &DCFF.is avai|
000023b0  6c 61 62 6c 65 20 61 73  20 70 61 67 65 64 20 72  |lable as paged r|
000023c0  6f 6d 20 77 6f 72 6b 73  70 61 63 65 20 61 6e 64  |om workspace and|
000023d0  20 74 68 65 20 70 61 67  65 64 20 72 61 6d 20 66  | the paged ram f|
000023e0  72 6f 6d 20 26 44 44 30  30 20 74 6f 0d 26 44 46  |rom &DD00 to.&DF|
000023f0  46 46 20 69 73 20 75 73  65 64 20 61 73 20 4d 4f  |FF is used as MO|
00002400  53 20 77 6f 72 6b 73 70  61 63 65 2e 0d 0d 0d 0d  |S workspace.....|
00002410  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00002420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 26  |               &|
00002430  46 46 46 46 20 2b 2d 2d  2d 2d 2d 2d 2d 2b 20 26  |FFFF +-------+ &|
00002440  46 46 46 46 0d 20 20 20  20 20 20 20 20 20 20 20  |FFFF.           |
00002450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002460  20 20 20 20 20 20 20 20  20 21 20 20 20 20 20 20  |         !      |
00002470  20 21 20 20 0d 20 20 20  20 20 20 20 20 20 20 20  | !  .           |
00002480  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002490  20 20 20 20 20 20 20 20  20 21 20 20 4d 4f 53 20  |         !  MOS |
000024a0  20 2b 2d 2d 2d 2d 2d 2d  2d 2b 20 26 44 46 46 46  | +-------+ &DFFF|
000024b0  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
000024c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000024d0  20 20 20 20 20 21 20 20  20 20 20 20 20 21 57 6b  |     !       !Wk|
000024e0  73 70 61 63 65 21 20 0d  20 20 20 20 26 42 46 46  |space! .    &BFF|
000024f0  46 20 2d 2d 2b 2d 2d 2d  2d 2d 2d 2d 2b 2d 2d 2d  |F --+-------+---|
00002500  2d 2d 2d 2d 2b 2d 2d 2d  2d 2d 2d 2d 2b 2d 2d 2d  |----+-------+---|
00002510  2d 2d 2d 2d 2b 2d 2d 2d  2d 2d 2d 2d 2b 20 26 43  |----+-------+ &C|
00002520  30 30 30 0d 20 20 20 20  20 20 20 20 20 20 20 20  |000.            |
00002530  21 20 52 4f 4d 20 26 43  21 20 52 4f 4d 20 26 44  |! ROM &C! ROM &D|
00002540  21 20 52 4f 4d 20 26 45  21 20 52 4f 4d 20 26 46  |! ROM &E! ROM &F|
00002550  21 0d 20 20 20 20 20 20  20 20 20 20 20 20 21 20  |!.            ! |
00002560  20 20 20 20 20 20 21 20  20 20 20 20 20 20 21 20  |      !       ! |
00002570  20 20 20 20 20 20 21 20  20 20 20 20 20 20 21 0d  |      !       !.|
00002580  20 20 20 20 20 20 20 20  20 20 20 20 21 20 42 41  |            ! BA|
00002590  53 49 43 20 21 20 41 44  46 53 20 20 21 20 56 69  |SIC ! ADFS  ! Vi|
000025a0  65 77 20 20 21 20 54 65  72 6d 2e 20 2b 2d 2d 2d  |ew  ! Term. +---|
000025b0  2d 2d 2d 2d 2b 20 26 38  46 46 46 0d 20 20 20 20  |----+ &8FFF.    |
000025c0  26 38 30 30 30 20 2d 2d  2b 2d 2d 2d 2d 2d 2d 2d  |&8000 --+-------|
000025d0  2b 2d 2d 2d 2d 2d 2d 2d  2b 2d 2d 2d 2d 2d 2d 2d  |+-------+-------|
*
000025f0  2b 20 26 38 30 30 30 0d  20 20 20 20 55 70 20 74  |+ &8000.    Up t|
00002600  6f 20 31 36 20 53 69 64  65 77 61 79 73 20 72 6f  |o 16 Sideways ro|
00002610  6d 2f 72 61 6d 20 62 61  6e 6b 73 20 21 20 20 20  |m/ram banks !   |
00002620  20 20 20 20 21 20 20 20  20 20 20 20 21 0d 20 20  |    !       !.  |
00002630  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00002650  20 20 21 20 20 55 73 65  72 20 21 20 53 68 61 64  |  !  User ! Shad|
00002660  6f 77 21 0d 20 20 20 20  20 20 20 20 20 20 20 20  |ow!.            |
00002670  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002680  20 20 20 20 20 20 20 20  21 20 6d 65 6d 6f 72 79  |        ! memory|
00002690  21 20 20 72 61 6d 20 20  21 0d 20 20 20 20 20 20  |!  ram  !.      |
000026a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000026b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 21 20  |              ! |
000026c0  20 20 20 20 20 20 21 20  20 20 20 20 20 20 21 0d  |      !       !.|
000026d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000026f0  20 20 20 20 21 20 20 20  20 20 20 20 2b 2d 2d 2d  |    !       +---|
00002700  2d 2d 2d 2d 2b 20 26 33  30 30 30 0d 20 20 20 20  |----+ &3000.    |
00002710  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00002730  21 20 20 20 20 20 20 20  21 0d 20 20 20 20 20 20  |!       !.      |
00002740  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002750  20 20 20 20 20 20 20 20  26 30 45 30 30 20 2b 2d  |        &0E00 +-|
00002760  2d 2d 2d 2d 2d 2d 2b 20  4f 73 68 77 6d 20 0d 20  |------+ Oshwm . |
00002770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002780  20 20 20 20 20 20 20 20  20 20 20 20 20 26 30 30  |             &00|
00002790  30 30 20 2b 2d 2d 2d 2d  2d 2d 2d 2b 20 26 30 30  |00 +-------+ &00|
000027a0  30 30 0d 0d 46 69 67 75  72 65 20 31 2e 33 20 4d  |00..Figure 1.3 M|
000027b0  65 6d 6f 72 79 20 6d 61  70 20 6f 66 20 74 68 65  |emory map of the|
000027c0  20 42 42 43 20 4d 61 73  74 65 72 0d 2d 2d 2d 2d  | BBC Master.----|
000027d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000027f0  2d 2d 2d 0d 0d 0d 20 20  50 61 67 65 64 20 72 6f  |---...  Paged ro|
00002800  6d 20 77 6f 72 6b 73 70  61 63 65 20 6f 6e 20 74  |m workspace on t|
00002810  68 65 20 42 42 43 20 42  20 61 6e 64 20 42 2b 20  |he BBC B and B+ |
00002820  69 73 20 6a 75 73 74 20  62 65 6c 6f 77 20 74 68  |is just below th|
00002830  65 20 75 73 65 72 0d 6d  65 6d 6f 72 79 2e 20 54  |e user.memory. T|
00002840  68 65 20 42 42 43 20 42  20 44 46 53 20 63 6c 61  |he BBC B DFS cla|
00002850  69 6d 73 20 32 2e 37 35  6b 20 6f 66 20 77 6f 72  |ims 2.75k of wor|
00002860  6b 73 70 61 63 65 20 66  72 6f 6d 20 26 30 45 30  |kspace from &0E0|
00002870  30 20 74 6f 20 26 31 39  30 30 2e 0d 54 68 69 73  |0 to &1900..This|
00002880  20 77 6f 72 6b 73 70 61  63 65 20 63 61 6e 20 62  | workspace can b|
00002890  65 20 69 6e 20 70 61 67  65 64 20 6d 65 6d 6f 72  |e in paged memor|
000028a0  79 20 6f 6e 20 74 68 65  20 4d 61 73 74 65 72 20  |y on the Master |
000028b0  73 65 72 69 65 73 20 61  6c 6c 6f 77 69 6e 67 0d  |series allowing.|
000028c0  4f 73 68 77 6d 20 74 6f  20 73 74 61 79 20 61 74  |Oshwm to stay at|
000028d0  20 26 30 45 30 30 20 77  69 74 68 20 61 6c 6c 20  | &0E00 with all |
000028e0  66 69 6c 69 6e 67 20 73  79 73 74 65 6d 73 2e 20  |filing systems. |
000028f0  42 69 74 20 33 20 6f 66  20 74 68 65 20 70 61 67  |Bit 3 of the pag|
00002900  65 64 0d 6d 65 6d 6f 72  79 20 73 65 6c 65 63 74  |ed.memory select|
00002910  20 72 65 67 69 73 74 65  72 20 61 74 20 26 46 45  | register at &FE|
00002920  33 34 20 69 73 20 75 73  65 64 20 74 6f 20 6f 76  |34 is used to ov|
00002930  65 72 6c 61 79 20 74 68  65 20 70 61 67 65 64 20  |erlay the paged |
00002940  72 6f 6d 0d 77 6f 72 6b  73 70 61 63 65 20 6f 6e  |rom.workspace on|
00002950  74 6f 20 74 68 65 20 4d  61 73 74 65 72 20 4d 4f  |to the Master MO|
00002960  53 20 73 6f 20 74 68 61  74 20 69 74 20 61 70 70  |S so that it app|
00002970  65 61 72 73 20 61 62 6f  76 65 20 74 68 65 20 70  |ears above the p|
00002980  61 67 65 64 20 72 6f 6d  0d 75 73 69 6e 67 20 69  |aged rom.using i|
00002990  74 2e 20 42 69 74 20 33  20 6f 66 20 74 68 65 20  |t. Bit 3 of the |
000029a0  70 61 67 65 64 20 6d 65  6d 6f 72 79 20 73 65 6c  |paged memory sel|
000029b0  65 63 74 20 72 65 67 69  73 74 65 72 20 63 61 6e  |ect register can|
000029c0  20 62 65 20 74 6f 67 67  6c 65 64 0d 64 69 72 65  | be toggled.dire|
000029d0  63 74 6c 79 20 62 75 74  20 79 6f 75 20 6d 75 73  |ctly but you mus|
000029e0  74 20 6e 6f 74 20 64 69  72 65 63 74 6c 79 20 61  |t not directly a|
000029f0  6c 74 65 72 20 61 6e 79  20 6f 74 68 65 72 20 62  |lter any other b|
00002a00  69 74 20 69 6e 20 74 68  69 73 0d 72 65 67 69 73  |it in this.regis|
00002a10  74 65 72 2e 20 54 68 69  73 20 74 6f 70 69 63 20  |ter. This topic |
00002a20  77 69 6c 6c 20 62 65 20  63 6f 76 65 72 65 64 20  |will be covered |
00002a30  69 6e 20 6d 6f 72 65 20  64 65 74 61 69 6c 20 69  |in more detail i|
00002a40  6e 20 6d 6f 64 75 6c 65  73 20 31 31 20 61 6e 64  |n modules 11 and|
00002a50  0d 31 32 20 77 68 69 63  68 20 64 65 61 6c 20 77  |.12 which deal w|
00002a60  69 74 68 20 70 61 67 65  64 20 72 6f 6d 20 77 6f  |ith paged rom wo|
00002a70  72 6b 73 70 61 63 65 2e  0d 0d 20 20 54 68 65 20  |rkspace...  The |
00002a80  75 73 65 20 6f 66 20 74  68 65 20 6c 65 61 73 74  |use of the least|
00002a90  20 73 69 67 6e 69 66 69  63 61 6e 74 20 6e 79 62  | significant nyb|
00002aa0  62 6c 65 20 6f 66 20 74  68 65 20 70 61 67 65 64  |ble of the paged|
00002ab0  20 72 6f 6d 20 73 65 6c  65 63 74 0d 72 65 67 69  | rom select.regi|
00002ac0  73 74 65 72 20 61 74 20  69 73 20 63 6f 6d 6d 6f  |ster at is commo|
00002ad0  6e 20 74 6f 20 61 6c 6c  20 42 42 43 20 6d 69 63  |n to all BBC mic|
00002ae0  72 6f 73 2e 20 54 68 65  20 6f 70 65 72 61 74 69  |ros. The operati|
00002af0  6e 67 20 73 79 73 74 65  6d 20 75 73 65 73 0d 74  |ng system uses.t|
00002b00  68 69 73 20 72 65 67 69  73 74 65 72 2c 20 61 6e  |his register, an|
00002b10  64 20 74 68 65 20 7a 65  72 6f 20 70 61 67 65 20  |d the zero page |
00002b20  63 6f 70 79 20 6f 66 20  69 74 20 61 74 20 26 46  |copy of it at &F|
00002b30  34 2c 20 74 6f 20 6b 65  65 70 20 74 72 61 63 6b  |4, to keep track|
00002b40  20 6f 66 0d 77 68 69 63  68 20 70 61 67 65 64 20  | of.which paged |
00002b50  72 6f 6d 20 69 73 20 62  65 69 6e 67 20 75 73 65  |rom is being use|
00002b60  64 20 61 74 20 61 6e 79  20 74 69 6d 65 2e 20 49  |d at any time. I|
00002b70  66 20 79 6f 75 20 77 61  6e 74 20 74 6f 20 61 6c  |f you want to al|
00002b80  74 65 72 20 74 68 69 73  0d 72 65 67 69 73 74 65  |ter this.registe|
00002b90  72 20 64 69 72 65 63 74  6c 79 20 79 6f 75 20 63  |r directly you c|
00002ba0  61 6e 20 6f 6e 6c 79 20  64 6f 20 73 6f 20 66 72  |an only do so fr|
00002bb0  6f 6d 20 6d 61 63 68 69  6e 65 20 63 6f 64 65 2e  |om machine code.|
00002bc0  20 49 66 20 79 6f 75 20  61 6c 74 65 72 0d 69 74  | If you alter.it|
00002bd0  20 66 72 6f 6d 20 42 41  53 49 43 20 6f 72 20 61  | from BASIC or a|
00002be0  6e 79 20 6f 74 68 65 72  20 6c 61 6e 67 75 61 67  |ny other languag|
00002bf0  65 20 72 6f 6d 20 79 6f  75 20 77 69 6c 6c 20 63  |e rom you will c|
00002c00  61 75 73 65 20 74 68 65  20 63 6f 6d 70 75 74 65  |ause the compute|
00002c10  72 20 74 6f 0d 68 61 6e  67 20 75 70 2e 0d 0d 20  |r to.hang up... |
00002c20  20 54 68 65 20 6f 72 64  65 72 20 69 6e 20 77 68  | The order in wh|
00002c30  69 63 68 20 74 68 65 20  70 61 67 65 64 20 72 6f  |ich the paged ro|
00002c40  6d 20 73 65 6c 65 63 74  20 72 65 67 69 73 74 65  |m select registe|
00002c50  72 20 61 6e 64 20 69 74  73 20 63 6f 70 79 20 61  |r and its copy a|
00002c60  74 20 26 46 34 0d 61 72  65 20 61 6c 74 65 72 65  |t &F4.are altere|
00002c70  64 20 69 73 20 69 6d 70  6f 72 74 61 6e 74 2e 20  |d is important. |
00002c80  59 6f 75 20 6d 75 73 74  20 73 74 6f 72 65 20 74  |You must store t|
00002c90  68 65 20 73 61 6d 65 20  6e 75 6d 62 65 72 20 69  |he same number i|
00002ca0  6e 20 62 6f 74 68 0d 6c  6f 63 61 74 69 6f 6e 73  |n both.locations|
00002cb0  20 61 6e 64 20 61 6c 74  65 72 20 26 46 34 20 66  | and alter &F4 f|
00002cc0  69 72 73 74 2e 20 49 6d  6d 65 64 69 61 74 6c 79  |irst. Immediatly|
00002cd0  20 61 66 74 65 72 20 61  6c 74 65 72 69 6e 67 20  | after altering |
00002ce0  26 46 34 20 79 6f 75 20  6d 75 73 74 0d 73 74 6f  |&F4 you must.sto|
00002cf0  72 65 20 74 68 65 20 73  61 6d 65 20 76 61 6c 75  |re the same valu|
00002d00  65 20 69 6e 20 26 46 45  33 30 2e 20 46 6f 72 20  |e in &FE30. For |
00002d10  65 78 61 6d 70 6c 65 3a  0d 0d 20 20 4c 44 41 20  |example:..  LDA |
00002d20  23 26 30 41 0d 20 20 53  54 41 20 26 46 34 0d 20  |#&0A.  STA &F4. |
00002d30  20 53 54 41 20 26 46 45  33 30 0d 0d 20 20 54 68  | STA &FE30..  Th|
00002d40  69 73 20 63 6f 64 65 20  77 69 6c 6c 20 73 77 69  |is code will swi|
00002d50  74 63 68 20 62 61 6e 6b  20 26 30 41 20 69 6e 74  |tch bank &0A int|
00002d60  6f 20 74 68 65 20 6d 61  69 6e 20 6d 65 6d 6f 72  |o the main memor|
00002d70  79 20 6d 61 70 2e 20 49  66 20 79 6f 75 0d 72 65  |y map. If you.re|
00002d80  76 65 72 73 65 20 74 68  65 20 6f 72 64 65 72 20  |verse the order |
00002d90  6f 66 20 74 68 65 20 6c  61 73 74 20 74 77 6f 20  |of the last two |
00002da0  69 6e 73 74 72 75 63 74  69 6f 6e 73 20 79 6f 75  |instructions you|
00002db0  20 77 69 6c 6c 20 66 69  6e 64 20 74 68 61 74 20  | will find that |
00002dc0  39 39 25 0d 6f 66 20 74  68 65 20 74 69 6d 65 20  |99%.of the time |
00002dd0  65 76 65 72 79 74 68 69  6e 67 20 77 6f 72 6b 73  |everything works|
00002de0  20 70 72 6f 70 65 72 6c  79 20 62 75 74 2c 20 73  | properly but, s|
00002df0  6f 6f 6e 65 72 20 6f 72  20 6c 61 74 65 72 2c 20  |ooner or later, |
00002e00  61 6e 0d 69 6e 74 65 72  75 70 74 20 6f 63 63 75  |an.interupt occu|
00002e10  72 69 6e 67 20 62 65 74  77 65 65 6e 20 74 68 65  |ring between the|
00002e20  20 74 77 6f 20 73 74 6f  72 65 20 69 6e 73 74 72  | two store instr|
00002e30  75 63 74 69 6f 6e 73 20  77 69 6c 6c 20 63 61 75  |uctions will cau|
00002e40  73 65 20 74 6f 0d 63 6f  6d 70 75 74 65 72 20 74  |se to.computer t|
00002e50  6f 20 68 61 6e 67 20 75  70 2e 20 53 77 69 74 63  |o hang up. Switc|
00002e60  68 69 6e 67 20 61 20 70  61 67 65 64 20 72 6f 6d  |hing a paged rom|
00002e70  20 69 6e 74 6f 20 74 68  65 20 6d 61 69 6e 20 6d  | into the main m|
00002e80  65 6d 6f 72 79 20 6d 61  70 20 69 6e 0d 74 68 69  |emory map in.thi|
00002e90  73 20 77 61 79 20 63 61  6e 20 62 65 20 71 75 69  |s way can be qui|
00002ea0  74 65 20 75 73 65 66 75  6c 20 69 66 20 79 6f 75  |te useful if you|
00002eb0  20 77 61 6e 74 20 74 6f  20 74 72 61 6e 73 66 65  | want to transfe|
00002ec0  72 20 74 68 65 20 63 6f  6e 74 65 6e 74 73 20 6f  |r the contents o|
00002ed0  66 20 61 0d 72 6f 6d 20  69 6e 74 6f 20 75 73 65  |f a.rom into use|
00002ee0  72 20 6d 65 6d 6f 72 79  20 6f 72 20 74 72 61 6e  |r memory or tran|
00002ef0  73 66 65 72 20 74 68 65  20 63 6f 6e 74 65 6e 74  |sfer the content|
00002f00  73 20 6f 66 20 75 73 65  72 20 6d 65 6d 6f 72 79  |s of user memory|
00002f10  20 69 6e 74 6f 20 61 0d  70 61 72 74 69 63 75 6c  | into a.particul|
00002f20  61 72 20 73 69 64 65 77  61 79 73 20 72 61 6d 2e  |ar sideways ram.|
00002f30  0d 0d 20 20 54 68 65 72  65 20 69 73 20 61 6e 20  |..  There is an |
00002f40  6f 66 66 69 63 69 61 6c  20 77 61 79 20 74 6f 20  |official way to |
00002f50  72 65 61 64 20 61 20 62  79 74 65 20 6f 66 20 6d  |read a byte of m|
00002f60  65 6d 6f 72 79 20 66 72  6f 6d 20 61 6e 79 20 70  |emory from any p|
00002f70  61 67 65 64 0d 72 6f 6d  2e 20 54 68 69 73 20 75  |aged.rom. This u|
00002f80  73 65 73 20 74 68 65 20  6f 70 65 72 61 74 69 6e  |ses the operatin|
00002f90  67 20 73 79 73 74 65 6d  20 63 61 6c 6c 20 4f 73  |g system call Os|
00002fa0  72 64 72 6d 20 61 74 20  26 46 46 42 39 20 77 69  |rdrm at &FFB9 wi|
00002fb0  74 68 20 74 68 65 0d 72  65 6c 65 76 61 6e 74 20  |th the.relevant |
00002fc0  70 61 67 65 64 20 72 6f  6d 20 6e 75 6d 62 65 72  |paged rom number|
00002fd0  20 69 6e 20 74 68 65 20  59 20 72 65 67 69 73 74  | in the Y regist|
00002fe0  65 72 20 61 6e 64 20 74  68 65 20 61 64 64 72 65  |er and the addre|
00002ff0  73 73 20 6f 66 20 74 68  65 0d 62 79 74 65 20 69  |ss of the.byte i|
00003000  6e 20 74 68 65 20 70 61  67 65 64 20 72 6f 6d 20  |n the paged rom |
00003010  69 6e 20 6c 6f 63 61 74  69 6f 6e 73 20 26 46 36  |in locations &F6|
00003020  20 61 6e 64 20 26 46 37  20 28 74 68 65 20 70 61  | and &F7 (the pa|
00003030  67 65 64 20 72 6f 6d 0d  70 6f 69 6e 74 65 72 73  |ged rom.pointers|
00003040  29 2e 20 54 68 65 20 76  61 6c 75 65 20 6f 66 20  |). The value of |
00003050  74 68 65 20 62 79 74 65  20 72 65 61 64 20 62 79  |the byte read by|
00003060  20 4f 73 72 64 72 6d 20  69 73 20 72 65 74 75 72  | Osrdrm is retur|
00003070  6e 65 64 20 69 6e 20 74  68 65 0d 61 63 63 75 6d  |ned in the.accum|
00003080  75 6c 61 74 6f 72 2e 20  54 68 65 20 58 2c 20 59  |ulator. The X, Y|
00003090  20 61 6e 64 20 73 74 61  74 75 73 20 72 65 67 69  | and status regi|
000030a0  73 74 65 72 73 20 77 69  6c 6c 20 62 65 20 75 6e  |sters will be un|
000030b0  64 65 66 69 6e 65 64 20  61 66 74 65 72 20 74 68  |defined after th|
000030c0  65 0d 63 61 6c 6c 2e 0d  0d 20 20 42 6f 74 68 20  |e.call...  Both |
000030d0  74 68 65 73 65 20 74 65  63 68 6e 69 71 75 65 73  |these techniques|
000030e0  20 61 72 65 20 64 65 6d  6f 6e 73 74 72 61 74 65  | are demonstrate|
000030f0  64 20 69 6e 20 74 68 65  20 70 72 6f 67 72 61 6d  |d in the program|
00003100  20 52 45 41 44 52 4f 4d  2e 20 57 68 65 6e 0d 74  | READROM. When.t|
00003110  68 65 20 70 72 6f 67 72  61 6d 20 69 73 20 72 75  |he program is ru|
00003120  6e 6e 69 6e 67 20 69 74  20 75 73 65 73 20 4f 73  |nning it uses Os|
00003130  72 64 72 6d 20 74 6f 20  72 65 61 64 20 74 68 65  |rdrm to read the|
00003140  20 74 69 74 6c 65 20 73  74 72 69 6e 67 20 69 6e  | title string in|
00003150  0d 65 76 65 72 79 20 72  6f 6d 20 73 6f 63 6b 65  |.every rom socke|
00003160  74 20 74 68 61 74 20 68  61 73 20 61 6e 20 61 63  |t that has an ac|
00003170  74 69 76 65 20 72 6f 6d  20 69 6d 61 67 65 20 61  |tive rom image a|
00003180  6e 64 20 74 68 65 6e 20  70 72 6f 6d 70 74 73 20  |nd then prompts |
00003190  74 68 65 0d 75 73 65 72  20 74 6f 20 63 68 6f 6f  |the.user to choo|
000031a0  73 65 20 77 68 69 63 68  20 72 6f 6d 20 6e 75 6d  |se which rom num|
000031b0  62 65 72 2c 20 66 72 6f  6d 20 30 2d 31 35 2c 20  |ber, from 0-15, |
000031c0  74 6f 20 73 77 69 74 63  68 20 69 6e 74 6f 20 74  |to switch into t|
000031d0  68 65 20 6d 61 69 6e 0d  6d 65 6d 6f 72 79 20 6d  |he main.memory m|
000031e0  61 70 2e 20 54 68 65 20  63 68 6f 73 65 6e 20 72  |ap. The chosen r|
000031f0  6f 6d 20 69 73 20 73 77  69 74 63 68 65 64 20 69  |om is switched i|
00003200  6e 20 61 6e 64 20 63 6f  70 69 65 64 20 66 72 6f  |n and copied fro|
00003210  6d 20 26 38 30 30 30 20  74 6f 0d 26 33 43 30 30  |m &8000 to.&3C00|
00003220  20 61 6e 64 20 74 68 65  6e 20 73 77 69 74 63 68  | and then switch|
00003230  65 64 20 62 61 63 6b 20  6f 75 74 20 61 67 61 69  |ed back out agai|
00003240  6e 2e 20 54 68 65 20 72  6f 6d 20 69 6d 61 67 65  |n. The rom image|
00003250  20 63 61 6e 20 74 68 65  6e 20 62 65 0d 65 78 61  | can then be.exa|
00003260  6d 69 6e 65 64 20 61 6e  64 2c 20 69 66 20 72 65  |mined and, if re|
00003270  71 75 69 72 65 64 2c 20  73 61 76 65 64 20 74 6f  |quired, saved to|
00003280  20 74 68 65 20 63 75 72  72 65 6e 74 6c 79 20 61  | the currently a|
00003290  63 74 69 76 65 20 66 69  6c 69 6e 67 0d 73 79 73  |ctive filing.sys|
000032a0  74 65 6d 2e 20 41 6c 74  68 6f 75 67 68 20 73 6f  |tem. Although so|
000032b0  6d 65 20 6f 66 20 74 68  65 20 70 72 6f 67 72 61  |me of the progra|
000032c0  6d 20 69 73 20 69 6e 20  42 41 53 49 43 20 74 68  |m is in BASIC th|
000032d0  65 20 73 77 69 74 63 68  69 6e 67 20 61 6e 64 0d  |e switching and.|
000032e0  63 6f 70 79 69 6e 67 20  63 61 6e 20 6f 6e 6c 79  |copying can only|
000032f0  20 62 65 20 64 6f 6e 65  20 69 6e 20 6d 61 63 68  | be done in mach|
00003300  69 6e 65 20 63 6f 64 65  2e 0d 0d 20 20 54 68 65  |ine code...  The|
00003310  20 70 72 6f 67 72 61 6d  20 75 73 65 73 20 4f 73  | program uses Os|
00003320  62 79 74 65 20 26 41 41  20 74 6f 20 66 69 6e 64  |byte &AA to find|
00003330  20 74 68 65 20 73 74 61  72 74 20 6f 66 20 74 68  | the start of th|
00003340  65 20 72 6f 6d 20 69 6e  66 6f 72 6d 61 74 69 6f  |e rom informatio|
00003350  6e 0d 74 61 62 6c 65 2e  20 54 68 69 73 20 63 61  |n.table. This ca|
00003360  6c 6c 20 72 65 74 75 72  6e 73 20 74 68 65 20 6f  |ll returns the o|
00003370  72 69 67 69 6e 20 6f 66  20 61 20 31 36 20 62 79  |rigin of a 16 by|
00003380  74 65 20 74 61 62 6c 65  20 63 6f 6e 74 61 69 6e  |te table contain|
00003390  69 6e 67 20 6f 6e 65 0d  62 79 74 65 20 70 65 72  |ing one.byte per|
000033a0  20 70 61 67 65 64 20 72  6f 6d 2e 20 45 61 63 68  | paged rom. Each|
000033b0  20 62 79 74 65 20 63 6f  6e 74 61 69 6e 73 20 74  | byte contains t|
000033c0  68 65 20 72 6f 6d 20 74  79 70 65 20 62 79 74 65  |he rom type byte|
000033d0  20 63 6f 6e 74 61 69 6e  65 64 20 69 6e 0d 6c 6f  | contained in.lo|
000033e0  63 61 74 69 6f 6e 20 26  38 30 30 36 20 6f 66 20  |cation &8006 of |
000033f0  74 68 65 20 72 6f 6d 20  6f 72 20 63 6f 6e 74 61  |the rom or conta|
00003400  69 6e 73 20 7a 65 72 6f  20 69 66 20 61 6e 20 61  |ins zero if an a|
00003410  63 74 69 76 65 20 72 6f  6d 20 69 73 20 6e 6f 74  |ctive rom is not|
00003420  0d 70 72 65 73 65 6e 74  2e 20 52 6f 6d 20 74 79  |.present. Rom ty|
00003430  70 65 20 62 79 74 65 73  20 61 72 65 20 61 6e 20  |pe bytes are an |
00003440  69 6d 70 6f 72 74 61 6e  74 20 70 61 72 74 20 6f  |important part o|
00003450  66 20 74 68 65 20 72 6f  6d 20 68 65 61 64 65 72  |f the rom header|
00003460  20 61 6e 64 0d 77 69 6c  6c 20 62 65 20 64 65 61  | and.will be dea|
00003470  6c 74 20 77 69 74 68 20  69 6e 20 6d 6f 72 65 20  |lt with in more |
00003480  64 65 74 61 69 6c 20 77  68 65 6e 20 72 6f 6d 20  |detail when rom |
00003490  68 65 61 64 65 72 73 20  61 72 65 20 63 6f 6e 73  |headers are cons|
000034a0  69 64 65 72 65 64 20 69  6e 0d 6d 6f 64 75 6c 65  |idered in.module|
000034b0  20 32 2e 0d 0d 20 20 43  68 61 69 6e 20 74 68 65  | 2...  Chain the|
000034c0  20 70 72 6f 67 72 61 6d  20 52 45 41 44 52 4f 4d  | program READROM|
000034d0  20 61 6e 64 20 73 61 74  69 73 66 79 20 79 6f 75  | and satisfy you|
000034e0  72 73 65 6c 66 20 74 68  61 74 20 69 74 20 77 6f  |rself that it wo|
000034f0  72 6b 73 0d 70 72 6f 70  65 72 6c 79 2e 20 49 74  |rks.properly. It|
00003500  20 6d 75 73 74 20 72 75  6e 20 69 6e 20 74 68 65  | must run in the|
00003510  20 49 2f 4f 20 70 72 6f  63 65 73 73 6f 72 20 61  | I/O processor a|
00003520  6e 64 20 77 69 6c 6c 20  6e 6f 74 20 77 6f 72 6b  |nd will not work|
00003530  20 69 6e 20 61 0d 73 65  63 6f 6e 64 20 70 72 6f  | in a.second pro|
00003540  63 65 73 73 6f 72 2e 0d  0d 20 20 54 68 65 72 65  |cessor...  There|
00003550  20 61 72 65 20 74 77 6f  20 6d 61 63 68 69 6e 65  | are two machine|
00003560  20 63 6f 64 65 20 72 6f  75 74 69 6e 65 73 20 75  | code routines u|
00003570  73 65 64 20 69 6e 20 74  68 65 20 70 72 6f 67 72  |sed in the progr|
00003580  61 6d 2e 20 54 68 65 20  66 69 72 73 74 0d 28 6c  |am. The first.(l|
00003590  69 6e 65 73 20 32 30 30  2d 34 33 30 29 20 69 73  |ines 200-430) is|
000035a0  20 63 61 6c 6c 65 64 20  6f 6e 63 65 20 66 6f 72  | called once for|
000035b0  20 65 61 63 68 20 70 6f  73 73 69 62 6c 65 20 72  | each possible r|
000035c0  6f 6d 20 6e 75 6d 62 65  72 20 66 72 6f 6d 20 30  |om number from 0|
000035d0  20 74 6f 0d 31 35 2e 20  49 74 20 6c 6f 6f 6b 73  | to.15. It looks|
000035e0  20 75 70 20 74 68 65 20  61 64 64 72 65 73 73 20  | up the address |
000035f0  6f 66 20 74 68 65 20 73  74 61 72 74 20 6f 66 20  |of the start of |
00003600  74 68 65 20 72 6f 6d 20  69 6e 66 6f 72 6d 61 74  |the rom informat|
00003610  69 6f 6e 20 74 61 62 6c  65 0d 77 69 74 68 20 4f  |ion table.with O|
00003620  73 62 79 74 65 20 26 41  41 20 28 6c 69 6e 65 73  |sbyte &AA (lines|
00003630  20 32 31 30 2d 32 34 30  29 20 61 6e 64 20 74 68  | 210-240) and th|
00003640  65 6e 20 75 73 65 73 20  74 68 65 20 6e 75 6d 62  |en uses the numb|
00003650  65 72 20 6f 66 20 74 68  65 20 72 6f 6d 20 61 73  |er of the rom as|
00003660  0d 61 6e 20 6f 66 66 73  65 74 20 69 6e 20 74 68  |.an offset in th|
00003670  65 20 59 20 72 65 67 69  73 74 65 72 20 74 6f 20  |e Y register to |
00003680  73 65 65 20 69 66 20 74  68 65 72 65 20 69 73 20  |see if there is |
00003690  61 20 76 61 6c 69 64 20  72 6f 6d 20 69 6e 20 74  |a valid rom in t|
000036a0  68 65 0d 73 6f 63 6b 65  74 20 62 65 69 6e 67 20  |he.socket being |
000036b0  63 6f 6e 73 69 64 65 72  65 64 20 28 6c 69 6e 65  |considered (line|
000036c0  20 32 38 30 29 2e 20 49  66 20 74 68 65 72 65 20  | 280). If there |
000036d0  69 73 20 61 20 76 61 6c  69 64 20 72 6f 6d 20 69  |is a valid rom i|
000036e0  6d 61 67 65 0d 70 72 65  73 65 6e 74 20 74 68 65  |mage.present the|
000036f0  20 72 6f 75 74 69 6e 65  20 72 65 61 64 73 20 74  | routine reads t|
00003700  68 65 20 74 69 74 6c 65  20 6f 66 20 74 68 65 20  |he title of the |
00003710  72 6f 6d 20 75 73 69 6e  67 20 4f 73 72 64 72 6d  |rom using Osrdrm|
00003720  20 61 6e 64 0d 64 69 73  70 6c 61 79 73 20 69 74  | and.displays it|
00003730  20 6f 6e 20 74 68 65 20  73 63 72 65 65 6e 20 28  | on the screen (|
00003740  6c 69 6e 65 73 20 33 34  30 2d 34 33 30 29 2e 20  |lines 340-430). |
00003750  54 68 65 20 72 6f 6d 20  74 69 74 6c 65 20 61 6c  |The rom title al|
00003760  77 61 79 73 20 73 74 61  72 74 73 0d 61 74 20 26  |ways starts.at &|
00003770  38 30 30 39 20 69 6e 20  61 20 76 61 6c 69 64 20  |8009 in a valid |
00003780  72 6f 6d 20 69 6d 61 67  65 20 61 6e 64 20 61 6c  |rom image and al|
00003790  77 61 79 73 20 65 6e 64  73 20 77 69 74 68 20 61  |ways ends with a|
000037a0  20 62 69 6e 61 72 79 20  7a 65 72 6f 2e 0d 0d 20  | binary zero... |
000037b0  20 54 68 65 20 73 65 63  6f 6e 64 20 6d 61 63 68  | The second mach|
000037c0  69 6e 65 20 63 6f 64 65  20 72 6f 75 74 69 6e 65  |ine code routine|
000037d0  20 69 73 20 69 6e 20 6c  69 6e 65 73 20 34 34 30  | is in lines 440|
000037e0  2d 37 30 30 2e 20 54 68  69 73 20 73 74 6f 72 65  |-700. This store|
000037f0  73 20 74 68 65 0d 63 75  72 72 65 6e 74 20 72 6f  |s the.current ro|
00003800  6d 20 6e 75 6d 62 65 72  20 28 6c 69 6e 65 73 20  |m number (lines |
00003810  34 35 30 2d 34 36 30 29  20 62 65 66 6f 72 65 20  |450-460) before |
00003820  73 77 69 74 63 68 69 6e  67 20 74 68 65 20 63 68  |switching the ch|
00003830  6f 73 65 6e 20 72 6f 6d  0d 69 6e 74 6f 20 74 68  |osen rom.into th|
00003840  65 20 6d 61 69 6e 20 6d  65 6d 6f 72 79 20 6d 61  |e main memory ma|
00003850  70 20 28 6c 69 6e 65 73  20 34 37 30 2d 34 39 30  |p (lines 470-490|
00003860  29 2e 20 49 74 20 74 68  65 6e 20 63 6f 70 69 65  |). It then copie|
00003870  73 20 74 68 65 20 63 68  6f 73 65 6e 0d 72 6f 6d  |s the chosen.rom|
00003880  20 69 6d 61 67 65 20 69  6e 74 6f 20 75 73 65 72  | image into user|
00003890  20 6d 65 6d 6f 72 79 20  28 6c 69 6e 65 73 20 35  | memory (lines 5|
000038a0  30 30 2d 36 36 30 29 2c  20 61 6e 64 20 66 69 6e  |00-660), and fin|
000038b0  61 6c 6c 79 20 73 77 69  74 63 68 65 73 20 74 68  |ally switches th|
000038c0  65 0d 6f 72 69 67 69 6e  61 6c 20 72 6f 6d 20 62  |e.original rom b|
000038d0  61 63 6b 20 69 6e 74 6f  20 74 68 65 20 6d 61 69  |ack into the mai|
000038e0  6e 20 6d 65 6d 6f 72 79  20 6d 61 70 20 28 6c 69  |n memory map (li|
000038f0  6e 65 73 20 36 37 30 2d  36 39 30 29 2e 0d 0d 20  |nes 670-690)... |
00003900  20 54 68 65 20 42 41 53  49 43 20 70 61 72 74 20  | The BASIC part |
00003910  6f 66 20 74 68 65 20 70  72 6f 67 72 61 6d 20 69  |of the program i|
00003920  73 20 6d 61 69 6e 6c 79  20 63 6f 6e 63 65 72 6e  |s mainly concern|
00003930  65 64 20 77 69 74 68 20  64 69 73 70 6c 61 79 69  |ed with displayi|
00003940  6e 67 0d 74 68 65 20 63  6f 70 79 20 6f 66 20 74  |ng.the copy of t|
00003950  68 65 20 72 6f 6d 20 69  6d 61 67 65 20 6f 6e 20  |he rom image on |
00003960  74 68 65 20 73 63 72 65  65 6e 20 28 6c 69 6e 65  |the screen (line|
00003970  73 20 38 36 30 2d 39 39  30 29 20 61 6e 64 2c 20  |s 860-990) and, |
00003980  69 66 0d 72 65 71 75 69  72 65 64 2c 20 77 69 74  |if.required, wit|
00003990  68 20 73 61 76 69 6e 67  20 61 20 63 6f 70 79 20  |h saving a copy |
000039a0  6f 66 20 74 68 65 20 72  6f 6d 20 69 6d 61 67 65  |of the rom image|
000039b0  20 6f 6e 74 6f 20 64 69  73 63 20 6f 72 20 74 61  | onto disc or ta|
000039c0  70 65 0d 28 50 52 4f 43  73 61 76 65 2c 20 6c 69  |pe.(PROCsave, li|
000039d0  6e 65 73 20 31 30 30 30  2d 31 31 39 30 29 2e 20  |nes 1000-1190). |
000039e0  42 65 66 6f 72 65 20 69  74 20 6d 61 6b 65 73 20  |Before it makes |
000039f0  61 20 63 6f 70 79 20 6f  66 20 74 68 65 20 72 6f  |a copy of the ro|
00003a00  6d 20 69 6d 61 67 65 0d  6f 6e 74 6f 20 64 69 73  |m image.onto dis|
00003a10  63 20 74 68 65 20 70 72  6f 67 72 61 6d 20 63 6f  |c the program co|
00003a20  6d 70 61 72 65 73 20 74  68 65 20 66 69 72 73 74  |mpares the first|
00003a30  20 26 31 30 30 20 62 79  74 65 73 20 6f 66 20 74  | &100 bytes of t|
00003a40  68 65 20 69 6d 61 67 65  20 77 69 74 68 0d 26 31  |he image with.&1|
00003a50  30 30 20 62 79 74 65 73  20 38 6b 20 68 69 67 68  |00 bytes 8k high|
00003a60  65 72 20 69 6e 20 6d 65  6d 6f 72 79 20 28 6c 69  |er in memory (li|
00003a70  6e 65 73 20 31 30 39 30  2d 31 31 31 30 29 2e 20  |nes 1090-1110). |
00003a80  49 66 20 65 76 65 72 79  20 70 61 69 72 20 6f 66  |If every pair of|
00003a90  0d 26 31 30 30 20 62 79  74 65 73 20 69 73 20 69  |.&100 bytes is i|
00003aa0  64 65 6e 74 69 63 61 6c  20 74 68 65 20 72 6f 6d  |dentical the rom|
00003ab0  20 69 73 20 72 65 63 6f  67 6e 69 73 65 64 20 61  | is recognised a|
00003ac0  73 20 61 6e 20 38 6b 20  69 6d 61 67 65 20 61 6e  |s an 8k image an|
00003ad0  64 20 6f 6e 6c 79 0d 74  68 65 20 66 69 72 73 74  |d only.the first|
00003ae0  20 26 32 30 30 30 20 62  79 74 65 73 20 61 72 65  | &2000 bytes are|
00003af0  20 73 61 76 65 64 2e 0d  0d 20 20 54 68 65 20 70  | saved...  The p|
00003b00  72 6f 67 72 61 6d 20 52  45 41 44 52 4f 4d 2c 20  |rogram READROM, |
00003b10  61 73 20 77 65 6c 6c 20  61 73 20 69 6c 6c 75 73  |as well as illus|
00003b20  74 72 61 74 69 6e 67 20  74 68 65 20 74 65 63 68  |trating the tech|
00003b30  6e 69 71 75 65 73 0d 64  65 73 63 72 69 62 65 64  |niques.described|
00003b40  20 61 62 6f 76 65 2c 20  77 69 6c 6c 20 62 65 20  | above, will be |
00003b50  75 73 65 66 75 6c 20 69  6e 20 6c 61 74 65 72 20  |useful in later |
00003b60  6d 6f 64 75 6c 65 73 20  77 68 65 6e 20 79 6f 75  |modules when you|
00003b70  20 77 69 6c 6c 20 77 61  6e 74 20 74 6f 0d 65 78  | will want to.ex|
00003b80  61 6d 69 6e 65 20 6f 72  20 73 61 76 65 20 74 68  |amine or save th|
00003b90  65 20 63 6f 6e 74 65 6e  74 73 20 6f 66 20 73 69  |e contents of si|
00003ba0  64 65 77 61 79 73 20 72  61 6d 20 62 61 6e 6b 73  |deways ram banks|
00003bb0  2e 20 54 68 65 20 70 72  6f 67 72 61 6d 20 63 61  |. The program ca|
00003bc0  6e 20 62 65 0d 6d 6f 64  69 66 69 65 64 20 74 6f  |n be.modified to|
00003bd0  20 70 72 6f 64 75 63 65  20 61 6e 6f 74 68 65 72  | produce another|
00003be0  20 70 72 6f 67 72 61 6d  20 74 6f 20 6c 6f 61 64  | program to load|
00003bf0  20 72 6f 6d 20 69 6d 61  67 65 73 20 69 6e 74 6f  | rom images into|
00003c00  20 61 6e 79 0d 73 69 64  65 77 61 79 73 20 72 61  | any.sideways ra|
00003c10  6d 20 62 61 6e 6b 2c 20  69 6e 63 6c 75 64 69 6e  |m bank, includin|
00003c20  67 20 74 68 65 20 70 61  67 65 64 20 6d 65 6d 6f  |g the paged memo|
00003c30  72 79 20 62 61 6e 6b 20  6f 66 20 74 68 65 20 42  |ry bank of the B|
00003c40  42 43 20 42 2b 2e 20 54  68 69 73 0d 68 61 73 20  |BC B+. This.has |
00003c50  62 65 65 6e 20 6c 65 66  74 20 61 73 20 61 6e 20  |been left as an |
00003c60  65 78 65 72 63 69 73 65  20 66 6f 72 20 79 6f 75  |exercise for you|
00003c70  20 74 6f 20 63 6f 6d 70  6c 65 74 65 2e 0d 0d 0d  | to complete....|
00003c80  0d 20 20 20 31 30 20 52  45 4d 3a 20 52 45 41 44  |.   10 REM: READ|
00003c90  52 4f 4d 0d 20 20 20 32  30 20 4d 4f 44 45 37 0d  |ROM.   20 MODE7.|
00003ca0  20 20 20 33 30 20 48 49  4d 45 4d 3d 26 33 43 30  |   30 HIMEM=&3C0|
00003cb0  30 0d 20 20 20 34 30 20  44 49 4d 20 6d 63 6f 64  |0.   40 DIM mcod|
00003cc0  65 20 26 31 30 30 0d 20  20 20 35 30 20 73 65 6c  |e &100.   50 sel|
00003cd0  65 63 74 3d 26 46 45 33  30 0d 20 20 20 36 30 20  |ect=&FE30.   60 |
00003ce0  6f 73 72 64 72 6d 3d 26  46 46 42 39 0d 20 20 20  |osrdrm=&FFB9.   |
00003cf0  37 30 20 6f 73 61 73 63  69 3d 26 46 46 45 33 0d  |70 osasci=&FFE3.|
00003d00  20 20 20 38 30 20 6f 73  62 79 74 65 3d 26 46 46  |   80 osbyte=&FF|
00003d10  46 34 0d 20 20 20 39 30  20 6f 73 63 6c 69 3d 26  |F4.   90 oscli=&|
00003d20  46 46 46 37 0d 20 20 31  30 30 20 63 6f 70 79 3d  |FFF7.  100 copy=|
00003d30  26 37 30 0d 20 20 31 31  30 20 74 65 6d 70 3d 26  |&70.  110 temp=&|
00003d40  37 31 0d 20 20 31 32 30  20 72 65 61 64 3d 26 37  |71.  120 read=&7|
00003d50  32 0d 20 20 31 33 30 20  77 72 69 74 65 3d 26 37  |2.  130 write=&7|
00003d60  34 0d 20 20 31 34 30 20  72 6f 6d 6e 75 6d 62 65  |4.  140 romnumbe|
00003d70  72 3d 26 46 34 0d 20 20  31 35 30 20 72 6f 6d 70  |r=&F4.  150 romp|
00003d80  6f 69 6e 74 3d 26 46 36  0d 20 20 31 36 30 20 4f  |oint=&F6.  160 O|
00003d90  4e 20 45 52 52 4f 52 20  50 52 49 4e 54 20 3a 20  |N ERROR PRINT : |
00003da0  45 4e 44 0d 20 20 31 37  30 20 46 4f 52 20 70 61  |END.  170 FOR pa|
00003db0  73 73 3d 30 20 54 4f 20  32 20 53 54 45 50 20 32  |ss=0 TO 2 STEP 2|
00003dc0  0d 20 20 31 38 30 20 50  25 3d 6d 63 6f 64 65 0d  |.  180 P%=mcode.|
00003dd0  20 20 31 39 30 20 5b 20  20 20 20 20 20 20 4f 50  |  190 [       OP|
00003de0  54 20 70 61 73 73 0d 20  20 32 30 30 20 2e 6e 75  |T pass.  200 .nu|
00003df0  6d 62 65 72 0d 20 20 32  31 30 20 20 20 20 20 20  |mber.  210      |
00003e00  20 20 20 4c 44 41 20 23  26 41 41 0d 20 20 32 32  |   LDA #&AA.  22|
00003e10  30 20 20 20 20 20 20 20  20 20 4c 44 58 20 23 30  |0         LDX #0|
00003e20  0d 20 20 32 33 30 20 20  20 20 20 20 20 20 20 4c  |.  230         L|
00003e30  44 59 20 23 26 46 46 0d  20 20 32 34 30 20 20 20  |DY #&FF.  240   |
00003e40  20 20 20 20 20 20 4a 53  52 20 6f 73 62 79 74 65  |      JSR osbyte|
00003e50  20 20 20 20 5c 20 46 69  6e 64 20 72 6f 6d 20 74  |    \ Find rom t|
00003e60  61 62 6c 65 0d 20 20 32  35 30 20 20 20 20 20 20  |able.  250      |
00003e70  20 20 20 53 54 58 20 72  65 61 64 0d 20 20 32 36  |   STX read.  26|
00003e80  30 20 20 20 20 20 20 20  20 20 53 54 59 20 72 65  |0         STY re|
00003e90  61 64 2b 31 0d 20 20 32  37 30 20 20 20 20 20 20  |ad+1.  270      |
00003ea0  20 20 20 4c 44 59 20 63  6f 70 79 0d 20 20 32 38  |   LDY copy.  28|
00003eb0  30 20 20 20 20 20 20 20  20 20 4c 44 41 20 28 72  |0         LDA (r|
00003ec0  65 61 64 29 2c 59 0d 20  20 32 39 30 20 20 20 20  |ead),Y.  290    |
00003ed0  20 20 20 20 20 42 45 51  20 66 69 6e 69 73 68 0d  |     BEQ finish.|
00003ee0  20 20 33 30 30 20 20 20  20 20 20 20 20 20 4c 44  |  300         LD|
00003ef0  41 20 23 38 0d 20 20 33  31 30 20 20 20 20 20 20  |A #8.  310      |
00003f00  20 20 20 53 54 41 20 72  6f 6d 70 6f 69 6e 74 0d  |   STA rompoint.|
00003f10  20 20 33 32 30 20 20 20  20 20 20 20 20 20 4c 44  |  320         LD|
00003f20  41 20 23 26 38 30 0d 20  20 33 33 30 20 20 20 20  |A #&80.  330    |
00003f30  20 20 20 20 20 53 54 41  20 72 6f 6d 70 6f 69 6e  |     STA rompoin|
00003f40  74 2b 31 0d 20 20 33 34  30 20 2e 72 65 61 64 6e  |t+1.  340 .readn|
00003f50  61 6d 65 0d 20 20 33 35  30 20 20 20 20 20 20 20  |ame.  350       |
00003f60  20 20 49 4e 43 20 72 6f  6d 70 6f 69 6e 74 0d 20  |  INC rompoint. |
00003f70  20 33 36 30 20 20 20 20  20 20 20 20 20 4c 44 59  | 360         LDY|
00003f80  20 63 6f 70 79 0d 20 20  33 37 30 20 20 20 20 20  | copy.  370     |
00003f90  20 20 20 20 4a 53 52 20  6f 73 72 64 72 6d 0d 20  |    JSR osrdrm. |
00003fa0  20 33 38 30 20 20 20 20  20 20 20 20 20 43 4d 50  | 380         CMP|
00003fb0  20 23 41 53 43 28 22 20  22 29 0d 20 20 33 39 30  | #ASC(" ").  390|
00003fc0  20 20 20 20 20 20 20 20  20 42 43 43 20 66 69 6e  |         BCC fin|
00003fd0  69 73 68 0d 20 20 34 30  30 20 20 20 20 20 20 20  |ish.  400       |
00003fe0  20 20 4a 53 52 20 6f 73  61 73 63 69 0d 20 20 34  |  JSR osasci.  4|
00003ff0  31 30 20 20 20 20 20 20  20 20 20 4a 4d 50 20 72  |10         JMP r|
00004000  65 61 64 6e 61 6d 65 0d  20 20 34 32 30 20 2e 66  |eadname.  420 .f|
00004010  69 6e 69 73 68 0d 20 20  34 33 30 20 20 20 20 20  |inish.  430     |
00004020  20 20 20 20 52 54 53 0d  20 20 34 34 30 20 2e 6d  |    RTS.  440 .m|
00004030  6f 76 65 0d 20 20 34 35  30 20 20 20 20 20 20 20  |ove.  450       |
00004040  20 20 4c 44 41 20 72 6f  6d 6e 75 6d 62 65 72 0d  |  LDA romnumber.|
00004050  20 20 34 36 30 20 20 20  20 20 20 20 20 20 53 54  |  460         ST|
00004060  41 20 74 65 6d 70 0d 20  20 34 37 30 20 20 20 20  |A temp.  470    |
00004070  20 20 20 20 20 4c 44 41  20 63 6f 70 79 0d 20 20  |     LDA copy.  |
00004080  34 38 30 20 20 20 20 20  20 20 20 20 53 54 41 20  |480         STA |
00004090  72 6f 6d 6e 75 6d 62 65  72 0d 20 20 34 39 30 20  |romnumber.  490 |
000040a0  20 20 20 20 20 20 20 20  53 54 41 20 73 65 6c 65  |        STA sele|
000040b0  63 74 0d 20 20 35 30 30  20 20 20 20 20 20 20 20  |ct.  500        |
000040c0  20 4c 44 41 20 23 26 38  30 0d 20 20 35 31 30 20  | LDA #&80.  510 |
000040d0  20 20 20 20 20 20 20 20  53 54 41 20 72 65 61 64  |        STA read|
000040e0  2b 31 0d 20 20 35 32 30  20 20 20 20 20 20 20 20  |+1.  520        |
000040f0  20 4c 44 41 20 23 26 33  43 0d 20 20 35 33 30 20  | LDA #&3C.  530 |
00004100  20 20 20 20 20 20 20 20  53 54 41 20 77 72 69 74  |        STA writ|
00004110  65 2b 31 0d 20 20 35 34  30 20 20 20 20 20 20 20  |e+1.  540       |
00004120  20 20 4c 44 59 20 23 30  0d 20 20 35 35 30 20 20  |  LDY #0.  550  |
00004130  20 20 20 20 20 20 20 53  54 59 20 72 65 61 64 0d  |       STY read.|
00004140  20 20 35 36 30 20 20 20  20 20 20 20 20 20 53 54  |  560         ST|
00004150  59 20 77 72 69 74 65 0d  20 20 35 37 30 20 2e 72  |Y write.  570 .r|
00004160  65 6c 6f 63 61 74 65 0d  20 20 35 38 30 20 20 20  |elocate.  580   |
00004170  20 20 20 20 20 20 4c 44  41 20 28 72 65 61 64 29  |      LDA (read)|
00004180  2c 59 0d 20 20 35 39 30  20 20 20 20 20 20 20 20  |,Y.  590        |
00004190  20 53 54 41 20 28 77 72  69 74 65 29 2c 59 0d 20  | STA (write),Y. |
000041a0  20 36 30 30 20 20 20 20  20 20 20 20 20 49 4e 59  | 600         INY|
000041b0  0d 20 20 36 31 30 20 20  20 20 20 20 20 20 20 42  |.  610         B|
000041c0  4e 45 20 72 65 6c 6f 63  61 74 65 0d 20 20 36 32  |NE relocate.  62|
000041d0  30 20 20 20 20 20 20 20  20 20 49 4e 43 20 72 65  |0         INC re|
000041e0  61 64 2b 31 0d 20 20 36  33 30 20 20 20 20 20 20  |ad+1.  630      |
000041f0  20 20 20 49 4e 43 20 77  72 69 74 65 2b 31 0d 20  |   INC write+1. |
00004200  20 36 34 30 20 20 20 20  20 20 20 20 20 4c 44 41  | 640         LDA|
00004210  20 72 65 61 64 2b 31 0d  20 20 36 35 30 20 20 20  | read+1.  650   |
00004220  20 20 20 20 20 20 43 4d  50 20 23 26 43 30 0d 20  |      CMP #&C0. |
00004230  20 36 36 30 20 20 20 20  20 20 20 20 20 42 4e 45  | 660         BNE|
00004240  20 72 65 6c 6f 63 61 74  65 0d 20 20 36 37 30 20  | relocate.  670 |
00004250  20 20 20 20 20 20 20 20  4c 44 41 20 74 65 6d 70  |        LDA temp|
00004260  0d 20 20 36 38 30 20 20  20 20 20 20 20 20 20 53  |.  680         S|
00004270  54 41 20 72 6f 6d 6e 75  6d 62 65 72 0d 20 20 36  |TA romnumber.  6|
00004280  39 30 20 20 20 20 20 20  20 20 20 53 54 41 20 73  |90         STA s|
00004290  65 6c 65 63 74 0d 20 20  37 30 30 20 20 20 20 20  |elect.  700     |
000042a0  20 20 20 20 52 54 53 0d  20 20 37 31 30 20 5d 0d  |    RTS.  710 ].|
000042b0  20 20 37 32 30 20 4e 45  58 54 0d 20 20 37 33 30  |  720 NEXT.  730|
000042c0  20 46 4f 52 20 73 6f 63  6b 65 74 3d 30 20 54 4f  | FOR socket=0 TO|
000042d0  20 31 35 0d 20 20 37 34  30 20 3f 63 6f 70 79 3d  | 15.  740 ?copy=|
000042e0  73 6f 63 6b 65 74 0d 20  20 37 35 30 20 49 46 20  |socket.  750 IF |
000042f0  73 6f 63 6b 65 74 3c 31  30 20 50 52 49 4e 54 3b  |socket<10 PRINT;|
00004300  22 20 22 3b 0d 20 20 37  36 30 20 50 52 49 4e 54  |" ";.  760 PRINT|
00004310  3b 73 6f 63 6b 65 74 3b  22 20 22 3b 0d 20 20 37  |;socket;" ";.  7|
00004320  37 30 20 43 41 4c 4c 20  6e 75 6d 62 65 72 0d 20  |70 CALL number. |
00004330  20 37 38 30 20 50 52 49  4e 54 0d 20 20 37 39 30  | 780 PRINT.  790|
00004340  20 4e 45 58 54 0d 20 20  38 30 30 20 56 44 55 31  | NEXT.  800 VDU1|
00004350  34 0d 20 20 38 31 30 20  52 45 50 45 41 54 0d 20  |4.  810 REPEAT. |
00004360  20 38 32 30 20 49 4e 50  55 54 27 22 57 68 69 63  | 820 INPUT'"Whic|
00004370  68 20 52 4f 4d 20 26 28  30 2d 31 35 29 20 22 73  |h ROM &(0-15) "s|
00004380  6f 63 6b 65 74 0d 20 20  38 33 30 20 55 4e 54 49  |ocket.  830 UNTI|
00004390  4c 20 73 6f 63 6b 65 74  20 3e 3d 20 30 20 41 4e  |L socket >= 0 AN|
000043a0  44 20 73 6f 63 6b 65 74  20 3c 20 31 36 0d 20 20  |D socket < 16.  |
000043b0  38 34 30 20 3f 63 6f 70  79 3d 73 6f 63 6b 65 74  |840 ?copy=socket|
000043c0  0d 20 20 38 35 30 20 43  41 4c 4c 20 6d 6f 76 65  |.  850 CALL move|
000043d0  0d 20 20 38 36 30 20 50  52 49 4e 54 27 22 3c 53  |.  860 PRINT'"<S|
000043e0  48 49 46 54 3e 20 74 6f  20 73 63 72 6f 6c 6c 2c  |HIFT> to scroll,|
000043f0  20 3c 45 53 43 41 50 45  3e 20 74 6f 20 65 78 69  | <ESCAPE> to exi|
00004400  74 22 0d 20 20 38 37 30  20 4f 4e 20 45 52 52 4f  |t".  870 ON ERRO|
00004410  52 20 50 52 4f 43 73 61  76 65 0d 20 20 38 38 30  |R PROCsave.  880|
00004420  20 46 4f 52 20 62 6c 6f  63 6b 3d 26 33 43 30 30  | FOR block=&3C00|
00004430  20 54 4f 20 26 37 42 46  46 20 53 54 45 50 20 38  | TO &7BFF STEP 8|
00004440  0d 20 20 38 39 30 20 50  52 49 4e 54 27 3b 7e 62  |.  890 PRINT';~b|
00004450  6c 6f 63 6b 2b 26 34 34  30 30 3b 22 20 20 22 3b  |lock+&4400;"  ";|
00004460  0d 20 20 39 30 30 20 46  4f 52 20 6d 65 6d 6f 72  |.  900 FOR memor|
00004470  79 3d 30 20 54 4f 20 37  0d 20 20 39 31 30 20 62  |y=0 TO 7.  910 b|
00004480  79 74 65 3d 62 6c 6f 63  6b 3f 6d 65 6d 6f 72 79  |yte=block?memory|
00004490  0d 20 20 39 32 30 20 49  46 20 62 79 74 65 3c 31  |.  920 IF byte<1|
000044a0  36 20 56 44 55 34 38 0d  20 20 39 33 30 20 50 52  |6 VDU48.  930 PR|
000044b0  49 4e 54 3b 7e 62 79 74  65 3b 22 20 22 3b 0d 20  |INT;~byte;" ";. |
000044c0  20 39 34 30 20 4e 45 58  54 0d 20 20 39 35 30 20  | 940 NEXT.  950 |
000044d0  46 4f 52 20 6d 65 6d 6f  72 79 3d 30 20 54 4f 20  |FOR memory=0 TO |
000044e0  37 0d 20 20 39 36 30 20  62 79 74 65 3d 6d 65 6d  |7.  960 byte=mem|
000044f0  6f 72 79 3f 62 6c 6f 63  6b 0d 20 20 39 37 30 20  |ory?block.  970 |
00004500  49 46 20 62 79 74 65 3e  33 31 20 41 4e 44 20 62  |IF byte>31 AND b|
00004510  79 74 65 3c 31 32 37 20  56 44 55 62 79 74 65 20  |yte<127 VDUbyte |
00004520  45 4c 53 45 20 56 44 55  34 36 0d 20 20 39 38 30  |ELSE VDU46.  980|
00004530  20 4e 45 58 54 0d 20 20  39 39 30 20 4e 45 58 54  | NEXT.  990 NEXT|
00004540  0d 20 31 30 30 30 20 50  52 4f 43 73 61 76 65 0d  |. 1000 PROCsave.|
00004550  20 31 30 31 30 20 45 4e  44 0d 20 31 30 32 30 20  | 1010 END. 1020 |
00004560  44 45 46 50 52 4f 43 73  61 76 65 0d 20 31 30 33  |DEFPROCsave. 103|
00004570  30 20 4f 4e 20 45 52 52  4f 52 20 50 52 49 4e 54  |0 ON ERROR PRINT|
00004580  20 3a 20 45 4e 44 0d 20  31 30 34 30 20 56 44 55  | : END. 1040 VDU|
00004590  31 35 0d 20 31 30 35 30  20 49 4e 50 55 54 27 27  |15. 1050 INPUT''|
000045a0  22 53 61 76 65 20 52 4f  4d 3f 20 28 59 2f 4e 29  |"Save ROM? (Y/N)|
000045b0  20 22 79 65 73 24 0d 20  31 30 36 30 20 52 45 50  | "yes$. 1060 REP|
000045c0  45 41 54 0d 20 31 30 37  30 20 49 46 20 79 65 73  |EAT. 1070 IF yes|
000045d0  24 3d 22 59 22 20 49 4e  50 55 54 22 46 69 6c 65  |$="Y" INPUT"File|
000045e0  6e 61 6d 65 3f 20 3a 20  22 66 69 6c 65 6e 61 6d  |name? : "filenam|
000045f0  65 24 20 45 4c 53 45 20  49 4e 50 55 54 22 41 6e  |e$ ELSE INPUT"An|
00004600  0d 20 20 20 20 20 20 6f  74 68 65 72 3f 20 28 59  |.      other? (Y|
00004610  2f 4e 29 20 22 79 65 73  24 20 3a 20 49 46 20 79  |/N) "yes$ : IF y|
00004620  65 73 24 3c 3e 22 59 22  20 45 4e 44 20 45 4c 53  |es$<>"Y" END ELS|
00004630  45 20 52 55 4e 0d 20 31  30 38 30 20 73 69 7a 65  |E RUN. 1080 size|
00004640  3d 46 41 4c 53 45 0d 20  31 30 39 30 20 46 4f 52  |=FALSE. 1090 FOR|
00004650  20 62 6c 6f 63 6b 3d 26  33 43 30 30 20 54 4f 20  | block=&3C00 TO |
00004660  26 33 44 30 30 0d 20 31  31 30 30 20 49 46 20 3f  |&3D00. 1100 IF ?|
00004670  62 6c 6f 63 6b 20 3c 3e  20 3f 28 62 6c 6f 63 6b  |block <> ?(block|
00004680  2b 26 32 30 30 30 29 20  73 69 7a 65 3d 20 54 52  |+&2000) size= TR|
00004690  55 45 0d 20 31 31 31 30  20 4e 45 58 54 0d 20 31  |UE. 1110 NEXT. 1|
000046a0  31 32 30 20 49 46 20 73  69 7a 65 3d 54 52 55 45  |120 IF size=TRUE|
000046b0  20 73 69 7a 65 3d 26 34  30 30 30 20 45 4c 53 45  | size=&4000 ELSE|
000046c0  20 73 69 7a 65 3d 26 32  30 30 30 0d 20 31 31 33  | size=&2000. 113|
000046d0  30 20 24 6d 63 6f 64 65  3d 22 53 41 56 45 20 22  |0 $mcode="SAVE "|
000046e0  2b 66 69 6c 65 6e 61 6d  65 24 2b 22 20 33 43 30  |+filename$+" 3C0|
000046f0  30 2b 22 2b 53 54 52 24  7e 28 73 69 7a 65 29 2b  |0+"+STR$~(size)+|
00004700  22 20 46 46 46 46 38 30  0d 20 20 20 20 20 20 30  |" FFFF80.      0|
00004710  30 20 46 46 46 46 38 30  30 30 22 0d 20 31 31 34  |0 FFFF8000". 114|
00004720  30 20 58 25 3d 6d 63 6f  64 65 20 4d 4f 44 20 32  |0 X%=mcode MOD 2|
00004730  35 36 0d 20 31 31 35 30  20 59 25 3d 6d 63 6f 64  |56. 1150 Y%=mcod|
00004740  65 20 44 49 56 20 32 35  36 0d 20 31 31 36 30 20  |e DIV 256. 1160 |
00004750  43 41 4c 4c 20 6f 73 63  6c 69 0d 20 31 31 37 30  |CALL oscli. 1170|
00004760  20 79 65 73 24 3d 22 22  0d 20 31 31 38 30 20 55  | yes$="". 1180 U|
00004770  4e 54 49 4c 20 46 41 4c  53 45 0d 20 31 31 39 30  |NTIL FALSE. 1190|
00004780  20 45 4e 44 50 52 4f 43  0d                       | ENDPROC.|
00004789
23_10_87/T\SWR01.m0
23_10_87/T\SWR01.m1
23_10_87/T\SWR01.m2
23_10_87/T\SWR01.m4
23_10_87/T\SWR01.m5