Home » CEEFAX disks » telesoftware3.adl » 01_11_87/T\SWR02

01_11_87/T\SWR02

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: 01_11_87/T\SWR02
Read OK:
File size: 49FA 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 02 - Rom headers
------------------------------------------------------

  Paged roms and sideways rams can contain languages, utilities or
programs and data stored in the RFS. All roms, whatever they contain,
must be recognised by the operating system. To be recognised the first
dozen or so bytes must use the rom header format shown in figure 2.1.
The first 10 bytes of the header from &8000 to &8009 have fixed
positions in memory and must conform with the pattern shown but,
because the copyright and title strings vary in length and because
some of the rest of the header is optional, the header does not have a
fixed size.



        Memory map               Memory map
         of rom                  of header
&BFFF +-----------+      /+-----------------------+
      !           !     / !Tube relocation address!
      !           !     ! !&00                    !
      !           !    /  !Copyright string       !
      !           !    !  !&00                    !
      !           !   /   !Optional version string!
      !  Rom code !   !   !&00                    !
      !           !  /    !Rom title string       ! &8009- ...
      !           !  !    !Binary version number  ! &8008
      +-----------+ /     !Copyright offset       ! &8007
      !Interpreter! !     !Rom type byte          ! &8006
      +-----------+/      !JMP service            ! &8003-&8005
      !  Header   !       !JMP language           ! &8000-&8002
&8000 +-----------+ - - - +-----------------------+

Figure 2.1 The Rom Header
-------------------------



  The first three bytes of the rom header (&8000-&8002) contain the
language entry point or, if the rom is not a language, the three bytes
will all be zero. The first byte of the language entry point is a JMP
opcode followed by the two byte address of the start of the language
coding. A language in the BBC micro can be any machine code program
which is completely independant of any other language and can take
over the processing of input and the production of output until
another language is selected to replace it. As far as the BBC micro is
concerned Word processors, spreadsheets and machine code monitors all
fall into the same category as the more readily recognised languages
Logo, Forth and Pascal. Language roms will not be considered until
module 17 and so, for the first part of the course, the rom headers
will all have zero in the first three bytes.

  The next three bytes of the rom header (&8003-&8005) contain the
service entry point. All roms, except BASIC, must have a service entry
point. The first byte of the service entry point is a JMP opcode
followed by the two byte address of an interpreter which must process
the service requests made by the MOS. Service requests are made to
each rom in turn when, for example, the MOS finds an unrecognised *
command or when you type *HELP. The address of the interpreter is
usually the first byte after the end of the header, as shown in the
rom memory map, but you can assemble the interpreter anywhere you like
within the 16k of memory available to the SWR. The design of service
request interpreters will form a very important part of this course.

  The byte at &8006 is the rom type byte you met briefly in module 1.
The rom type byte is a flag byte which tells the MOS what the rom is
expected to do. Bit 1 of the byte is always set on all roms except
BASIC and bits 0, 2 and 3 are always clear. Bit 4 controls the
Electron soft key expansions and is always clear on the BBC micro. Bit
5 is set if the rom is a language rom with the language coding
assembled to run in a second processor. Bit 5 will be clear in all the
examples covered in this course. Bit 6 is set if the rom has a
language entry and bit 7 is set if the rom has a service entry. All
roms, except BASIC, have bit 7 set. In the examples covered in this
course the rom type byte will have one of only two values. Service
roms will have &82 stored at &8006 and language roms will have &C2
stored at &8006.

&82 = 1000 0010 binary, ie. service entry point and bit 1 set,

&C2 = 1100 0010 binary, ie. language and service entry points and bit
1 set.

  If you use the program READROM (from module 1) to look at some of
the roms you have in your computer there are two other values you
might find at &8006. BASIC has &60 stored at &8006 because it does not
have a service entry point and bit 1 is clear. "Hi" versions of
languages (except Hi-BASIC) have &D2 stored at &8006 because they have
a tube relocation address as well as language and service entry
points.

  The copyright offset pointer at &8007 is the offset from &8000 to
the zero byte preceding the mandatory copyright string. The copyright
string must start in the first &FF bytes of the rom image and the
copyright offset pointer stores the least significant byte of the
address of the zero byte preceding the string. (See figure 2.2)

  The binary version number at &8008 is ignored by the MOS. It can
have any value from &00 to &FF and is used to indicate the version
number of the rom.

  The title string starts at &8009 and must end with a zero byte. The
title string is printed out by the MOS on selection of the rom as a
language rom. It will also be used as a command name in the simple
one-command interpreters used in some of the modules in this course.

  The version string is optional and, if it is used, it must follow
the zero byte at the end of the title string. The version string will
not be used in any of the examples in this course.

  The copyright string is essential because the MOS uses this string
to recognise the rom and, if it does not exist, the rom will be
ignored by the MOS. The format must always be a zero byte followed by
"(C)" and whatever else you want to include and then another zero
byte. The minimum copyright string is a zero byte followed by "(C)"
and another zero byte.

  The tube relocation address, if present, is a 4 byte address at
which the language part of the rom has been assembled. Tube relocation
will not be covered in this course.

  Writing the source code for the header is much easier that writing
about it. The optional version string has been left out of all the
example programs. The source code for the header of the program TRACE
assembles as shown in figure 2.2. You can see that it is &29 bytes
long but it could be shorter if it used the minimum copyright string
of "(C)". Figure 2.2 is a BASIC 2 version of TRACE assembled with bit
zero of the OPT directive set.




8000 00       EQUB &00               \ No language
8001 00       EQUB &00               \ entry point
8002 00       EQUB &00
8003 4C 2A 80 JMP service            \ Service entry point
8006 82       EQUB &82               \ Rom type byte
8007 0E       EQUB copyright MOD 256 \ copyright offset
8008 00       EQUB &00               \ Binary version
8009 54 52 41 
     43 45    EQUS "TRACE"           \ Title string
800E          .copyright
800E 00       EQUB &00
800F 28 43 29 
     20 47 6F 
     72 64 6F 
     6E 20 48 
     6F 72 73 
     69 6E 67 
     74 6F 6E 
     20 31 39 
     38 37    EQUS "(C) Gordon Horsington 1987"
8029 00       EQUB &00
802A          .service               \ Start of interpreter

Figure 2.2 The rom header of TRACE
----------------------------------




  When the MOS requests the paged roms to provide a service the
highest priority rom, rom &0F, is offered the first opportunity to
respond to the request. It is entered at the service entry point with
the registers set up as shown in figure 2.3.




Register            Service call information
----------------------------------------------------------
Accumulator         Service type requested
X register          Number of current rom
Y register          Any parameter required for the service


Figure 2.3 Service call registers.
----------------------------------



  If rom &0F is unable to provide the service requested it must exit
using RTS with all three registers preserved and the next rom, rom
&0E, will be given the same opportunity to provide the service, and so
on down to rom &00. If a rom is able to provide the service requested,
and does not want any other rom to attempt to provide the same
service, the accumulator should be zero on exit.

  The program TRACE is used to provide a display of the service
requests made to the sideways ram bank containing the object code it
generates. Chain the program and, when prompted, give a filename for
the object code which will be saved on disc or tape before you load it
into SWR. It is not necessary to include a quotation mark before and
after the filename.  After saving the object code, load it into SWR
and press the Break key. You will immediately see a display of the
service requests sent to the roms when break is pressed. Type *HELP
and you will see the help service request. Type *DISC or *ROM or
whatever else you think will make service requests to the paged roms
and you will soon get to know the service request codes. Do not use
TRACE when *SPOOLing or *EXECing files. If you do it will cause the
computer to hang up. The service request codes are summerised in
figure 2.4.





00  No operation. A higher priority rom has already provided the
service requested.

01  Absolute workspace claim. This will be dealt with in module 12.

02  Private workspace claim. Modules 11 and 13.

03  Auto-boot. Modules 19, 23, 24.

04  Unrecognised command. Modules 3, 5, 8, 9, 10, 11, 13, 15, 16, 17,
20, 21, 22, 23, 24.

05  Unrecognised interupt. Module 14.

06  Break. Module 13.

07  Unrecognised Osbyte. Module 6.

08  Unrecognised Osword. Module 7.

09  *HELP. Modules 16, 17, 23, 24.

0A  Claim static workspace. Module 12.

0B  NMI release. Not covered in this course.

0C  NMI claim. Not covered in this course.

0D  Rom Filing System initialise. Modules 18, 19, 20, 21, 22, 23, 24.

0E  Rom Filing System byte get. Modules 18, 19, 20, 21, 22, 23, 24.

0F  Vectors claimed. Not covered in this course.

10  SPOOL/EXEC file closure warning. Not covered in this course.

11  Font implosion/explosion warning. Not covered in this course.

12  Initialise filing system. Not covered in this course.

FE  Tube system post initialisation. Modules 12, 22 (illegal use).

FF  Tube system main initialisation. Not covered in this course.


Figure 2.4 BBC B Service requests.
----------------------------------




  The program TRACE works by intercepting every service request sent
to the SWR. Before doing anything else it preserves the A, X and Y
registers and the two zero page memory locations used by the print
routine by pushing them on the stack (lines 310,370). It then
retrieves the service request from the stack and pushes it back onto
the top of the stack (lines 380-400) followed by the Y, X and A
registers again (lines 420-470). It then selects a yellow foreground
colour if Mode 7 is used (lines 480-560) and prints the content of the
accumulator, the X and Y registers in hexadecimal (lines 570-680). An
explanation of the service request type is then given for the BBC B
service requests (lines 690-870). The Master computer uses service
requests not available on the BBC B and the content of the registers
for these requests is shown but not described. The program exits with
all the registers and memory locations restored (lines 880-990).

  Having the trace active all the time is both distracting and
undesirable. You can disable the utility by read protecting the
sideways ram bank or by loading some other rom image to replace it.
Always press Ctrl+Break after read protecting SWR or reloading a rom
image.

  Although the Master computer uses service requests that are not
available on the B series it uses all the B series service requests as
well. For this reason all properly written software for the BBC B will
also work on the Master but it will not make use of the the extra
facilities, such as paged workspace, without responding to the Master
specific service requests.







   10 REM: TRACE
   20 MODE7
   30 HIMEM=&3C00
   40 DIM save 50
   50 diff=&8000-HIMEM
   60 address=&70
   70 stack=&105
   80 mode=&355
   90 osasci=&FFE3
  100 osnewl=&FFE7
  110 oscli=&FFF7
  120 FOR pass = 0 TO 2 STEP 2
  130 P%=HIMEM
  140 [       OPT pass
  150         BRK
  160         BRK
  170         BRK
  180         JMP service+diff
  190         OPT FNequb(&82)
  200         OPT FNequb((copyright+diff) MOD 256)
  210         BRK
  220         OPT FNequs("TRACE")
  230 .copyright
  240         BRK
  250         OPT FNequs("(C) Gordon Horsington 1987")
  260         BRK
  270 .service
  280         PHA
  290         TXA
  300         PHA
  310         TYA
  320         PHA
  330         LDA address
  340         PHA
  350         STX address
  360         LDA address+1
  370         PHA
  380         TSX
  390         LDA stack,X
  400         PHA
  410         STA address+1
  420         TYA
  430         PHA
  440         LDA address
  450         PHA
  460         LDA address+1
  470         PHA
  480         LDA mode
  490         CMP #&07
  500         BNE notmode7
  510         LDA #&83
  520         BNE space
  530 .notmode7
  540         LDA #ASC(" ")
  550 .space
  560         JSR osasci
  570         LDA #ASC("A")
  580         JSR equals+diff
  590         PLA
  600         JSR printbyte+diff
  610         LDA #ASC("X")
  620         JSR equals+diff
  630         PLA
  640         JSR printbyte+diff
  650         LDA #ASC("Y")
  660         JSR equals+diff
  670         PLA
  680         JSR printbyte+diff
  690         PLA
  700         CLC
  710         ADC #2
  720         CMP #&15
  730         BCS endprint
  740         ASL A
  750         TAY
  760         LDA index+diff,Y
  770         STA address
  780         INY
  790         LDA index+diff,Y
  800         STA address+1
  810         LDY #&FF
  820 .printloop
  830         INY
  840         LDA (address),Y
  850         BEQ endprint
  860         JSR osasci
  870         JMP printloop+diff
  880 .endprint
  890         JSR osnewl
  900         PLA
  910         STA address+1
  920         PLA
  930         STA address
  940         PLA
  950         TAY
  960         PLA
  970         TAX
  980         PLA
  990         RTS
 1000 .printbyte
 1010         PHA
 1020         LSR A
 1030         LSR A
 1040         LSR A
 1050         LSR A
 1060         JSR nibble+diff
 1070         PLA
 1080         JSR nibble+diff
 1090         LDA #ASC(" ")
 1100         JMP osasci
 1110 .nibble
 1120         AND #&0F
 1130         SED
 1140         CLC
 1150         ADC #&90
 1160         ADC #&40
 1170         CLD
 1180         JMP osasci
 1190 .equals
 1200         JSR osasci
 1210         LDA #ASC("=")
 1220         JMP osasci
 1230 .index
 1240         OPT FNequb((fe+diff) MOD 256)
 1250         OPT FNequb((fe+diff) DIV 256)
 1260         OPT FNequb((ff+diff) MOD 256)
 1270         OPT FNequb((ff+diff) DIV 256)
 1280         OPT FNequb((zero+diff) MOD 256)
 1290         OPT FNequb((zero+diff) DIV 256)
 1300         OPT FNequb((one+diff) MOD 256)
 1310         OPT FNequb((one+diff) DIV 256)
 1320         OPT FNequb((two+diff) MOD 256)
 1330         OPT FNequb((two+diff) DIV 256)
 1340         OPT FNequb((three+diff) MOD 256)
 1350         OPT FNequb((three+diff) DIV 256)
 1360         OPT FNequb((four+diff) MOD 256)
 1370         OPT FNequb((four+diff) DIV 256)
 1380         OPT FNequb((five+diff) MOD 256)
 1390         OPT FNequb((five+diff) DIV 256)
 1400         OPT FNequb((six+diff) MOD 256)
 1410         OPT FNequb((six+diff) DIV 256)
 1420         OPT FNequb((seven+diff) MOD 256)
 1430         OPT FNequb((seven+diff) DIV 256)
 1440         OPT FNequb((eight+diff) MOD 256)
 1450         OPT FNequb((eight+diff) DIV 256)
 1460         OPT FNequb((nine+diff) MOD 256)
 1470         OPT FNequb((nine+diff) DIV 256)
 1480         OPT FNequb((ten+diff) MOD 256)
 1490         OPT FNequb((ten+diff) DIV 256)
 1500         OPT FNequb((eleven+diff) MOD 256)
 1510         OPT FNequb((eleven+diff) DIV 256)
 1520         OPT FNequb((twelve+diff) MOD 256)
 1530         OPT FNequb((twelve+diff) DIV 256)
 1540         OPT FNequb((thirteen+diff) MOD 256)
 1550         OPT FNequb((thirteen+diff) DIV 256)
 1560         OPT FNequb((fourteen+diff) MOD 256)
 1570         OPT FNequb((fourteen+diff) DIV 256)
 1580         OPT FNequb((fifteen+diff) MOD 256)
 1590         OPT FNequb((fifteen+diff) DIV 256)
 1600         OPT FNequb((sixteen+diff) MOD 256)
 1610         OPT FNequb((sixteen+diff) DIV 256)
 1620         OPT FNequb((seventeen+diff) MOD 256)
 1630         OPT FNequb((seventeen+diff) DIV 256)
 1640         OPT FNequb((eighteen+diff) MOD 256)
 1650         OPT FNequb((eighteen+diff) DIV 256)
 1660 .fe
 1670         OPT FNequs("Tube system post init.")
 1680         BRK
 1690 .ff
 1700         OPT FNequs("Tube system main init.")
 1710         BRK
 1720 .zero
 1730         OPT FNequs("No operation")
 1740         BRK
 1750 .one
 1760         OPT FNequs("Abs. workspace claim")
 1770         BRK
 1780 .two
 1790         OPT FNequs("Private workspace claim")
 1800         BRK
 1810 .three
 1820         OPT FNequs("Auto-boot")
 1830         BRK
 1840 .four
 1850         OPT FNequs("Unrecognised command")
 1860         BRK
 1870 .five
 1880         OPT FNequs("Unrecognised interupt")
 1890         BRK
 1900 .six
 1910         OPT FNequs("Break")
 1920         BRK
 1930 .seven
 1940         OPT FNequs("Unrecognised Osbyte")
 1950         BRK
 1960 .eight
 1970         OPT FNequs("Unrecognised Osword")
 1980         BRK
 1990 .nine
 2000         OPT FNequs("Help")
 2010         BRK
 2020 .ten
 2030         OPT FNequs("Claim static workspace")
 2040         BRK
 2050 .eleven
 2060         OPT FNequs("NMI release")
 2070         BRK
 2080 .twelve
 2090         OPT FNequs("NMI claim")
 2100         BRK
 2110 .thirteen
 2120         OPT FNequs("RFS initialise")
 2130         BRK
 2140 .fourteen
 2150         OPT FNequs("RFS byte get")
 2160         BRK
 2170 .fifteen
 2180         OPT FNequs("Vectors claimed")
 2190         BRK
 2200 .sixteen
 2210         OPT FNequs("SPOOL/EXEC file closure")
 2220         BRK
 2230 .seventeen
 2240         OPT FNequs("Font implode/explode")
 2250         BRK
 2260 .eighteen
 2270         OPT FNequs("Init. filing system")
 2280         BRK
 2290 .lastbyte
 2300 ]
 2310 NEXT
 2320 INPUT'"Save filename? : "filename$
 2330 IF filename$="" END
 2340 $save="SAVE "+filename$+" "+STR$~(HIMEM)+" "+STR$~(las
      tbyte)+" FFFF8000 FFFF8000"
 2350 X%=save MOD 256
 2360 Y%=save DIV 256
 2370 *OPT1,2
 2380 CALL oscli
 2390 *OPT1,0
 2400 END
 2410 DEFFNequb(byte)
 2420 ?P%=byte
 2430 P%=P%+1
 2440 =pass
 2450 DEFFNequw(word)
 2460 ?P%=word MOD 256
 2470 P%?1=word DIV 256
 2480 P%=P%+2
 2490 =pass
 2500 DEFFNequd(double)
 2510 !P%=double
 2520 P%=P%+4
 2530 =pass
 2540 DEFFNequs(string$)
 2550 $P%=string$
 2560 P%=P%+LEN(string$)
 2570 =pass
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 32  20 2d 20 52 6f 6d 20 68  |odule 02 - Rom h|
00000030  65 61 64 65 72 73 0d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |eaders.---------|
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 0d 0d 20  |-------------.. |
00000070  20 50 61 67 65 64 20 72  6f 6d 73 20 61 6e 64 20  | Paged roms and |
00000080  73 69 64 65 77 61 79 73  20 72 61 6d 73 20 63 61  |sideways rams ca|
00000090  6e 20 63 6f 6e 74 61 69  6e 20 6c 61 6e 67 75 61  |n contain langua|
000000a0  67 65 73 2c 20 75 74 69  6c 69 74 69 65 73 20 6f  |ges, utilities o|
000000b0  72 0d 70 72 6f 67 72 61  6d 73 20 61 6e 64 20 64  |r.programs and d|
000000c0  61 74 61 20 73 74 6f 72  65 64 20 69 6e 20 74 68  |ata stored in th|
000000d0  65 20 52 46 53 2e 20 41  6c 6c 20 72 6f 6d 73 2c  |e RFS. All roms,|
000000e0  20 77 68 61 74 65 76 65  72 20 74 68 65 79 20 63  | whatever they c|
000000f0  6f 6e 74 61 69 6e 2c 0d  6d 75 73 74 20 62 65 20  |ontain,.must be |
00000100  72 65 63 6f 67 6e 69 73  65 64 20 62 79 20 74 68  |recognised by th|
00000110  65 20 6f 70 65 72 61 74  69 6e 67 20 73 79 73 74  |e operating syst|
00000120  65 6d 2e 20 54 6f 20 62  65 20 72 65 63 6f 67 6e  |em. To be recogn|
00000130  69 73 65 64 20 74 68 65  20 66 69 72 73 74 0d 64  |ised the first.d|
00000140  6f 7a 65 6e 20 6f 72 20  73 6f 20 62 79 74 65 73  |ozen or so bytes|
00000150  20 6d 75 73 74 20 75 73  65 20 74 68 65 20 72 6f  | must use the ro|
00000160  6d 20 68 65 61 64 65 72  20 66 6f 72 6d 61 74 20  |m header format |
00000170  73 68 6f 77 6e 20 69 6e  20 66 69 67 75 72 65 20  |shown in figure |
00000180  32 2e 31 2e 0d 54 68 65  20 66 69 72 73 74 20 31  |2.1..The first 1|
00000190  30 20 62 79 74 65 73 20  6f 66 20 74 68 65 20 68  |0 bytes of the h|
000001a0  65 61 64 65 72 20 66 72  6f 6d 20 26 38 30 30 30  |eader from &8000|
000001b0  20 74 6f 20 26 38 30 30  39 20 68 61 76 65 20 66  | to &8009 have f|
000001c0  69 78 65 64 0d 70 6f 73  69 74 69 6f 6e 73 20 69  |ixed.positions i|
000001d0  6e 20 6d 65 6d 6f 72 79  20 61 6e 64 20 6d 75 73  |n memory and mus|
000001e0  74 20 63 6f 6e 66 6f 72  6d 20 77 69 74 68 20 74  |t conform with t|
000001f0  68 65 20 70 61 74 74 65  72 6e 20 73 68 6f 77 6e  |he pattern shown|
00000200  20 62 75 74 2c 0d 62 65  63 61 75 73 65 20 74 68  | but,.because th|
00000210  65 20 63 6f 70 79 72 69  67 68 74 20 61 6e 64 20  |e copyright and |
00000220  74 69 74 6c 65 20 73 74  72 69 6e 67 73 20 76 61  |title strings va|
00000230  72 79 20 69 6e 20 6c 65  6e 67 74 68 20 61 6e 64  |ry in length and|
00000240  20 62 65 63 61 75 73 65  0d 73 6f 6d 65 20 6f 66  | because.some of|
00000250  20 74 68 65 20 72 65 73  74 20 6f 66 20 74 68 65  | the rest of the|
00000260  20 68 65 61 64 65 72 20  69 73 20 6f 70 74 69 6f  | header is optio|
00000270  6e 61 6c 2c 20 74 68 65  20 68 65 61 64 65 72 20  |nal, the header |
00000280  64 6f 65 73 20 6e 6f 74  20 68 61 76 65 20 61 0d  |does not have a.|
00000290  66 69 78 65 64 20 73 69  7a 65 2e 0d 0d 0d 0d 20  |fixed size..... |
000002a0  20 20 20 20 20 20 20 4d  65 6d 6f 72 79 20 6d 61  |       Memory ma|
000002b0  70 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |p               |
000002c0  4d 65 6d 6f 72 79 20 6d  61 70 0d 20 20 20 20 20  |Memory map.     |
000002d0  20 20 20 20 6f 66 20 72  6f 6d 20 20 20 20 20 20  |    of rom      |
000002e0  20 20 20 20 20 20 20 20  20 20 20 20 6f 66 20 68  |            of h|
000002f0  65 61 64 65 72 0d 26 42  46 46 46 20 2b 2d 2d 2d  |eader.&BFFF +---|
00000300  2d 2d 2d 2d 2d 2d 2d 2d  2b 20 20 20 20 20 20 2f  |--------+      /|
00000310  2b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |+---------------|
00000320  2d 2d 2d 2d 2d 2d 2d 2d  2b 0d 20 20 20 20 20 20  |--------+.      |
00000330  21 20 20 20 20 20 20 20  20 20 20 20 21 20 20 20  |!           !   |
00000340  20 20 2f 20 21 54 75 62  65 20 72 65 6c 6f 63 61  |  / !Tube reloca|
00000350  74 69 6f 6e 20 61 64 64  72 65 73 73 21 0d 20 20  |tion address!.  |
00000360  20 20 20 20 21 20 20 20  20 20 20 20 20 20 20 20  |    !           |
00000370  21 20 20 20 20 20 21 20  21 26 30 30 20 20 20 20  |!     ! !&00    |
00000380  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000390  21 0d 20 20 20 20 20 20  21 20 20 20 20 20 20 20  |!.      !       |
000003a0  20 20 20 20 21 20 20 20  20 2f 20 20 21 43 6f 70  |    !    /  !Cop|
000003b0  79 72 69 67 68 74 20 73  74 72 69 6e 67 20 20 20  |yright string   |
000003c0  20 20 20 20 21 0d 20 20  20 20 20 20 21 20 20 20  |    !.      !   |
000003d0  20 20 20 20 20 20 20 20  21 20 20 20 20 21 20 20  |        !    !  |
000003e0  21 26 30 30 20 20 20 20  20 20 20 20 20 20 20 20  |!&00            |
000003f0  20 20 20 20 20 20 20 20  21 0d 20 20 20 20 20 20  |        !.      |
00000400  21 20 20 20 20 20 20 20  20 20 20 20 21 20 20 20  |!           !   |
00000410  2f 20 20 20 21 4f 70 74  69 6f 6e 61 6c 20 76 65  |/   !Optional ve|
00000420  72 73 69 6f 6e 20 73 74  72 69 6e 67 21 0d 20 20  |rsion string!.  |
00000430  20 20 20 20 21 20 20 52  6f 6d 20 63 6f 64 65 20  |    !  Rom code |
00000440  21 20 20 20 21 20 20 20  21 26 30 30 20 20 20 20  |!   !   !&00    |
00000450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000460  21 0d 20 20 20 20 20 20  21 20 20 20 20 20 20 20  |!.      !       |
00000470  20 20 20 20 21 20 20 2f  20 20 20 20 21 52 6f 6d  |    !  /    !Rom|
00000480  20 74 69 74 6c 65 20 73  74 72 69 6e 67 20 20 20  | title string   |
00000490  20 20 20 20 21 20 26 38  30 30 39 2d 20 2e 2e 2e  |    ! &8009- ...|
000004a0  0d 20 20 20 20 20 20 21  20 20 20 20 20 20 20 20  |.      !        |
000004b0  20 20 20 21 20 20 21 20  20 20 20 21 42 69 6e 61  |   !  !    !Bina|
000004c0  72 79 20 76 65 72 73 69  6f 6e 20 6e 75 6d 62 65  |ry version numbe|
000004d0  72 20 20 21 20 26 38 30  30 38 0d 20 20 20 20 20  |r  ! &8008.     |
000004e0  20 2b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2b 20 2f  | +-----------+ /|
000004f0  20 20 20 20 20 21 43 6f  70 79 72 69 67 68 74 20  |     !Copyright |
00000500  6f 66 66 73 65 74 20 20  20 20 20 20 20 21 20 26  |offset       ! &|
00000510  38 30 30 37 0d 20 20 20  20 20 20 21 49 6e 74 65  |8007.      !Inte|
00000520  72 70 72 65 74 65 72 21  20 21 20 20 20 20 20 21  |rpreter! !     !|
00000530  52 6f 6d 20 74 79 70 65  20 62 79 74 65 20 20 20  |Rom type byte   |
00000540  20 20 20 20 20 20 20 21  20 26 38 30 30 36 0d 20  |       ! &8006. |
00000550  20 20 20 20 20 2b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |     +----------|
00000560  2d 2b 2f 20 20 20 20 20  20 21 4a 4d 50 20 73 65  |-+/      !JMP se|
00000570  72 76 69 63 65 20 20 20  20 20 20 20 20 20 20 20  |rvice           |
00000580  20 21 20 26 38 30 30 33  2d 26 38 30 30 35 0d 20  | ! &8003-&8005. |
00000590  20 20 20 20 20 21 20 20  48 65 61 64 65 72 20 20  |     !  Header  |
000005a0  20 21 20 20 20 20 20 20  20 21 4a 4d 50 20 6c 61  | !       !JMP la|
000005b0  6e 67 75 61 67 65 20 20  20 20 20 20 20 20 20 20  |nguage          |
000005c0  20 21 20 26 38 30 30 30  2d 26 38 30 30 32 0d 26  | ! &8000-&8002.&|
000005d0  38 30 30 30 20 2b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |8000 +----------|
000005e0  2d 2b 20 2d 20 2d 20 2d  20 2b 2d 2d 2d 2d 2d 2d  |-+ - - - +------|
000005f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000600  2d 2b 0d 0d 46 69 67 75  72 65 20 32 2e 31 20 54  |-+..Figure 2.1 T|
00000610  68 65 20 52 6f 6d 20 48  65 61 64 65 72 0d 2d 2d  |he Rom Header.--|
00000620  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000630  2d 2d 2d 2d 2d 2d 2d 0d  0d 0d 0d 20 20 54 68 65  |-------....  The|
00000640  20 66 69 72 73 74 20 74  68 72 65 65 20 62 79 74  | first three byt|
00000650  65 73 20 6f 66 20 74 68  65 20 72 6f 6d 20 68 65  |es of the rom he|
00000660  61 64 65 72 20 28 26 38  30 30 30 2d 26 38 30 30  |ader (&8000-&800|
00000670  32 29 20 63 6f 6e 74 61  69 6e 20 74 68 65 0d 6c  |2) contain the.l|
00000680  61 6e 67 75 61 67 65 20  65 6e 74 72 79 20 70 6f  |anguage entry po|
00000690  69 6e 74 20 6f 72 2c 20  69 66 20 74 68 65 20 72  |int or, if the r|
000006a0  6f 6d 20 69 73 20 6e 6f  74 20 61 20 6c 61 6e 67  |om is not a lang|
000006b0  75 61 67 65 2c 20 74 68  65 20 74 68 72 65 65 20  |uage, the three |
000006c0  62 79 74 65 73 0d 77 69  6c 6c 20 61 6c 6c 20 62  |bytes.will all b|
000006d0  65 20 7a 65 72 6f 2e 20  54 68 65 20 66 69 72 73  |e zero. The firs|
000006e0  74 20 62 79 74 65 20 6f  66 20 74 68 65 20 6c 61  |t byte of the la|
000006f0  6e 67 75 61 67 65 20 65  6e 74 72 79 20 70 6f 69  |nguage entry poi|
00000700  6e 74 20 69 73 20 61 20  4a 4d 50 0d 6f 70 63 6f  |nt is a JMP.opco|
00000710  64 65 20 66 6f 6c 6c 6f  77 65 64 20 62 79 20 74  |de followed by t|
00000720  68 65 20 74 77 6f 20 62  79 74 65 20 61 64 64 72  |he two byte addr|
00000730  65 73 73 20 6f 66 20 74  68 65 20 73 74 61 72 74  |ess of the start|
00000740  20 6f 66 20 74 68 65 20  6c 61 6e 67 75 61 67 65  | of the language|
00000750  0d 63 6f 64 69 6e 67 2e  20 41 20 6c 61 6e 67 75  |.coding. A langu|
00000760  61 67 65 20 69 6e 20 74  68 65 20 42 42 43 20 6d  |age in the BBC m|
00000770  69 63 72 6f 20 63 61 6e  20 62 65 20 61 6e 79 20  |icro can be any |
00000780  6d 61 63 68 69 6e 65 20  63 6f 64 65 20 70 72 6f  |machine code pro|
00000790  67 72 61 6d 0d 77 68 69  63 68 20 69 73 20 63 6f  |gram.which is co|
000007a0  6d 70 6c 65 74 65 6c 79  20 69 6e 64 65 70 65 6e  |mpletely indepen|
000007b0  64 61 6e 74 20 6f 66 20  61 6e 79 20 6f 74 68 65  |dant of any othe|
000007c0  72 20 6c 61 6e 67 75 61  67 65 20 61 6e 64 20 63  |r language and c|
000007d0  61 6e 20 74 61 6b 65 0d  6f 76 65 72 20 74 68 65  |an take.over the|
000007e0  20 70 72 6f 63 65 73 73  69 6e 67 20 6f 66 20 69  | processing of i|
000007f0  6e 70 75 74 20 61 6e 64  20 74 68 65 20 70 72 6f  |nput and the pro|
00000800  64 75 63 74 69 6f 6e 20  6f 66 20 6f 75 74 70 75  |duction of outpu|
00000810  74 20 75 6e 74 69 6c 0d  61 6e 6f 74 68 65 72 20  |t until.another |
00000820  6c 61 6e 67 75 61 67 65  20 69 73 20 73 65 6c 65  |language is sele|
00000830  63 74 65 64 20 74 6f 20  72 65 70 6c 61 63 65 20  |cted to replace |
00000840  69 74 2e 20 41 73 20 66  61 72 20 61 73 20 74 68  |it. As far as th|
00000850  65 20 42 42 43 20 6d 69  63 72 6f 20 69 73 0d 63  |e BBC micro is.c|
00000860  6f 6e 63 65 72 6e 65 64  20 57 6f 72 64 20 70 72  |oncerned Word pr|
00000870  6f 63 65 73 73 6f 72 73  2c 20 73 70 72 65 61 64  |ocessors, spread|
00000880  73 68 65 65 74 73 20 61  6e 64 20 6d 61 63 68 69  |sheets and machi|
00000890  6e 65 20 63 6f 64 65 20  6d 6f 6e 69 74 6f 72 73  |ne code monitors|
000008a0  20 61 6c 6c 0d 66 61 6c  6c 20 69 6e 74 6f 20 74  | all.fall into t|
000008b0  68 65 20 73 61 6d 65 20  63 61 74 65 67 6f 72 79  |he same category|
000008c0  20 61 73 20 74 68 65 20  6d 6f 72 65 20 72 65 61  | as the more rea|
000008d0  64 69 6c 79 20 72 65 63  6f 67 6e 69 73 65 64 20  |dily recognised |
000008e0  6c 61 6e 67 75 61 67 65  73 0d 4c 6f 67 6f 2c 20  |languages.Logo, |
000008f0  46 6f 72 74 68 20 61 6e  64 20 50 61 73 63 61 6c  |Forth and Pascal|
00000900  2e 20 4c 61 6e 67 75 61  67 65 20 72 6f 6d 73 20  |. Language roms |
00000910  77 69 6c 6c 20 6e 6f 74  20 62 65 20 63 6f 6e 73  |will not be cons|
00000920  69 64 65 72 65 64 20 75  6e 74 69 6c 0d 6d 6f 64  |idered until.mod|
00000930  75 6c 65 20 31 37 20 61  6e 64 20 73 6f 2c 20 66  |ule 17 and so, f|
00000940  6f 72 20 74 68 65 20 66  69 72 73 74 20 70 61 72  |or the first par|
00000950  74 20 6f 66 20 74 68 65  20 63 6f 75 72 73 65 2c  |t of the course,|
00000960  20 74 68 65 20 72 6f 6d  20 68 65 61 64 65 72 73  | the rom headers|
00000970  0d 77 69 6c 6c 20 61 6c  6c 20 68 61 76 65 20 7a  |.will all have z|
00000980  65 72 6f 20 69 6e 20 74  68 65 20 66 69 72 73 74  |ero in the first|
00000990  20 74 68 72 65 65 20 62  79 74 65 73 2e 0d 0d 20  | three bytes... |
000009a0  20 54 68 65 20 6e 65 78  74 20 74 68 72 65 65 20  | The next three |
000009b0  62 79 74 65 73 20 6f 66  20 74 68 65 20 72 6f 6d  |bytes of the rom|
000009c0  20 68 65 61 64 65 72 20  28 26 38 30 30 33 2d 26  | header (&8003-&|
000009d0  38 30 30 35 29 20 63 6f  6e 74 61 69 6e 20 74 68  |8005) contain th|
000009e0  65 0d 73 65 72 76 69 63  65 20 65 6e 74 72 79 20  |e.service entry |
000009f0  70 6f 69 6e 74 2e 20 41  6c 6c 20 72 6f 6d 73 2c  |point. All roms,|
00000a00  20 65 78 63 65 70 74 20  42 41 53 49 43 2c 20 6d  | except BASIC, m|
00000a10  75 73 74 20 68 61 76 65  20 61 20 73 65 72 76 69  |ust have a servi|
00000a20  63 65 20 65 6e 74 72 79  0d 70 6f 69 6e 74 2e 20  |ce entry.point. |
00000a30  54 68 65 20 66 69 72 73  74 20 62 79 74 65 20 6f  |The first byte o|
00000a40  66 20 74 68 65 20 73 65  72 76 69 63 65 20 65 6e  |f the service en|
00000a50  74 72 79 20 70 6f 69 6e  74 20 69 73 20 61 20 4a  |try point is a J|
00000a60  4d 50 20 6f 70 63 6f 64  65 0d 66 6f 6c 6c 6f 77  |MP opcode.follow|
00000a70  65 64 20 62 79 20 74 68  65 20 74 77 6f 20 62 79  |ed by the two by|
00000a80  74 65 20 61 64 64 72 65  73 73 20 6f 66 20 61 6e  |te address of an|
00000a90  20 69 6e 74 65 72 70 72  65 74 65 72 20 77 68 69  | interpreter whi|
00000aa0  63 68 20 6d 75 73 74 20  70 72 6f 63 65 73 73 0d  |ch must process.|
00000ab0  74 68 65 20 73 65 72 76  69 63 65 20 72 65 71 75  |the service requ|
00000ac0  65 73 74 73 20 6d 61 64  65 20 62 79 20 74 68 65  |ests made by the|
00000ad0  20 4d 4f 53 2e 20 53 65  72 76 69 63 65 20 72 65  | MOS. Service re|
00000ae0  71 75 65 73 74 73 20 61  72 65 20 6d 61 64 65 20  |quests are made |
00000af0  74 6f 0d 65 61 63 68 20  72 6f 6d 20 69 6e 20 74  |to.each rom in t|
00000b00  75 72 6e 20 77 68 65 6e  2c 20 66 6f 72 20 65 78  |urn when, for ex|
00000b10  61 6d 70 6c 65 2c 20 74  68 65 20 4d 4f 53 20 66  |ample, the MOS f|
00000b20  69 6e 64 73 20 61 6e 20  75 6e 72 65 63 6f 67 6e  |inds an unrecogn|
00000b30  69 73 65 64 20 2a 0d 63  6f 6d 6d 61 6e 64 20 6f  |ised *.command o|
00000b40  72 20 77 68 65 6e 20 79  6f 75 20 74 79 70 65 20  |r when you type |
00000b50  2a 48 45 4c 50 2e 20 54  68 65 20 61 64 64 72 65  |*HELP. The addre|
00000b60  73 73 20 6f 66 20 74 68  65 20 69 6e 74 65 72 70  |ss of the interp|
00000b70  72 65 74 65 72 20 69 73  0d 75 73 75 61 6c 6c 79  |reter is.usually|
00000b80  20 74 68 65 20 66 69 72  73 74 20 62 79 74 65 20  | the first byte |
00000b90  61 66 74 65 72 20 74 68  65 20 65 6e 64 20 6f 66  |after the end of|
00000ba0  20 74 68 65 20 68 65 61  64 65 72 2c 20 61 73 20  | the header, as |
00000bb0  73 68 6f 77 6e 20 69 6e  20 74 68 65 0d 72 6f 6d  |shown in the.rom|
00000bc0  20 6d 65 6d 6f 72 79 20  6d 61 70 2c 20 62 75 74  | memory map, but|
00000bd0  20 79 6f 75 20 63 61 6e  20 61 73 73 65 6d 62 6c  | you can assembl|
00000be0  65 20 74 68 65 20 69 6e  74 65 72 70 72 65 74 65  |e the interprete|
00000bf0  72 20 61 6e 79 77 68 65  72 65 20 79 6f 75 20 6c  |r anywhere you l|
00000c00  69 6b 65 0d 77 69 74 68  69 6e 20 74 68 65 20 31  |ike.within the 1|
00000c10  36 6b 20 6f 66 20 6d 65  6d 6f 72 79 20 61 76 61  |6k of memory ava|
00000c20  69 6c 61 62 6c 65 20 74  6f 20 74 68 65 20 53 57  |ilable to the SW|
00000c30  52 2e 20 54 68 65 20 64  65 73 69 67 6e 20 6f 66  |R. The design of|
00000c40  20 73 65 72 76 69 63 65  0d 72 65 71 75 65 73 74  | service.request|
00000c50  20 69 6e 74 65 72 70 72  65 74 65 72 73 20 77 69  | interpreters wi|
00000c60  6c 6c 20 66 6f 72 6d 20  61 20 76 65 72 79 20 69  |ll form a very i|
00000c70  6d 70 6f 72 74 61 6e 74  20 70 61 72 74 20 6f 66  |mportant part of|
00000c80  20 74 68 69 73 20 63 6f  75 72 73 65 2e 0d 0d 20  | this course... |
00000c90  20 54 68 65 20 62 79 74  65 20 61 74 20 26 38 30  | The byte at &80|
00000ca0  30 36 20 69 73 20 74 68  65 20 72 6f 6d 20 74 79  |06 is the rom ty|
00000cb0  70 65 20 62 79 74 65 20  79 6f 75 20 6d 65 74 20  |pe byte you met |
00000cc0  62 72 69 65 66 6c 79 20  69 6e 20 6d 6f 64 75 6c  |briefly in modul|
00000cd0  65 20 31 2e 0d 54 68 65  20 72 6f 6d 20 74 79 70  |e 1..The rom typ|
00000ce0  65 20 62 79 74 65 20 69  73 20 61 20 66 6c 61 67  |e byte is a flag|
00000cf0  20 62 79 74 65 20 77 68  69 63 68 20 74 65 6c 6c  | byte which tell|
00000d00  73 20 74 68 65 20 4d 4f  53 20 77 68 61 74 20 74  |s the MOS what t|
00000d10  68 65 20 72 6f 6d 20 69  73 0d 65 78 70 65 63 74  |he rom is.expect|
00000d20  65 64 20 74 6f 20 64 6f  2e 20 42 69 74 20 31 20  |ed to do. Bit 1 |
00000d30  6f 66 20 74 68 65 20 62  79 74 65 20 69 73 20 61  |of the byte is a|
00000d40  6c 77 61 79 73 20 73 65  74 20 6f 6e 20 61 6c 6c  |lways set on all|
00000d50  20 72 6f 6d 73 20 65 78  63 65 70 74 0d 42 41 53  | roms except.BAS|
00000d60  49 43 20 61 6e 64 20 62  69 74 73 20 30 2c 20 32  |IC and bits 0, 2|
00000d70  20 61 6e 64 20 33 20 61  72 65 20 61 6c 77 61 79  | and 3 are alway|
00000d80  73 20 63 6c 65 61 72 2e  20 42 69 74 20 34 20 63  |s clear. Bit 4 c|
00000d90  6f 6e 74 72 6f 6c 73 20  74 68 65 0d 45 6c 65 63  |ontrols the.Elec|
00000da0  74 72 6f 6e 20 73 6f 66  74 20 6b 65 79 20 65 78  |tron soft key ex|
00000db0  70 61 6e 73 69 6f 6e 73  20 61 6e 64 20 69 73 20  |pansions and is |
00000dc0  61 6c 77 61 79 73 20 63  6c 65 61 72 20 6f 6e 20  |always clear on |
00000dd0  74 68 65 20 42 42 43 20  6d 69 63 72 6f 2e 20 42  |the BBC micro. B|
00000de0  69 74 0d 35 20 69 73 20  73 65 74 20 69 66 20 74  |it.5 is set if t|
00000df0  68 65 20 72 6f 6d 20 69  73 20 61 20 6c 61 6e 67  |he rom is a lang|
00000e00  75 61 67 65 20 72 6f 6d  20 77 69 74 68 20 74 68  |uage rom with th|
00000e10  65 20 6c 61 6e 67 75 61  67 65 20 63 6f 64 69 6e  |e language codin|
00000e20  67 0d 61 73 73 65 6d 62  6c 65 64 20 74 6f 20 72  |g.assembled to r|
00000e30  75 6e 20 69 6e 20 61 20  73 65 63 6f 6e 64 20 70  |un in a second p|
00000e40  72 6f 63 65 73 73 6f 72  2e 20 42 69 74 20 35 20  |rocessor. Bit 5 |
00000e50  77 69 6c 6c 20 62 65 20  63 6c 65 61 72 20 69 6e  |will be clear in|
00000e60  20 61 6c 6c 20 74 68 65  0d 65 78 61 6d 70 6c 65  | all the.example|
00000e70  73 20 63 6f 76 65 72 65  64 20 69 6e 20 74 68 69  |s covered in thi|
00000e80  73 20 63 6f 75 72 73 65  2e 20 42 69 74 20 36 20  |s course. Bit 6 |
00000e90  69 73 20 73 65 74 20 69  66 20 74 68 65 20 72 6f  |is set if the ro|
00000ea0  6d 20 68 61 73 20 61 0d  6c 61 6e 67 75 61 67 65  |m has a.language|
00000eb0  20 65 6e 74 72 79 20 61  6e 64 20 62 69 74 20 37  | entry and bit 7|
00000ec0  20 69 73 20 73 65 74 20  69 66 20 74 68 65 20 72  | is set if the r|
00000ed0  6f 6d 20 68 61 73 20 61  20 73 65 72 76 69 63 65  |om has a service|
00000ee0  20 65 6e 74 72 79 2e 20  41 6c 6c 0d 72 6f 6d 73  | entry. All.roms|
00000ef0  2c 20 65 78 63 65 70 74  20 42 41 53 49 43 2c 20  |, except BASIC, |
00000f00  68 61 76 65 20 62 69 74  20 37 20 73 65 74 2e 20  |have bit 7 set. |
00000f10  49 6e 20 74 68 65 20 65  78 61 6d 70 6c 65 73 20  |In the examples |
00000f20  63 6f 76 65 72 65 64 20  69 6e 20 74 68 69 73 0d  |covered in this.|
00000f30  63 6f 75 72 73 65 20 74  68 65 20 72 6f 6d 20 74  |course the rom t|
00000f40  79 70 65 20 62 79 74 65  20 77 69 6c 6c 20 68 61  |ype byte will ha|
00000f50  76 65 20 6f 6e 65 20 6f  66 20 6f 6e 6c 79 20 74  |ve one of only t|
00000f60  77 6f 20 76 61 6c 75 65  73 2e 20 53 65 72 76 69  |wo values. Servi|
00000f70  63 65 0d 72 6f 6d 73 20  77 69 6c 6c 20 68 61 76  |ce.roms will hav|
00000f80  65 20 26 38 32 20 73 74  6f 72 65 64 20 61 74 20  |e &82 stored at |
00000f90  26 38 30 30 36 20 61 6e  64 20 6c 61 6e 67 75 61  |&8006 and langua|
00000fa0  67 65 20 72 6f 6d 73 20  77 69 6c 6c 20 68 61 76  |ge roms will hav|
00000fb0  65 20 26 43 32 0d 73 74  6f 72 65 64 20 61 74 20  |e &C2.stored at |
00000fc0  26 38 30 30 36 2e 0d 0d  26 38 32 20 3d 20 31 30  |&8006...&82 = 10|
00000fd0  30 30 20 30 30 31 30 20  62 69 6e 61 72 79 2c 20  |00 0010 binary, |
00000fe0  69 65 2e 20 73 65 72 76  69 63 65 20 65 6e 74 72  |ie. service entr|
00000ff0  79 20 70 6f 69 6e 74 20  61 6e 64 20 62 69 74 20  |y point and bit |
00001000  31 20 73 65 74 2c 0d 0d  26 43 32 20 3d 20 31 31  |1 set,..&C2 = 11|
00001010  30 30 20 30 30 31 30 20  62 69 6e 61 72 79 2c 20  |00 0010 binary, |
00001020  69 65 2e 20 6c 61 6e 67  75 61 67 65 20 61 6e 64  |ie. language and|
00001030  20 73 65 72 76 69 63 65  20 65 6e 74 72 79 20 70  | service entry p|
00001040  6f 69 6e 74 73 20 61 6e  64 20 62 69 74 0d 31 20  |oints and bit.1 |
00001050  73 65 74 2e 0d 0d 20 20  49 66 20 79 6f 75 20 75  |set...  If you u|
00001060  73 65 20 74 68 65 20 70  72 6f 67 72 61 6d 20 52  |se the program R|
00001070  45 41 44 52 4f 4d 20 28  66 72 6f 6d 20 6d 6f 64  |EADROM (from mod|
00001080  75 6c 65 20 31 29 20 74  6f 20 6c 6f 6f 6b 20 61  |ule 1) to look a|
00001090  74 20 73 6f 6d 65 20 6f  66 0d 74 68 65 20 72 6f  |t some of.the ro|
000010a0  6d 73 20 79 6f 75 20 68  61 76 65 20 69 6e 20 79  |ms you have in y|
000010b0  6f 75 72 20 63 6f 6d 70  75 74 65 72 20 74 68 65  |our computer the|
000010c0  72 65 20 61 72 65 20 74  77 6f 20 6f 74 68 65 72  |re are two other|
000010d0  20 76 61 6c 75 65 73 20  79 6f 75 0d 6d 69 67 68  | values you.migh|
000010e0  74 20 66 69 6e 64 20 61  74 20 26 38 30 30 36 2e  |t find at &8006.|
000010f0  20 42 41 53 49 43 20 68  61 73 20 26 36 30 20 73  | BASIC has &60 s|
00001100  74 6f 72 65 64 20 61 74  20 26 38 30 30 36 20 62  |tored at &8006 b|
00001110  65 63 61 75 73 65 20 69  74 20 64 6f 65 73 20 6e  |ecause it does n|
00001120  6f 74 0d 68 61 76 65 20  61 20 73 65 72 76 69 63  |ot.have a servic|
00001130  65 20 65 6e 74 72 79 20  70 6f 69 6e 74 20 61 6e  |e entry point an|
00001140  64 20 62 69 74 20 31 20  69 73 20 63 6c 65 61 72  |d bit 1 is clear|
00001150  2e 20 22 48 69 22 20 76  65 72 73 69 6f 6e 73 20  |. "Hi" versions |
00001160  6f 66 0d 6c 61 6e 67 75  61 67 65 73 20 28 65 78  |of.languages (ex|
00001170  63 65 70 74 20 48 69 2d  42 41 53 49 43 29 20 68  |cept Hi-BASIC) h|
00001180  61 76 65 20 26 44 32 20  73 74 6f 72 65 64 20 61  |ave &D2 stored a|
00001190  74 20 26 38 30 30 36 20  62 65 63 61 75 73 65 20  |t &8006 because |
000011a0  74 68 65 79 20 68 61 76  65 0d 61 20 74 75 62 65  |they have.a tube|
000011b0  20 72 65 6c 6f 63 61 74  69 6f 6e 20 61 64 64 72  | relocation addr|
000011c0  65 73 73 20 61 73 20 77  65 6c 6c 20 61 73 20 6c  |ess as well as l|
000011d0  61 6e 67 75 61 67 65 20  61 6e 64 20 73 65 72 76  |anguage and serv|
000011e0  69 63 65 20 65 6e 74 72  79 0d 70 6f 69 6e 74 73  |ice entry.points|
000011f0  2e 0d 0d 20 20 54 68 65  20 63 6f 70 79 72 69 67  |...  The copyrig|
00001200  68 74 20 6f 66 66 73 65  74 20 70 6f 69 6e 74 65  |ht offset pointe|
00001210  72 20 61 74 20 26 38 30  30 37 20 69 73 20 74 68  |r at &8007 is th|
00001220  65 20 6f 66 66 73 65 74  20 66 72 6f 6d 20 26 38  |e offset from &8|
00001230  30 30 30 20 74 6f 0d 74  68 65 20 7a 65 72 6f 20  |000 to.the zero |
00001240  62 79 74 65 20 70 72 65  63 65 64 69 6e 67 20 74  |byte preceding t|
00001250  68 65 20 6d 61 6e 64 61  74 6f 72 79 20 63 6f 70  |he mandatory cop|
00001260  79 72 69 67 68 74 20 73  74 72 69 6e 67 2e 20 54  |yright string. T|
00001270  68 65 20 63 6f 70 79 72  69 67 68 74 0d 73 74 72  |he copyright.str|
00001280  69 6e 67 20 6d 75 73 74  20 73 74 61 72 74 20 69  |ing must start i|
00001290  6e 20 74 68 65 20 66 69  72 73 74 20 26 46 46 20  |n the first &FF |
000012a0  62 79 74 65 73 20 6f 66  20 74 68 65 20 72 6f 6d  |bytes of the rom|
000012b0  20 69 6d 61 67 65 20 61  6e 64 20 74 68 65 0d 63  | image and the.c|
000012c0  6f 70 79 72 69 67 68 74  20 6f 66 66 73 65 74 20  |opyright offset |
000012d0  70 6f 69 6e 74 65 72 20  73 74 6f 72 65 73 20 74  |pointer stores t|
000012e0  68 65 20 6c 65 61 73 74  20 73 69 67 6e 69 66 69  |he least signifi|
000012f0  63 61 6e 74 20 62 79 74  65 20 6f 66 20 74 68 65  |cant byte of the|
00001300  0d 61 64 64 72 65 73 73  20 6f 66 20 74 68 65 20  |.address of the |
00001310  7a 65 72 6f 20 62 79 74  65 20 70 72 65 63 65 64  |zero byte preced|
00001320  69 6e 67 20 74 68 65 20  73 74 72 69 6e 67 2e 20  |ing the string. |
00001330  28 53 65 65 20 66 69 67  75 72 65 20 32 2e 32 29  |(See figure 2.2)|
00001340  0d 0d 20 20 54 68 65 20  62 69 6e 61 72 79 20 76  |..  The binary v|
00001350  65 72 73 69 6f 6e 20 6e  75 6d 62 65 72 20 61 74  |ersion number at|
00001360  20 26 38 30 30 38 20 69  73 20 69 67 6e 6f 72 65  | &8008 is ignore|
00001370  64 20 62 79 20 74 68 65  20 4d 4f 53 2e 20 49 74  |d by the MOS. It|
00001380  20 63 61 6e 0d 68 61 76  65 20 61 6e 79 20 76 61  | can.have any va|
00001390  6c 75 65 20 66 72 6f 6d  20 26 30 30 20 74 6f 20  |lue from &00 to |
000013a0  26 46 46 20 61 6e 64 20  69 73 20 75 73 65 64 20  |&FF and is used |
000013b0  74 6f 20 69 6e 64 69 63  61 74 65 20 74 68 65 20  |to indicate the |
000013c0  76 65 72 73 69 6f 6e 0d  6e 75 6d 62 65 72 20 6f  |version.number o|
000013d0  66 20 74 68 65 20 72 6f  6d 2e 0d 0d 20 20 54 68  |f the rom...  Th|
000013e0  65 20 74 69 74 6c 65 20  73 74 72 69 6e 67 20 73  |e title string s|
000013f0  74 61 72 74 73 20 61 74  20 26 38 30 30 39 20 61  |tarts at &8009 a|
00001400  6e 64 20 6d 75 73 74 20  65 6e 64 20 77 69 74 68  |nd must end with|
00001410  20 61 20 7a 65 72 6f 20  62 79 74 65 2e 20 54 68  | a zero byte. Th|
00001420  65 0d 74 69 74 6c 65 20  73 74 72 69 6e 67 20 69  |e.title string i|
00001430  73 20 70 72 69 6e 74 65  64 20 6f 75 74 20 62 79  |s printed out by|
00001440  20 74 68 65 20 4d 4f 53  20 6f 6e 20 73 65 6c 65  | the MOS on sele|
00001450  63 74 69 6f 6e 20 6f 66  20 74 68 65 20 72 6f 6d  |ction of the rom|
00001460  20 61 73 20 61 0d 6c 61  6e 67 75 61 67 65 20 72  | as a.language r|
00001470  6f 6d 2e 20 49 74 20 77  69 6c 6c 20 61 6c 73 6f  |om. It will also|
00001480  20 62 65 20 75 73 65 64  20 61 73 20 61 20 63 6f  | be used as a co|
00001490  6d 6d 61 6e 64 20 6e 61  6d 65 20 69 6e 20 74 68  |mmand name in th|
000014a0  65 20 73 69 6d 70 6c 65  0d 6f 6e 65 2d 63 6f 6d  |e simple.one-com|
000014b0  6d 61 6e 64 20 69 6e 74  65 72 70 72 65 74 65 72  |mand interpreter|
000014c0  73 20 75 73 65 64 20 69  6e 20 73 6f 6d 65 20 6f  |s used in some o|
000014d0  66 20 74 68 65 20 6d 6f  64 75 6c 65 73 20 69 6e  |f the modules in|
000014e0  20 74 68 69 73 20 63 6f  75 72 73 65 2e 0d 0d 20  | this course... |
000014f0  20 54 68 65 20 76 65 72  73 69 6f 6e 20 73 74 72  | The version str|
00001500  69 6e 67 20 69 73 20 6f  70 74 69 6f 6e 61 6c 20  |ing is optional |
00001510  61 6e 64 2c 20 69 66 20  69 74 20 69 73 20 75 73  |and, if it is us|
00001520  65 64 2c 20 69 74 20 6d  75 73 74 20 66 6f 6c 6c  |ed, it must foll|
00001530  6f 77 0d 74 68 65 20 7a  65 72 6f 20 62 79 74 65  |ow.the zero byte|
00001540  20 61 74 20 74 68 65 20  65 6e 64 20 6f 66 20 74  | at the end of t|
00001550  68 65 20 74 69 74 6c 65  20 73 74 72 69 6e 67 2e  |he title string.|
00001560  20 54 68 65 20 76 65 72  73 69 6f 6e 20 73 74 72  | The version str|
00001570  69 6e 67 20 77 69 6c 6c  0d 6e 6f 74 20 62 65 20  |ing will.not be |
00001580  75 73 65 64 20 69 6e 20  61 6e 79 20 6f 66 20 74  |used in any of t|
00001590  68 65 20 65 78 61 6d 70  6c 65 73 20 69 6e 20 74  |he examples in t|
000015a0  68 69 73 20 63 6f 75 72  73 65 2e 0d 0d 20 20 54  |his course...  T|
000015b0  68 65 20 63 6f 70 79 72  69 67 68 74 20 73 74 72  |he copyright str|
000015c0  69 6e 67 20 69 73 20 65  73 73 65 6e 74 69 61 6c  |ing is essential|
000015d0  20 62 65 63 61 75 73 65  20 74 68 65 20 4d 4f 53  | because the MOS|
000015e0  20 75 73 65 73 20 74 68  69 73 20 73 74 72 69 6e  | uses this strin|
000015f0  67 0d 74 6f 20 72 65 63  6f 67 6e 69 73 65 20 74  |g.to recognise t|
00001600  68 65 20 72 6f 6d 20 61  6e 64 2c 20 69 66 20 69  |he rom and, if i|
00001610  74 20 64 6f 65 73 20 6e  6f 74 20 65 78 69 73 74  |t does not exist|
00001620  2c 20 74 68 65 20 72 6f  6d 20 77 69 6c 6c 20 62  |, the rom will b|
00001630  65 0d 69 67 6e 6f 72 65  64 20 62 79 20 74 68 65  |e.ignored by the|
00001640  20 4d 4f 53 2e 20 54 68  65 20 66 6f 72 6d 61 74  | MOS. The format|
00001650  20 6d 75 73 74 20 61 6c  77 61 79 73 20 62 65 20  | must always be |
00001660  61 20 7a 65 72 6f 20 62  79 74 65 20 66 6f 6c 6c  |a zero byte foll|
00001670  6f 77 65 64 20 62 79 0d  22 28 43 29 22 20 61 6e  |owed by."(C)" an|
00001680  64 20 77 68 61 74 65 76  65 72 20 65 6c 73 65 20  |d whatever else |
00001690  79 6f 75 20 77 61 6e 74  20 74 6f 20 69 6e 63 6c  |you want to incl|
000016a0  75 64 65 20 61 6e 64 20  74 68 65 6e 20 61 6e 6f  |ude and then ano|
000016b0  74 68 65 72 20 7a 65 72  6f 0d 62 79 74 65 2e 20  |ther zero.byte. |
000016c0  54 68 65 20 6d 69 6e 69  6d 75 6d 20 63 6f 70 79  |The minimum copy|
000016d0  72 69 67 68 74 20 73 74  72 69 6e 67 20 69 73 20  |right string is |
000016e0  61 20 7a 65 72 6f 20 62  79 74 65 20 66 6f 6c 6c  |a zero byte foll|
000016f0  6f 77 65 64 20 62 79 20  22 28 43 29 22 0d 61 6e  |owed by "(C)".an|
00001700  64 20 61 6e 6f 74 68 65  72 20 7a 65 72 6f 20 62  |d another zero b|
00001710  79 74 65 2e 0d 0d 20 20  54 68 65 20 74 75 62 65  |yte...  The tube|
00001720  20 72 65 6c 6f 63 61 74  69 6f 6e 20 61 64 64 72  | relocation addr|
00001730  65 73 73 2c 20 69 66 20  70 72 65 73 65 6e 74 2c  |ess, if present,|
00001740  20 69 73 20 61 20 34 20  62 79 74 65 20 61 64 64  | is a 4 byte add|
00001750  72 65 73 73 20 61 74 0d  77 68 69 63 68 20 74 68  |ress at.which th|
00001760  65 20 6c 61 6e 67 75 61  67 65 20 70 61 72 74 20  |e language part |
00001770  6f 66 20 74 68 65 20 72  6f 6d 20 68 61 73 20 62  |of the rom has b|
00001780  65 65 6e 20 61 73 73 65  6d 62 6c 65 64 2e 20 54  |een assembled. T|
00001790  75 62 65 20 72 65 6c 6f  63 61 74 69 6f 6e 0d 77  |ube relocation.w|
000017a0  69 6c 6c 20 6e 6f 74 20  62 65 20 63 6f 76 65 72  |ill not be cover|
000017b0  65 64 20 69 6e 20 74 68  69 73 20 63 6f 75 72 73  |ed in this cours|
000017c0  65 2e 0d 0d 20 20 57 72  69 74 69 6e 67 20 74 68  |e...  Writing th|
000017d0  65 20 73 6f 75 72 63 65  20 63 6f 64 65 20 66 6f  |e source code fo|
000017e0  72 20 74 68 65 20 68 65  61 64 65 72 20 69 73 20  |r the header is |
000017f0  6d 75 63 68 20 65 61 73  69 65 72 20 74 68 61 74  |much easier that|
00001800  20 77 72 69 74 69 6e 67  0d 61 62 6f 75 74 20 69  | writing.about i|
00001810  74 2e 20 54 68 65 20 6f  70 74 69 6f 6e 61 6c 20  |t. The optional |
00001820  76 65 72 73 69 6f 6e 20  73 74 72 69 6e 67 20 68  |version string h|
00001830  61 73 20 62 65 65 6e 20  6c 65 66 74 20 6f 75 74  |as been left out|
00001840  20 6f 66 20 61 6c 6c 20  74 68 65 0d 65 78 61 6d  | of all the.exam|
00001850  70 6c 65 20 70 72 6f 67  72 61 6d 73 2e 20 54 68  |ple programs. Th|
00001860  65 20 73 6f 75 72 63 65  20 63 6f 64 65 20 66 6f  |e source code fo|
00001870  72 20 74 68 65 20 68 65  61 64 65 72 20 6f 66 20  |r the header of |
00001880  74 68 65 20 70 72 6f 67  72 61 6d 20 54 52 41 43  |the program TRAC|
00001890  45 0d 61 73 73 65 6d 62  6c 65 73 20 61 73 20 73  |E.assembles as s|
000018a0  68 6f 77 6e 20 69 6e 20  66 69 67 75 72 65 20 32  |hown in figure 2|
000018b0  2e 32 2e 20 59 6f 75 20  63 61 6e 20 73 65 65 20  |.2. You can see |
000018c0  74 68 61 74 20 69 74 20  69 73 20 26 32 39 20 62  |that it is &29 b|
000018d0  79 74 65 73 0d 6c 6f 6e  67 20 62 75 74 20 69 74  |ytes.long but it|
000018e0  20 63 6f 75 6c 64 20 62  65 20 73 68 6f 72 74 65  | could be shorte|
000018f0  72 20 69 66 20 69 74 20  75 73 65 64 20 74 68 65  |r if it used the|
00001900  20 6d 69 6e 69 6d 75 6d  20 63 6f 70 79 72 69 67  | minimum copyrig|
00001910  68 74 20 73 74 72 69 6e  67 0d 6f 66 20 22 28 43  |ht string.of "(C|
00001920  29 22 2e 20 46 69 67 75  72 65 20 32 2e 32 20 69  |)". Figure 2.2 i|
00001930  73 20 61 20 42 41 53 49  43 20 32 20 76 65 72 73  |s a BASIC 2 vers|
00001940  69 6f 6e 20 6f 66 20 54  52 41 43 45 20 61 73 73  |ion of TRACE ass|
00001950  65 6d 62 6c 65 64 20 77  69 74 68 20 62 69 74 0d  |embled with bit.|
00001960  7a 65 72 6f 20 6f 66 20  74 68 65 20 4f 50 54 20  |zero of the OPT |
00001970  64 69 72 65 63 74 69 76  65 20 73 65 74 2e 0d 0d  |directive set...|
00001980  0d 0d 0d 38 30 30 30 20  30 30 20 20 20 20 20 20  |...8000 00      |
00001990  20 45 51 55 42 20 26 30  30 20 20 20 20 20 20 20  | EQUB &00       |
000019a0  20 20 20 20 20 20 20 20  5c 20 4e 6f 20 6c 61 6e  |        \ No lan|
000019b0  67 75 61 67 65 0d 38 30  30 31 20 30 30 20 20 20  |guage.8001 00   |
000019c0  20 20 20 20 45 51 55 42  20 26 30 30 20 20 20 20  |    EQUB &00    |
000019d0  20 20 20 20 20 20 20 20  20 20 20 5c 20 65 6e 74  |           \ ent|
000019e0  72 79 20 70 6f 69 6e 74  0d 38 30 30 32 20 30 30  |ry point.8002 00|
000019f0  20 20 20 20 20 20 20 45  51 55 42 20 26 30 30 0d  |       EQUB &00.|
00001a00  38 30 30 33 20 34 43 20  32 41 20 38 30 20 4a 4d  |8003 4C 2A 80 JM|
00001a10  50 20 73 65 72 76 69 63  65 20 20 20 20 20 20 20  |P service       |
00001a20  20 20 20 20 20 5c 20 53  65 72 76 69 63 65 20 65  |     \ Service e|
00001a30  6e 74 72 79 20 70 6f 69  6e 74 0d 38 30 30 36 20  |ntry point.8006 |
00001a40  38 32 20 20 20 20 20 20  20 45 51 55 42 20 26 38  |82       EQUB &8|
00001a50  32 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2               |
00001a60  5c 20 52 6f 6d 20 74 79  70 65 20 62 79 74 65 0d  |\ Rom type byte.|
00001a70  38 30 30 37 20 30 45 20  20 20 20 20 20 20 45 51  |8007 0E       EQ|
00001a80  55 42 20 63 6f 70 79 72  69 67 68 74 20 4d 4f 44  |UB copyright MOD|
00001a90  20 32 35 36 20 5c 20 63  6f 70 79 72 69 67 68 74  | 256 \ copyright|
00001aa0  20 6f 66 66 73 65 74 0d  38 30 30 38 20 30 30 20  | offset.8008 00 |
00001ab0  20 20 20 20 20 20 45 51  55 42 20 26 30 30 20 20  |      EQUB &00  |
00001ac0  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 42  |             \ B|
00001ad0  69 6e 61 72 79 20 76 65  72 73 69 6f 6e 0d 38 30  |inary version.80|
00001ae0  30 39 20 35 34 20 35 32  20 34 31 20 0d 20 20 20  |09 54 52 41 .   |
00001af0  20 20 34 33 20 34 35 20  20 20 20 45 51 55 53 20  |  43 45    EQUS |
00001b00  22 54 52 41 43 45 22 20  20 20 20 20 20 20 20 20  |"TRACE"         |
00001b10  20 20 5c 20 54 69 74 6c  65 20 73 74 72 69 6e 67  |  \ Title string|
00001b20  0d 38 30 30 45 20 20 20  20 20 20 20 20 20 20 2e  |.800E          .|
00001b30  63 6f 70 79 72 69 67 68  74 0d 38 30 30 45 20 30  |copyright.800E 0|
00001b40  30 20 20 20 20 20 20 20  45 51 55 42 20 26 30 30  |0       EQUB &00|
00001b50  0d 38 30 30 46 20 32 38  20 34 33 20 32 39 20 0d  |.800F 28 43 29 .|
00001b60  20 20 20 20 20 32 30 20  34 37 20 36 46 20 0d 20  |     20 47 6F . |
00001b70  20 20 20 20 37 32 20 36  34 20 36 46 20 0d 20 20  |    72 64 6F .  |
00001b80  20 20 20 36 45 20 32 30  20 34 38 20 0d 20 20 20  |   6E 20 48 .   |
00001b90  20 20 36 46 20 37 32 20  37 33 20 0d 20 20 20 20  |  6F 72 73 .    |
00001ba0  20 36 39 20 36 45 20 36  37 20 0d 20 20 20 20 20  | 69 6E 67 .     |
00001bb0  37 34 20 36 46 20 36 45  20 0d 20 20 20 20 20 32  |74 6F 6E .     2|
00001bc0  30 20 33 31 20 33 39 20  0d 20 20 20 20 20 33 38  |0 31 39 .     38|
00001bd0  20 33 37 20 20 20 20 45  51 55 53 20 22 28 43 29  | 37    EQUS "(C)|
00001be0  20 47 6f 72 64 6f 6e 20  48 6f 72 73 69 6e 67 74  | Gordon Horsingt|
00001bf0  6f 6e 20 31 39 38 37 22  0d 38 30 32 39 20 30 30  |on 1987".8029 00|
00001c00  20 20 20 20 20 20 20 45  51 55 42 20 26 30 30 0d  |       EQUB &00.|
00001c10  38 30 32 41 20 20 20 20  20 20 20 20 20 20 2e 73  |802A          .s|
00001c20  65 72 76 69 63 65 20 20  20 20 20 20 20 20 20 20  |ervice          |
00001c30  20 20 20 20 20 5c 20 53  74 61 72 74 20 6f 66 20  |     \ Start of |
00001c40  69 6e 74 65 72 70 72 65  74 65 72 0d 0d 46 69 67  |interpreter..Fig|
00001c50  75 72 65 20 32 2e 32 20  54 68 65 20 72 6f 6d 20  |ure 2.2 The rom |
00001c60  68 65 61 64 65 72 20 6f  66 20 54 52 41 43 45 0d  |header of TRACE.|
00001c70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001c90  2d 2d 0d 0d 0d 0d 0d 20  20 57 68 65 6e 20 74 68  |--.....  When th|
00001ca0  65 20 4d 4f 53 20 72 65  71 75 65 73 74 73 20 74  |e MOS requests t|
00001cb0  68 65 20 70 61 67 65 64  20 72 6f 6d 73 20 74 6f  |he paged roms to|
00001cc0  20 70 72 6f 76 69 64 65  20 61 20 73 65 72 76 69  | provide a servi|
00001cd0  63 65 20 74 68 65 0d 68  69 67 68 65 73 74 20 70  |ce the.highest p|
00001ce0  72 69 6f 72 69 74 79 20  72 6f 6d 2c 20 72 6f 6d  |riority rom, rom|
00001cf0  20 26 30 46 2c 20 69 73  20 6f 66 66 65 72 65 64  | &0F, is offered|
00001d00  20 74 68 65 20 66 69 72  73 74 20 6f 70 70 6f 72  | the first oppor|
00001d10  74 75 6e 69 74 79 20 74  6f 0d 72 65 73 70 6f 6e  |tunity to.respon|
00001d20  64 20 74 6f 20 74 68 65  20 72 65 71 75 65 73 74  |d to the request|
00001d30  2e 20 49 74 20 69 73 20  65 6e 74 65 72 65 64 20  |. It is entered |
00001d40  61 74 20 74 68 65 20 73  65 72 76 69 63 65 20 65  |at the service e|
00001d50  6e 74 72 79 20 70 6f 69  6e 74 20 77 69 74 68 0d  |ntry point with.|
00001d60  74 68 65 20 72 65 67 69  73 74 65 72 73 20 73 65  |the registers se|
00001d70  74 20 75 70 20 61 73 20  73 68 6f 77 6e 20 69 6e  |t up as shown in|
00001d80  20 66 69 67 75 72 65 20  32 2e 33 2e 0d 0d 0d 0d  | figure 2.3.....|
00001d90  0d 52 65 67 69 73 74 65  72 20 20 20 20 20 20 20  |.Register       |
00001da0  20 20 20 20 20 53 65 72  76 69 63 65 20 63 61 6c  |     Service cal|
00001db0  6c 20 69 6e 66 6f 72 6d  61 74 69 6f 6e 0d 2d 2d  |l information.--|
00001dc0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001df0  2d 2d 2d 2d 2d 2d 2d 2d  0d 41 63 63 75 6d 75 6c  |--------.Accumul|
00001e00  61 74 6f 72 20 20 20 20  20 20 20 20 20 53 65 72  |ator         Ser|
00001e10  76 69 63 65 20 74 79 70  65 20 72 65 71 75 65 73  |vice type reques|
00001e20  74 65 64 0d 58 20 72 65  67 69 73 74 65 72 20 20  |ted.X register  |
00001e30  20 20 20 20 20 20 20 20  4e 75 6d 62 65 72 20 6f  |        Number o|
00001e40  66 20 63 75 72 72 65 6e  74 20 72 6f 6d 0d 59 20  |f current rom.Y |
00001e50  72 65 67 69 73 74 65 72  20 20 20 20 20 20 20 20  |register        |
00001e60  20 20 41 6e 79 20 70 61  72 61 6d 65 74 65 72 20  |  Any parameter |
00001e70  72 65 71 75 69 72 65 64  20 66 6f 72 20 74 68 65  |required for the|
00001e80  20 73 65 72 76 69 63 65  0d 0d 0d 46 69 67 75 72  | service...Figur|
00001e90  65 20 32 2e 33 20 53 65  72 76 69 63 65 20 63 61  |e 2.3 Service ca|
00001ea0  6c 6c 20 72 65 67 69 73  74 65 72 73 2e 0d 2d 2d  |ll registers..--|
00001eb0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001ed0  0d 0d 0d 0d 20 20 49 66  20 72 6f 6d 20 26 30 46  |....  If rom &0F|
00001ee0  20 69 73 20 75 6e 61 62  6c 65 20 74 6f 20 70 72  | is unable to pr|
00001ef0  6f 76 69 64 65 20 74 68  65 20 73 65 72 76 69 63  |ovide the servic|
00001f00  65 20 72 65 71 75 65 73  74 65 64 20 69 74 20 6d  |e requested it m|
00001f10  75 73 74 20 65 78 69 74  0d 75 73 69 6e 67 20 52  |ust exit.using R|
00001f20  54 53 20 77 69 74 68 20  61 6c 6c 20 74 68 72 65  |TS with all thre|
00001f30  65 20 72 65 67 69 73 74  65 72 73 20 70 72 65 73  |e registers pres|
00001f40  65 72 76 65 64 20 61 6e  64 20 74 68 65 20 6e 65  |erved and the ne|
00001f50  78 74 20 72 6f 6d 2c 20  72 6f 6d 0d 26 30 45 2c  |xt rom, rom.&0E,|
00001f60  20 77 69 6c 6c 20 62 65  20 67 69 76 65 6e 20 74  | will be given t|
00001f70  68 65 20 73 61 6d 65 20  6f 70 70 6f 72 74 75 6e  |he same opportun|
00001f80  69 74 79 20 74 6f 20 70  72 6f 76 69 64 65 20 74  |ity to provide t|
00001f90  68 65 20 73 65 72 76 69  63 65 2c 20 61 6e 64 20  |he service, and |
00001fa0  73 6f 0d 6f 6e 20 64 6f  77 6e 20 74 6f 20 72 6f  |so.on down to ro|
00001fb0  6d 20 26 30 30 2e 20 49  66 20 61 20 72 6f 6d 20  |m &00. If a rom |
00001fc0  69 73 20 61 62 6c 65 20  74 6f 20 70 72 6f 76 69  |is able to provi|
00001fd0  64 65 20 74 68 65 20 73  65 72 76 69 63 65 20 72  |de the service r|
00001fe0  65 71 75 65 73 74 65 64  2c 0d 61 6e 64 20 64 6f  |equested,.and do|
00001ff0  65 73 20 6e 6f 74 20 77  61 6e 74 20 61 6e 79 20  |es not want any |
00002000  6f 74 68 65 72 20 72 6f  6d 20 74 6f 20 61 74 74  |other rom to att|
00002010  65 6d 70 74 20 74 6f 20  70 72 6f 76 69 64 65 20  |empt to provide |
00002020  74 68 65 20 73 61 6d 65  0d 73 65 72 76 69 63 65  |the same.service|
00002030  2c 20 74 68 65 20 61 63  63 75 6d 75 6c 61 74 6f  |, the accumulato|
00002040  72 20 73 68 6f 75 6c 64  20 62 65 20 7a 65 72 6f  |r should be zero|
00002050  20 6f 6e 20 65 78 69 74  2e 0d 0d 20 20 54 68 65  | on exit...  The|
00002060  20 70 72 6f 67 72 61 6d  20 54 52 41 43 45 20 69  | program TRACE i|
00002070  73 20 75 73 65 64 20 74  6f 20 70 72 6f 76 69 64  |s used to provid|
00002080  65 20 61 20 64 69 73 70  6c 61 79 20 6f 66 20 74  |e a display of t|
00002090  68 65 20 73 65 72 76 69  63 65 0d 72 65 71 75 65  |he service.reque|
000020a0  73 74 73 20 6d 61 64 65  20 74 6f 20 74 68 65 20  |sts made to the |
000020b0  73 69 64 65 77 61 79 73  20 72 61 6d 20 62 61 6e  |sideways ram ban|
000020c0  6b 20 63 6f 6e 74 61 69  6e 69 6e 67 20 74 68 65  |k containing the|
000020d0  20 6f 62 6a 65 63 74 20  63 6f 64 65 20 69 74 0d  | object code it.|
000020e0  67 65 6e 65 72 61 74 65  73 2e 20 43 68 61 69 6e  |generates. Chain|
000020f0  20 74 68 65 20 70 72 6f  67 72 61 6d 20 61 6e 64  | the program and|
00002100  2c 20 77 68 65 6e 20 70  72 6f 6d 70 74 65 64 2c  |, when prompted,|
00002110  20 67 69 76 65 20 61 20  66 69 6c 65 6e 61 6d 65  | give a filename|
00002120  20 66 6f 72 0d 74 68 65  20 6f 62 6a 65 63 74 20  | for.the object |
00002130  63 6f 64 65 20 77 68 69  63 68 20 77 69 6c 6c 20  |code which will |
00002140  62 65 20 73 61 76 65 64  20 6f 6e 20 64 69 73 63  |be saved on disc|
00002150  20 6f 72 20 74 61 70 65  20 62 65 66 6f 72 65 20  | or tape before |
00002160  79 6f 75 20 6c 6f 61 64  20 69 74 0d 69 6e 74 6f  |you load it.into|
00002170  20 53 57 52 2e 20 49 74  20 69 73 20 6e 6f 74 20  | SWR. It is not |
00002180  6e 65 63 65 73 73 61 72  79 20 74 6f 20 69 6e 63  |necessary to inc|
00002190  6c 75 64 65 20 61 20 71  75 6f 74 61 74 69 6f 6e  |lude a quotation|
000021a0  20 6d 61 72 6b 20 62 65  66 6f 72 65 20 61 6e 64  | mark before and|
000021b0  0d 61 66 74 65 72 20 74  68 65 20 66 69 6c 65 6e  |.after the filen|
000021c0  61 6d 65 2e 20 20 41 66  74 65 72 20 73 61 76 69  |ame.  After savi|
000021d0  6e 67 20 74 68 65 20 6f  62 6a 65 63 74 20 63 6f  |ng the object co|
000021e0  64 65 2c 20 6c 6f 61 64  20 69 74 20 69 6e 74 6f  |de, load it into|
000021f0  20 53 57 52 0d 61 6e 64  20 70 72 65 73 73 20 74  | SWR.and press t|
00002200  68 65 20 42 72 65 61 6b  20 6b 65 79 2e 20 59 6f  |he Break key. Yo|
00002210  75 20 77 69 6c 6c 20 69  6d 6d 65 64 69 61 74 65  |u will immediate|
00002220  6c 79 20 73 65 65 20 61  20 64 69 73 70 6c 61 79  |ly see a display|
00002230  20 6f 66 20 74 68 65 0d  73 65 72 76 69 63 65 20  | of the.service |
00002240  72 65 71 75 65 73 74 73  20 73 65 6e 74 20 74 6f  |requests sent to|
00002250  20 74 68 65 20 72 6f 6d  73 20 77 68 65 6e 20 62  | the roms when b|
00002260  72 65 61 6b 20 69 73 20  70 72 65 73 73 65 64 2e  |reak is pressed.|
00002270  20 54 79 70 65 20 2a 48  45 4c 50 0d 61 6e 64 20  | Type *HELP.and |
00002280  79 6f 75 20 77 69 6c 6c  20 73 65 65 20 74 68 65  |you will see the|
00002290  20 68 65 6c 70 20 73 65  72 76 69 63 65 20 72 65  | help service re|
000022a0  71 75 65 73 74 2e 20 54  79 70 65 20 2a 44 49 53  |quest. Type *DIS|
000022b0  43 20 6f 72 20 2a 52 4f  4d 20 6f 72 0d 77 68 61  |C or *ROM or.wha|
000022c0  74 65 76 65 72 20 65 6c  73 65 20 79 6f 75 20 74  |tever else you t|
000022d0  68 69 6e 6b 20 77 69 6c  6c 20 6d 61 6b 65 20 73  |hink will make s|
000022e0  65 72 76 69 63 65 20 72  65 71 75 65 73 74 73 20  |ervice requests |
000022f0  74 6f 20 74 68 65 20 70  61 67 65 64 20 72 6f 6d  |to the paged rom|
00002300  73 0d 61 6e 64 20 79 6f  75 20 77 69 6c 6c 20 73  |s.and you will s|
00002310  6f 6f 6e 20 67 65 74 20  74 6f 20 6b 6e 6f 77 20  |oon get to know |
00002320  74 68 65 20 73 65 72 76  69 63 65 20 72 65 71 75  |the service requ|
00002330  65 73 74 20 63 6f 64 65  73 2e 20 44 6f 20 6e 6f  |est codes. Do no|
00002340  74 20 75 73 65 0d 54 52  41 43 45 20 77 68 65 6e  |t use.TRACE when|
00002350  20 2a 53 50 4f 4f 4c 69  6e 67 20 6f 72 20 2a 45  | *SPOOLing or *E|
00002360  58 45 43 69 6e 67 20 66  69 6c 65 73 2e 20 49 66  |XECing files. If|
00002370  20 79 6f 75 20 64 6f 20  69 74 20 77 69 6c 6c 20  | you do it will |
00002380  63 61 75 73 65 20 74 68  65 0d 63 6f 6d 70 75 74  |cause the.comput|
00002390  65 72 20 74 6f 20 68 61  6e 67 20 75 70 2e 20 54  |er to hang up. T|
000023a0  68 65 20 73 65 72 76 69  63 65 20 72 65 71 75 65  |he service reque|
000023b0  73 74 20 63 6f 64 65 73  20 61 72 65 20 73 75 6d  |st codes are sum|
000023c0  6d 65 72 69 73 65 64 20  69 6e 0d 66 69 67 75 72  |merised in.figur|
000023d0  65 20 32 2e 34 2e 0d 0d  0d 0d 0d 0d 30 30 20 20  |e 2.4.......00  |
000023e0  4e 6f 20 6f 70 65 72 61  74 69 6f 6e 2e 20 41 20  |No operation. A |
000023f0  68 69 67 68 65 72 20 70  72 69 6f 72 69 74 79 20  |higher priority |
00002400  72 6f 6d 20 68 61 73 20  61 6c 72 65 61 64 79 20  |rom has already |
00002410  70 72 6f 76 69 64 65 64  20 74 68 65 0d 73 65 72  |provided the.ser|
00002420  76 69 63 65 20 72 65 71  75 65 73 74 65 64 2e 0d  |vice requested..|
00002430  0d 30 31 20 20 41 62 73  6f 6c 75 74 65 20 77 6f  |.01  Absolute wo|
00002440  72 6b 73 70 61 63 65 20  63 6c 61 69 6d 2e 20 54  |rkspace claim. T|
00002450  68 69 73 20 77 69 6c 6c  20 62 65 20 64 65 61 6c  |his will be deal|
00002460  74 20 77 69 74 68 20 69  6e 20 6d 6f 64 75 6c 65  |t with in module|
00002470  20 31 32 2e 0d 0d 30 32  20 20 50 72 69 76 61 74  | 12...02  Privat|
00002480  65 20 77 6f 72 6b 73 70  61 63 65 20 63 6c 61 69  |e workspace clai|
00002490  6d 2e 20 4d 6f 64 75 6c  65 73 20 31 31 20 61 6e  |m. Modules 11 an|
000024a0  64 20 31 33 2e 0d 0d 30  33 20 20 41 75 74 6f 2d  |d 13...03  Auto-|
000024b0  62 6f 6f 74 2e 20 4d 6f  64 75 6c 65 73 20 31 39  |boot. Modules 19|
000024c0  2c 20 32 33 2c 20 32 34  2e 0d 0d 30 34 20 20 55  |, 23, 24...04  U|
000024d0  6e 72 65 63 6f 67 6e 69  73 65 64 20 63 6f 6d 6d  |nrecognised comm|
000024e0  61 6e 64 2e 20 4d 6f 64  75 6c 65 73 20 33 2c 20  |and. Modules 3, |
000024f0  35 2c 20 38 2c 20 39 2c  20 31 30 2c 20 31 31 2c  |5, 8, 9, 10, 11,|
00002500  20 31 33 2c 20 31 35 2c  20 31 36 2c 20 31 37 2c  | 13, 15, 16, 17,|
00002510  0d 32 30 2c 20 32 31 2c  20 32 32 2c 20 32 33 2c  |.20, 21, 22, 23,|
00002520  20 32 34 2e 0d 0d 30 35  20 20 55 6e 72 65 63 6f  | 24...05  Unreco|
00002530  67 6e 69 73 65 64 20 69  6e 74 65 72 75 70 74 2e  |gnised interupt.|
00002540  20 4d 6f 64 75 6c 65 20  31 34 2e 0d 0d 30 36 20  | Module 14...06 |
00002550  20 42 72 65 61 6b 2e 20  4d 6f 64 75 6c 65 20 31  | Break. Module 1|
00002560  33 2e 0d 0d 30 37 20 20  55 6e 72 65 63 6f 67 6e  |3...07  Unrecogn|
00002570  69 73 65 64 20 4f 73 62  79 74 65 2e 20 4d 6f 64  |ised Osbyte. Mod|
00002580  75 6c 65 20 36 2e 0d 0d  30 38 20 20 55 6e 72 65  |ule 6...08  Unre|
00002590  63 6f 67 6e 69 73 65 64  20 4f 73 77 6f 72 64 2e  |cognised Osword.|
000025a0  20 4d 6f 64 75 6c 65 20  37 2e 0d 0d 30 39 20 20  | Module 7...09  |
000025b0  2a 48 45 4c 50 2e 20 4d  6f 64 75 6c 65 73 20 31  |*HELP. Modules 1|
000025c0  36 2c 20 31 37 2c 20 32  33 2c 20 32 34 2e 0d 0d  |6, 17, 23, 24...|
000025d0  30 41 20 20 43 6c 61 69  6d 20 73 74 61 74 69 63  |0A  Claim static|
000025e0  20 77 6f 72 6b 73 70 61  63 65 2e 20 4d 6f 64 75  | workspace. Modu|
000025f0  6c 65 20 31 32 2e 0d 0d  30 42 20 20 4e 4d 49 20  |le 12...0B  NMI |
00002600  72 65 6c 65 61 73 65 2e  20 4e 6f 74 20 63 6f 76  |release. Not cov|
00002610  65 72 65 64 20 69 6e 20  74 68 69 73 20 63 6f 75  |ered in this cou|
00002620  72 73 65 2e 0d 0d 30 43  20 20 4e 4d 49 20 63 6c  |rse...0C  NMI cl|
00002630  61 69 6d 2e 20 4e 6f 74  20 63 6f 76 65 72 65 64  |aim. Not covered|
00002640  20 69 6e 20 74 68 69 73  20 63 6f 75 72 73 65 2e  | in this course.|
00002650  0d 0d 30 44 20 20 52 6f  6d 20 46 69 6c 69 6e 67  |..0D  Rom Filing|
00002660  20 53 79 73 74 65 6d 20  69 6e 69 74 69 61 6c 69  | System initiali|
00002670  73 65 2e 20 4d 6f 64 75  6c 65 73 20 31 38 2c 20  |se. Modules 18, |
00002680  31 39 2c 20 32 30 2c 20  32 31 2c 20 32 32 2c 20  |19, 20, 21, 22, |
00002690  32 33 2c 20 32 34 2e 0d  0d 30 45 20 20 52 6f 6d  |23, 24...0E  Rom|
000026a0  20 46 69 6c 69 6e 67 20  53 79 73 74 65 6d 20 62  | Filing System b|
000026b0  79 74 65 20 67 65 74 2e  20 4d 6f 64 75 6c 65 73  |yte get. Modules|
000026c0  20 31 38 2c 20 31 39 2c  20 32 30 2c 20 32 31 2c  | 18, 19, 20, 21,|
000026d0  20 32 32 2c 20 32 33 2c  20 32 34 2e 0d 0d 30 46  | 22, 23, 24...0F|
000026e0  20 20 56 65 63 74 6f 72  73 20 63 6c 61 69 6d 65  |  Vectors claime|
000026f0  64 2e 20 4e 6f 74 20 63  6f 76 65 72 65 64 20 69  |d. Not covered i|
00002700  6e 20 74 68 69 73 20 63  6f 75 72 73 65 2e 0d 0d  |n this course...|
00002710  31 30 20 20 53 50 4f 4f  4c 2f 45 58 45 43 20 66  |10  SPOOL/EXEC f|
00002720  69 6c 65 20 63 6c 6f 73  75 72 65 20 77 61 72 6e  |ile closure warn|
00002730  69 6e 67 2e 20 4e 6f 74  20 63 6f 76 65 72 65 64  |ing. Not covered|
00002740  20 69 6e 20 74 68 69 73  20 63 6f 75 72 73 65 2e  | in this course.|
00002750  0d 0d 31 31 20 20 46 6f  6e 74 20 69 6d 70 6c 6f  |..11  Font implo|
00002760  73 69 6f 6e 2f 65 78 70  6c 6f 73 69 6f 6e 20 77  |sion/explosion w|
00002770  61 72 6e 69 6e 67 2e 20  4e 6f 74 20 63 6f 76 65  |arning. Not cove|
00002780  72 65 64 20 69 6e 20 74  68 69 73 20 63 6f 75 72  |red in this cour|
00002790  73 65 2e 0d 0d 31 32 20  20 49 6e 69 74 69 61 6c  |se...12  Initial|
000027a0  69 73 65 20 66 69 6c 69  6e 67 20 73 79 73 74 65  |ise filing syste|
000027b0  6d 2e 20 4e 6f 74 20 63  6f 76 65 72 65 64 20 69  |m. Not covered i|
000027c0  6e 20 74 68 69 73 20 63  6f 75 72 73 65 2e 0d 0d  |n this course...|
000027d0  46 45 20 20 54 75 62 65  20 73 79 73 74 65 6d 20  |FE  Tube system |
000027e0  70 6f 73 74 20 69 6e 69  74 69 61 6c 69 73 61 74  |post initialisat|
000027f0  69 6f 6e 2e 20 4d 6f 64  75 6c 65 73 20 31 32 2c  |ion. Modules 12,|
00002800  20 32 32 20 28 69 6c 6c  65 67 61 6c 20 75 73 65  | 22 (illegal use|
00002810  29 2e 0d 0d 46 46 20 20  54 75 62 65 20 73 79 73  |)...FF  Tube sys|
00002820  74 65 6d 20 6d 61 69 6e  20 69 6e 69 74 69 61 6c  |tem main initial|
00002830  69 73 61 74 69 6f 6e 2e  20 4e 6f 74 20 63 6f 76  |isation. Not cov|
00002840  65 72 65 64 20 69 6e 20  74 68 69 73 20 63 6f 75  |ered in this cou|
00002850  72 73 65 2e 0d 0d 0d 46  69 67 75 72 65 20 32 2e  |rse....Figure 2.|
00002860  34 20 42 42 43 20 42 20  53 65 72 76 69 63 65 20  |4 BBC B Service |
00002870  72 65 71 75 65 73 74 73  2e 0d 2d 2d 2d 2d 2d 2d  |requests..------|
00002880  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00002890  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d 0d 0d 0d  |------------....|
000028a0  0d 20 20 54 68 65 20 70  72 6f 67 72 61 6d 20 54  |.  The program T|
000028b0  52 41 43 45 20 77 6f 72  6b 73 20 62 79 20 69 6e  |RACE works by in|
000028c0  74 65 72 63 65 70 74 69  6e 67 20 65 76 65 72 79  |tercepting every|
000028d0  20 73 65 72 76 69 63 65  20 72 65 71 75 65 73 74  | service request|
000028e0  20 73 65 6e 74 0d 74 6f  20 74 68 65 20 53 57 52  | sent.to the SWR|
000028f0  2e 20 42 65 66 6f 72 65  20 64 6f 69 6e 67 20 61  |. Before doing a|
00002900  6e 79 74 68 69 6e 67 20  65 6c 73 65 20 69 74 20  |nything else it |
00002910  70 72 65 73 65 72 76 65  73 20 74 68 65 20 41 2c  |preserves the A,|
00002920  20 58 20 61 6e 64 20 59  0d 72 65 67 69 73 74 65  | X and Y.registe|
00002930  72 73 20 61 6e 64 20 74  68 65 20 74 77 6f 20 7a  |rs and the two z|
00002940  65 72 6f 20 70 61 67 65  20 6d 65 6d 6f 72 79 20  |ero page memory |
00002950  6c 6f 63 61 74 69 6f 6e  73 20 75 73 65 64 20 62  |locations used b|
00002960  79 20 74 68 65 20 70 72  69 6e 74 0d 72 6f 75 74  |y the print.rout|
00002970  69 6e 65 20 62 79 20 70  75 73 68 69 6e 67 20 74  |ine by pushing t|
00002980  68 65 6d 20 6f 6e 20 74  68 65 20 73 74 61 63 6b  |hem on the stack|
00002990  20 28 6c 69 6e 65 73 20  33 31 30 2c 33 37 30 29  | (lines 310,370)|
000029a0  2e 20 49 74 20 74 68 65  6e 0d 72 65 74 72 69 65  |. It then.retrie|
000029b0  76 65 73 20 74 68 65 20  73 65 72 76 69 63 65 20  |ves the service |
000029c0  72 65 71 75 65 73 74 20  66 72 6f 6d 20 74 68 65  |request from the|
000029d0  20 73 74 61 63 6b 20 61  6e 64 20 70 75 73 68 65  | stack and pushe|
000029e0  73 20 69 74 20 62 61 63  6b 20 6f 6e 74 6f 0d 74  |s it back onto.t|
000029f0  68 65 20 74 6f 70 20 6f  66 20 74 68 65 20 73 74  |he top of the st|
00002a00  61 63 6b 20 28 6c 69 6e  65 73 20 33 38 30 2d 34  |ack (lines 380-4|
00002a10  30 30 29 20 66 6f 6c 6c  6f 77 65 64 20 62 79 20  |00) followed by |
00002a20  74 68 65 20 59 2c 20 58  20 61 6e 64 20 41 0d 72  |the Y, X and A.r|
00002a30  65 67 69 73 74 65 72 73  20 61 67 61 69 6e 20 28  |egisters again (|
00002a40  6c 69 6e 65 73 20 34 32  30 2d 34 37 30 29 2e 20  |lines 420-470). |
00002a50  49 74 20 74 68 65 6e 20  73 65 6c 65 63 74 73 20  |It then selects |
00002a60  61 20 79 65 6c 6c 6f 77  20 66 6f 72 65 67 72 6f  |a yellow foregro|
00002a70  75 6e 64 0d 63 6f 6c 6f  75 72 20 69 66 20 4d 6f  |und.colour if Mo|
00002a80  64 65 20 37 20 69 73 20  75 73 65 64 20 28 6c 69  |de 7 is used (li|
00002a90  6e 65 73 20 34 38 30 2d  35 36 30 29 20 61 6e 64  |nes 480-560) and|
00002aa0  20 70 72 69 6e 74 73 20  74 68 65 20 63 6f 6e 74  | prints the cont|
00002ab0  65 6e 74 20 6f 66 20 74  68 65 0d 61 63 63 75 6d  |ent of the.accum|
00002ac0  75 6c 61 74 6f 72 2c 20  74 68 65 20 58 20 61 6e  |ulator, the X an|
00002ad0  64 20 59 20 72 65 67 69  73 74 65 72 73 20 69 6e  |d Y registers in|
00002ae0  20 68 65 78 61 64 65 63  69 6d 61 6c 20 28 6c 69  | hexadecimal (li|
00002af0  6e 65 73 20 35 37 30 2d  36 38 30 29 2e 20 41 6e  |nes 570-680). An|
00002b00  0d 65 78 70 6c 61 6e 61  74 69 6f 6e 20 6f 66 20  |.explanation of |
00002b10  74 68 65 20 73 65 72 76  69 63 65 20 72 65 71 75  |the service requ|
00002b20  65 73 74 20 74 79 70 65  20 69 73 20 74 68 65 6e  |est type is then|
00002b30  20 67 69 76 65 6e 20 66  6f 72 20 74 68 65 20 42  | given for the B|
00002b40  42 43 20 42 0d 73 65 72  76 69 63 65 20 72 65 71  |BC B.service req|
00002b50  75 65 73 74 73 20 28 6c  69 6e 65 73 20 36 39 30  |uests (lines 690|
00002b60  2d 38 37 30 29 2e 20 54  68 65 20 4d 61 73 74 65  |-870). The Maste|
00002b70  72 20 63 6f 6d 70 75 74  65 72 20 75 73 65 73 20  |r computer uses |
00002b80  73 65 72 76 69 63 65 0d  72 65 71 75 65 73 74 73  |service.requests|
00002b90  20 6e 6f 74 20 61 76 61  69 6c 61 62 6c 65 20 6f  | not available o|
00002ba0  6e 20 74 68 65 20 42 42  43 20 42 20 61 6e 64 20  |n the BBC B and |
00002bb0  74 68 65 20 63 6f 6e 74  65 6e 74 20 6f 66 20 74  |the content of t|
00002bc0  68 65 20 72 65 67 69 73  74 65 72 73 0d 66 6f 72  |he registers.for|
00002bd0  20 74 68 65 73 65 20 72  65 71 75 65 73 74 73 20  | these requests |
00002be0  69 73 20 73 68 6f 77 6e  20 62 75 74 20 6e 6f 74  |is shown but not|
00002bf0  20 64 65 73 63 72 69 62  65 64 2e 20 54 68 65 20  | described. The |
00002c00  70 72 6f 67 72 61 6d 20  65 78 69 74 73 20 77 69  |program exits wi|
00002c10  74 68 0d 61 6c 6c 20 74  68 65 20 72 65 67 69 73  |th.all the regis|
00002c20  74 65 72 73 20 61 6e 64  20 6d 65 6d 6f 72 79 20  |ters and memory |
00002c30  6c 6f 63 61 74 69 6f 6e  73 20 72 65 73 74 6f 72  |locations restor|
00002c40  65 64 20 28 6c 69 6e 65  73 20 38 38 30 2d 39 39  |ed (lines 880-99|
00002c50  30 29 2e 0d 0d 20 20 48  61 76 69 6e 67 20 74 68  |0)...  Having th|
00002c60  65 20 74 72 61 63 65 20  61 63 74 69 76 65 20 61  |e trace active a|
00002c70  6c 6c 20 74 68 65 20 74  69 6d 65 20 69 73 20 62  |ll the time is b|
00002c80  6f 74 68 20 64 69 73 74  72 61 63 74 69 6e 67 20  |oth distracting |
00002c90  61 6e 64 0d 75 6e 64 65  73 69 72 61 62 6c 65 2e  |and.undesirable.|
00002ca0  20 59 6f 75 20 63 61 6e  20 64 69 73 61 62 6c 65  | You can disable|
00002cb0  20 74 68 65 20 75 74 69  6c 69 74 79 20 62 79 20  | the utility by |
00002cc0  72 65 61 64 20 70 72 6f  74 65 63 74 69 6e 67 20  |read protecting |
00002cd0  74 68 65 0d 73 69 64 65  77 61 79 73 20 72 61 6d  |the.sideways ram|
00002ce0  20 62 61 6e 6b 20 6f 72  20 62 79 20 6c 6f 61 64  | bank or by load|
00002cf0  69 6e 67 20 73 6f 6d 65  20 6f 74 68 65 72 20 72  |ing some other r|
00002d00  6f 6d 20 69 6d 61 67 65  20 74 6f 20 72 65 70 6c  |om image to repl|
00002d10  61 63 65 20 69 74 2e 0d  41 6c 77 61 79 73 20 70  |ace it..Always p|
00002d20  72 65 73 73 20 43 74 72  6c 2b 42 72 65 61 6b 20  |ress Ctrl+Break |
00002d30  61 66 74 65 72 20 72 65  61 64 20 70 72 6f 74 65  |after read prote|
00002d40  63 74 69 6e 67 20 53 57  52 20 6f 72 20 72 65 6c  |cting SWR or rel|
00002d50  6f 61 64 69 6e 67 20 61  20 72 6f 6d 0d 69 6d 61  |oading a rom.ima|
00002d60  67 65 2e 0d 0d 20 20 41  6c 74 68 6f 75 67 68 20  |ge...  Although |
00002d70  74 68 65 20 4d 61 73 74  65 72 20 63 6f 6d 70 75  |the Master compu|
00002d80  74 65 72 20 75 73 65 73  20 73 65 72 76 69 63 65  |ter uses service|
00002d90  20 72 65 71 75 65 73 74  73 20 74 68 61 74 20 61  | requests that a|
00002da0  72 65 20 6e 6f 74 0d 61  76 61 69 6c 61 62 6c 65  |re not.available|
00002db0  20 6f 6e 20 74 68 65 20  42 20 73 65 72 69 65 73  | on the B series|
00002dc0  20 69 74 20 75 73 65 73  20 61 6c 6c 20 74 68 65  | it uses all the|
00002dd0  20 42 20 73 65 72 69 65  73 20 73 65 72 76 69 63  | B series servic|
00002de0  65 20 72 65 71 75 65 73  74 73 20 61 73 0d 77 65  |e requests as.we|
00002df0  6c 6c 2e 20 46 6f 72 20  74 68 69 73 20 72 65 61  |ll. For this rea|
00002e00  73 6f 6e 20 61 6c 6c 20  70 72 6f 70 65 72 6c 79  |son all properly|
00002e10  20 77 72 69 74 74 65 6e  20 73 6f 66 74 77 61 72  | written softwar|
00002e20  65 20 66 6f 72 20 74 68  65 20 42 42 43 20 42 20  |e for the BBC B |
00002e30  77 69 6c 6c 0d 61 6c 73  6f 20 77 6f 72 6b 20 6f  |will.also work o|
00002e40  6e 20 74 68 65 20 4d 61  73 74 65 72 20 62 75 74  |n the Master but|
00002e50  20 69 74 20 77 69 6c 6c  20 6e 6f 74 20 6d 61 6b  | it will not mak|
00002e60  65 20 75 73 65 20 6f 66  20 74 68 65 20 74 68 65  |e use of the the|
00002e70  20 65 78 74 72 61 0d 66  61 63 69 6c 69 74 69 65  | extra.facilitie|
00002e80  73 2c 20 73 75 63 68 20  61 73 20 70 61 67 65 64  |s, such as paged|
00002e90  20 77 6f 72 6b 73 70 61  63 65 2c 20 77 69 74 68  | workspace, with|
00002ea0  6f 75 74 20 72 65 73 70  6f 6e 64 69 6e 67 20 74  |out responding t|
00002eb0  6f 20 74 68 65 20 4d 61  73 74 65 72 0d 73 70 65  |o the Master.spe|
00002ec0  63 69 66 69 63 20 73 65  72 76 69 63 65 20 72 65  |cific service re|
00002ed0  71 75 65 73 74 73 2e 0d  0d 0d 0d 0d 0d 0d 0d 20  |quests......... |
00002ee0  20 20 31 30 20 52 45 4d  3a 20 54 52 41 43 45 0d  |  10 REM: TRACE.|
00002ef0  20 20 20 32 30 20 4d 4f  44 45 37 0d 20 20 20 33  |   20 MODE7.   3|
00002f00  30 20 48 49 4d 45 4d 3d  26 33 43 30 30 0d 20 20  |0 HIMEM=&3C00.  |
00002f10  20 34 30 20 44 49 4d 20  73 61 76 65 20 35 30 0d  | 40 DIM save 50.|
00002f20  20 20 20 35 30 20 64 69  66 66 3d 26 38 30 30 30  |   50 diff=&8000|
00002f30  2d 48 49 4d 45 4d 0d 20  20 20 36 30 20 61 64 64  |-HIMEM.   60 add|
00002f40  72 65 73 73 3d 26 37 30  0d 20 20 20 37 30 20 73  |ress=&70.   70 s|
00002f50  74 61 63 6b 3d 26 31 30  35 0d 20 20 20 38 30 20  |tack=&105.   80 |
00002f60  6d 6f 64 65 3d 26 33 35  35 0d 20 20 20 39 30 20  |mode=&355.   90 |
00002f70  6f 73 61 73 63 69 3d 26  46 46 45 33 0d 20 20 31  |osasci=&FFE3.  1|
00002f80  30 30 20 6f 73 6e 65 77  6c 3d 26 46 46 45 37 0d  |00 osnewl=&FFE7.|
00002f90  20 20 31 31 30 20 6f 73  63 6c 69 3d 26 46 46 46  |  110 oscli=&FFF|
00002fa0  37 0d 20 20 31 32 30 20  46 4f 52 20 70 61 73 73  |7.  120 FOR pass|
00002fb0  20 3d 20 30 20 54 4f 20  32 20 53 54 45 50 20 32  | = 0 TO 2 STEP 2|
00002fc0  0d 20 20 31 33 30 20 50  25 3d 48 49 4d 45 4d 0d  |.  130 P%=HIMEM.|
00002fd0  20 20 31 34 30 20 5b 20  20 20 20 20 20 20 4f 50  |  140 [       OP|
00002fe0  54 20 70 61 73 73 0d 20  20 31 35 30 20 20 20 20  |T pass.  150    |
00002ff0  20 20 20 20 20 42 52 4b  0d 20 20 31 36 30 20 20  |     BRK.  160  |
00003000  20 20 20 20 20 20 20 42  52 4b 0d 20 20 31 37 30  |       BRK.  170|
00003010  20 20 20 20 20 20 20 20  20 42 52 4b 0d 20 20 31  |         BRK.  1|
00003020  38 30 20 20 20 20 20 20  20 20 20 4a 4d 50 20 73  |80         JMP s|
00003030  65 72 76 69 63 65 2b 64  69 66 66 0d 20 20 31 39  |ervice+diff.  19|
00003040  30 20 20 20 20 20 20 20  20 20 4f 50 54 20 46 4e  |0         OPT FN|
00003050  65 71 75 62 28 26 38 32  29 0d 20 20 32 30 30 20  |equb(&82).  200 |
00003060  20 20 20 20 20 20 20 20  4f 50 54 20 46 4e 65 71  |        OPT FNeq|
00003070  75 62 28 28 63 6f 70 79  72 69 67 68 74 2b 64 69  |ub((copyright+di|
00003080  66 66 29 20 4d 4f 44 20  32 35 36 29 0d 20 20 32  |ff) MOD 256).  2|
00003090  31 30 20 20 20 20 20 20  20 20 20 42 52 4b 0d 20  |10         BRK. |
000030a0  20 32 32 30 20 20 20 20  20 20 20 20 20 4f 50 54  | 220         OPT|
000030b0  20 46 4e 65 71 75 73 28  22 54 52 41 43 45 22 29  | FNequs("TRACE")|
000030c0  0d 20 20 32 33 30 20 2e  63 6f 70 79 72 69 67 68  |.  230 .copyrigh|
000030d0  74 0d 20 20 32 34 30 20  20 20 20 20 20 20 20 20  |t.  240         |
000030e0  42 52 4b 0d 20 20 32 35  30 20 20 20 20 20 20 20  |BRK.  250       |
000030f0  20 20 4f 50 54 20 46 4e  65 71 75 73 28 22 28 43  |  OPT FNequs("(C|
00003100  29 20 47 6f 72 64 6f 6e  20 48 6f 72 73 69 6e 67  |) Gordon Horsing|
00003110  74 6f 6e 20 31 39 38 37  22 29 0d 20 20 32 36 30  |ton 1987").  260|
00003120  20 20 20 20 20 20 20 20  20 42 52 4b 0d 20 20 32  |         BRK.  2|
00003130  37 30 20 2e 73 65 72 76  69 63 65 0d 20 20 32 38  |70 .service.  28|
00003140  30 20 20 20 20 20 20 20  20 20 50 48 41 0d 20 20  |0         PHA.  |
00003150  32 39 30 20 20 20 20 20  20 20 20 20 54 58 41 0d  |290         TXA.|
00003160  20 20 33 30 30 20 20 20  20 20 20 20 20 20 50 48  |  300         PH|
00003170  41 0d 20 20 33 31 30 20  20 20 20 20 20 20 20 20  |A.  310         |
00003180  54 59 41 0d 20 20 33 32  30 20 20 20 20 20 20 20  |TYA.  320       |
00003190  20 20 50 48 41 0d 20 20  33 33 30 20 20 20 20 20  |  PHA.  330     |
000031a0  20 20 20 20 4c 44 41 20  61 64 64 72 65 73 73 0d  |    LDA address.|
000031b0  20 20 33 34 30 20 20 20  20 20 20 20 20 20 50 48  |  340         PH|
000031c0  41 0d 20 20 33 35 30 20  20 20 20 20 20 20 20 20  |A.  350         |
000031d0  53 54 58 20 61 64 64 72  65 73 73 0d 20 20 33 36  |STX address.  36|
000031e0  30 20 20 20 20 20 20 20  20 20 4c 44 41 20 61 64  |0         LDA ad|
000031f0  64 72 65 73 73 2b 31 0d  20 20 33 37 30 20 20 20  |dress+1.  370   |
00003200  20 20 20 20 20 20 50 48  41 0d 20 20 33 38 30 20  |      PHA.  380 |
00003210  20 20 20 20 20 20 20 20  54 53 58 0d 20 20 33 39  |        TSX.  39|
00003220  30 20 20 20 20 20 20 20  20 20 4c 44 41 20 73 74  |0         LDA st|
00003230  61 63 6b 2c 58 0d 20 20  34 30 30 20 20 20 20 20  |ack,X.  400     |
00003240  20 20 20 20 50 48 41 0d  20 20 34 31 30 20 20 20  |    PHA.  410   |
00003250  20 20 20 20 20 20 53 54  41 20 61 64 64 72 65 73  |      STA addres|
00003260  73 2b 31 0d 20 20 34 32  30 20 20 20 20 20 20 20  |s+1.  420       |
00003270  20 20 54 59 41 0d 20 20  34 33 30 20 20 20 20 20  |  TYA.  430     |
00003280  20 20 20 20 50 48 41 0d  20 20 34 34 30 20 20 20  |    PHA.  440   |
00003290  20 20 20 20 20 20 4c 44  41 20 61 64 64 72 65 73  |      LDA addres|
000032a0  73 0d 20 20 34 35 30 20  20 20 20 20 20 20 20 20  |s.  450         |
000032b0  50 48 41 0d 20 20 34 36  30 20 20 20 20 20 20 20  |PHA.  460       |
000032c0  20 20 4c 44 41 20 61 64  64 72 65 73 73 2b 31 0d  |  LDA address+1.|
000032d0  20 20 34 37 30 20 20 20  20 20 20 20 20 20 50 48  |  470         PH|
000032e0  41 0d 20 20 34 38 30 20  20 20 20 20 20 20 20 20  |A.  480         |
000032f0  4c 44 41 20 6d 6f 64 65  0d 20 20 34 39 30 20 20  |LDA mode.  490  |
00003300  20 20 20 20 20 20 20 43  4d 50 20 23 26 30 37 0d  |       CMP #&07.|
00003310  20 20 35 30 30 20 20 20  20 20 20 20 20 20 42 4e  |  500         BN|
00003320  45 20 6e 6f 74 6d 6f 64  65 37 0d 20 20 35 31 30  |E notmode7.  510|
00003330  20 20 20 20 20 20 20 20  20 4c 44 41 20 23 26 38  |         LDA #&8|
00003340  33 0d 20 20 35 32 30 20  20 20 20 20 20 20 20 20  |3.  520         |
00003350  42 4e 45 20 73 70 61 63  65 0d 20 20 35 33 30 20  |BNE space.  530 |
00003360  2e 6e 6f 74 6d 6f 64 65  37 0d 20 20 35 34 30 20  |.notmode7.  540 |
00003370  20 20 20 20 20 20 20 20  4c 44 41 20 23 41 53 43  |        LDA #ASC|
00003380  28 22 20 22 29 0d 20 20  35 35 30 20 2e 73 70 61  |(" ").  550 .spa|
00003390  63 65 0d 20 20 35 36 30  20 20 20 20 20 20 20 20  |ce.  560        |
000033a0  20 4a 53 52 20 6f 73 61  73 63 69 0d 20 20 35 37  | JSR osasci.  57|
000033b0  30 20 20 20 20 20 20 20  20 20 4c 44 41 20 23 41  |0         LDA #A|
000033c0  53 43 28 22 41 22 29 0d  20 20 35 38 30 20 20 20  |SC("A").  580   |
000033d0  20 20 20 20 20 20 4a 53  52 20 65 71 75 61 6c 73  |      JSR equals|
000033e0  2b 64 69 66 66 0d 20 20  35 39 30 20 20 20 20 20  |+diff.  590     |
000033f0  20 20 20 20 50 4c 41 0d  20 20 36 30 30 20 20 20  |    PLA.  600   |
00003400  20 20 20 20 20 20 4a 53  52 20 70 72 69 6e 74 62  |      JSR printb|
00003410  79 74 65 2b 64 69 66 66  0d 20 20 36 31 30 20 20  |yte+diff.  610  |
00003420  20 20 20 20 20 20 20 4c  44 41 20 23 41 53 43 28  |       LDA #ASC(|
00003430  22 58 22 29 0d 20 20 36  32 30 20 20 20 20 20 20  |"X").  620      |
00003440  20 20 20 4a 53 52 20 65  71 75 61 6c 73 2b 64 69  |   JSR equals+di|
00003450  66 66 0d 20 20 36 33 30  20 20 20 20 20 20 20 20  |ff.  630        |
00003460  20 50 4c 41 0d 20 20 36  34 30 20 20 20 20 20 20  | PLA.  640      |
00003470  20 20 20 4a 53 52 20 70  72 69 6e 74 62 79 74 65  |   JSR printbyte|
00003480  2b 64 69 66 66 0d 20 20  36 35 30 20 20 20 20 20  |+diff.  650     |
00003490  20 20 20 20 4c 44 41 20  23 41 53 43 28 22 59 22  |    LDA #ASC("Y"|
000034a0  29 0d 20 20 36 36 30 20  20 20 20 20 20 20 20 20  |).  660         |
000034b0  4a 53 52 20 65 71 75 61  6c 73 2b 64 69 66 66 0d  |JSR equals+diff.|
000034c0  20 20 36 37 30 20 20 20  20 20 20 20 20 20 50 4c  |  670         PL|
000034d0  41 0d 20 20 36 38 30 20  20 20 20 20 20 20 20 20  |A.  680         |
000034e0  4a 53 52 20 70 72 69 6e  74 62 79 74 65 2b 64 69  |JSR printbyte+di|
000034f0  66 66 0d 20 20 36 39 30  20 20 20 20 20 20 20 20  |ff.  690        |
00003500  20 50 4c 41 0d 20 20 37  30 30 20 20 20 20 20 20  | PLA.  700      |
00003510  20 20 20 43 4c 43 0d 20  20 37 31 30 20 20 20 20  |   CLC.  710    |
00003520  20 20 20 20 20 41 44 43  20 23 32 0d 20 20 37 32  |     ADC #2.  72|
00003530  30 20 20 20 20 20 20 20  20 20 43 4d 50 20 23 26  |0         CMP #&|
00003540  31 35 0d 20 20 37 33 30  20 20 20 20 20 20 20 20  |15.  730        |
00003550  20 42 43 53 20 65 6e 64  70 72 69 6e 74 0d 20 20  | BCS endprint.  |
00003560  37 34 30 20 20 20 20 20  20 20 20 20 41 53 4c 20  |740         ASL |
00003570  41 0d 20 20 37 35 30 20  20 20 20 20 20 20 20 20  |A.  750         |
00003580  54 41 59 0d 20 20 37 36  30 20 20 20 20 20 20 20  |TAY.  760       |
00003590  20 20 4c 44 41 20 69 6e  64 65 78 2b 64 69 66 66  |  LDA index+diff|
000035a0  2c 59 0d 20 20 37 37 30  20 20 20 20 20 20 20 20  |,Y.  770        |
000035b0  20 53 54 41 20 61 64 64  72 65 73 73 0d 20 20 37  | STA address.  7|
000035c0  38 30 20 20 20 20 20 20  20 20 20 49 4e 59 0d 20  |80         INY. |
000035d0  20 37 39 30 20 20 20 20  20 20 20 20 20 4c 44 41  | 790         LDA|
000035e0  20 69 6e 64 65 78 2b 64  69 66 66 2c 59 0d 20 20  | index+diff,Y.  |
000035f0  38 30 30 20 20 20 20 20  20 20 20 20 53 54 41 20  |800         STA |
00003600  61 64 64 72 65 73 73 2b  31 0d 20 20 38 31 30 20  |address+1.  810 |
00003610  20 20 20 20 20 20 20 20  4c 44 59 20 23 26 46 46  |        LDY #&FF|
00003620  0d 20 20 38 32 30 20 2e  70 72 69 6e 74 6c 6f 6f  |.  820 .printloo|
00003630  70 0d 20 20 38 33 30 20  20 20 20 20 20 20 20 20  |p.  830         |
00003640  49 4e 59 0d 20 20 38 34  30 20 20 20 20 20 20 20  |INY.  840       |
00003650  20 20 4c 44 41 20 28 61  64 64 72 65 73 73 29 2c  |  LDA (address),|
00003660  59 0d 20 20 38 35 30 20  20 20 20 20 20 20 20 20  |Y.  850         |
00003670  42 45 51 20 65 6e 64 70  72 69 6e 74 0d 20 20 38  |BEQ endprint.  8|
00003680  36 30 20 20 20 20 20 20  20 20 20 4a 53 52 20 6f  |60         JSR o|
00003690  73 61 73 63 69 0d 20 20  38 37 30 20 20 20 20 20  |sasci.  870     |
000036a0  20 20 20 20 4a 4d 50 20  70 72 69 6e 74 6c 6f 6f  |    JMP printloo|
000036b0  70 2b 64 69 66 66 0d 20  20 38 38 30 20 2e 65 6e  |p+diff.  880 .en|
000036c0  64 70 72 69 6e 74 0d 20  20 38 39 30 20 20 20 20  |dprint.  890    |
000036d0  20 20 20 20 20 4a 53 52  20 6f 73 6e 65 77 6c 0d  |     JSR osnewl.|
000036e0  20 20 39 30 30 20 20 20  20 20 20 20 20 20 50 4c  |  900         PL|
000036f0  41 0d 20 20 39 31 30 20  20 20 20 20 20 20 20 20  |A.  910         |
00003700  53 54 41 20 61 64 64 72  65 73 73 2b 31 0d 20 20  |STA address+1.  |
00003710  39 32 30 20 20 20 20 20  20 20 20 20 50 4c 41 0d  |920         PLA.|
00003720  20 20 39 33 30 20 20 20  20 20 20 20 20 20 53 54  |  930         ST|
00003730  41 20 61 64 64 72 65 73  73 0d 20 20 39 34 30 20  |A address.  940 |
00003740  20 20 20 20 20 20 20 20  50 4c 41 0d 20 20 39 35  |        PLA.  95|
00003750  30 20 20 20 20 20 20 20  20 20 54 41 59 0d 20 20  |0         TAY.  |
00003760  39 36 30 20 20 20 20 20  20 20 20 20 50 4c 41 0d  |960         PLA.|
00003770  20 20 39 37 30 20 20 20  20 20 20 20 20 20 54 41  |  970         TA|
00003780  58 0d 20 20 39 38 30 20  20 20 20 20 20 20 20 20  |X.  980         |
00003790  50 4c 41 0d 20 20 39 39  30 20 20 20 20 20 20 20  |PLA.  990       |
000037a0  20 20 52 54 53 0d 20 31  30 30 30 20 2e 70 72 69  |  RTS. 1000 .pri|
000037b0  6e 74 62 79 74 65 0d 20  31 30 31 30 20 20 20 20  |ntbyte. 1010    |
000037c0  20 20 20 20 20 50 48 41  0d 20 31 30 32 30 20 20  |     PHA. 1020  |
000037d0  20 20 20 20 20 20 20 4c  53 52 20 41 0d 20 31 30  |       LSR A. 10|
000037e0  33 30 20 20 20 20 20 20  20 20 20 4c 53 52 20 41  |30         LSR A|
000037f0  0d 20 31 30 34 30 20 20  20 20 20 20 20 20 20 4c  |. 1040         L|
00003800  53 52 20 41 0d 20 31 30  35 30 20 20 20 20 20 20  |SR A. 1050      |
00003810  20 20 20 4c 53 52 20 41  0d 20 31 30 36 30 20 20  |   LSR A. 1060  |
00003820  20 20 20 20 20 20 20 4a  53 52 20 6e 69 62 62 6c  |       JSR nibbl|
00003830  65 2b 64 69 66 66 0d 20  31 30 37 30 20 20 20 20  |e+diff. 1070    |
00003840  20 20 20 20 20 50 4c 41  0d 20 31 30 38 30 20 20  |     PLA. 1080  |
00003850  20 20 20 20 20 20 20 4a  53 52 20 6e 69 62 62 6c  |       JSR nibbl|
00003860  65 2b 64 69 66 66 0d 20  31 30 39 30 20 20 20 20  |e+diff. 1090    |
00003870  20 20 20 20 20 4c 44 41  20 23 41 53 43 28 22 20  |     LDA #ASC(" |
00003880  22 29 0d 20 31 31 30 30  20 20 20 20 20 20 20 20  |"). 1100        |
00003890  20 4a 4d 50 20 6f 73 61  73 63 69 0d 20 31 31 31  | JMP osasci. 111|
000038a0  30 20 2e 6e 69 62 62 6c  65 0d 20 31 31 32 30 20  |0 .nibble. 1120 |
000038b0  20 20 20 20 20 20 20 20  41 4e 44 20 23 26 30 46  |        AND #&0F|
000038c0  0d 20 31 31 33 30 20 20  20 20 20 20 20 20 20 53  |. 1130         S|
000038d0  45 44 0d 20 31 31 34 30  20 20 20 20 20 20 20 20  |ED. 1140        |
000038e0  20 43 4c 43 0d 20 31 31  35 30 20 20 20 20 20 20  | CLC. 1150      |
000038f0  20 20 20 41 44 43 20 23  26 39 30 0d 20 31 31 36  |   ADC #&90. 116|
00003900  30 20 20 20 20 20 20 20  20 20 41 44 43 20 23 26  |0         ADC #&|
00003910  34 30 0d 20 31 31 37 30  20 20 20 20 20 20 20 20  |40. 1170        |
00003920  20 43 4c 44 0d 20 31 31  38 30 20 20 20 20 20 20  | CLD. 1180      |
00003930  20 20 20 4a 4d 50 20 6f  73 61 73 63 69 0d 20 31  |   JMP osasci. 1|
00003940  31 39 30 20 2e 65 71 75  61 6c 73 0d 20 31 32 30  |190 .equals. 120|
00003950  30 20 20 20 20 20 20 20  20 20 4a 53 52 20 6f 73  |0         JSR os|
00003960  61 73 63 69 0d 20 31 32  31 30 20 20 20 20 20 20  |asci. 1210      |
00003970  20 20 20 4c 44 41 20 23  41 53 43 28 22 3d 22 29  |   LDA #ASC("=")|
00003980  0d 20 31 32 32 30 20 20  20 20 20 20 20 20 20 4a  |. 1220         J|
00003990  4d 50 20 6f 73 61 73 63  69 0d 20 31 32 33 30 20  |MP osasci. 1230 |
000039a0  2e 69 6e 64 65 78 0d 20  31 32 34 30 20 20 20 20  |.index. 1240    |
000039b0  20 20 20 20 20 4f 50 54  20 46 4e 65 71 75 62 28  |     OPT FNequb(|
000039c0  28 66 65 2b 64 69 66 66  29 20 4d 4f 44 20 32 35  |(fe+diff) MOD 25|
000039d0  36 29 0d 20 31 32 35 30  20 20 20 20 20 20 20 20  |6). 1250        |
000039e0  20 4f 50 54 20 46 4e 65  71 75 62 28 28 66 65 2b  | OPT FNequb((fe+|
000039f0  64 69 66 66 29 20 44 49  56 20 32 35 36 29 0d 20  |diff) DIV 256). |
00003a00  31 32 36 30 20 20 20 20  20 20 20 20 20 4f 50 54  |1260         OPT|
00003a10  20 46 4e 65 71 75 62 28  28 66 66 2b 64 69 66 66  | FNequb((ff+diff|
00003a20  29 20 4d 4f 44 20 32 35  36 29 0d 20 31 32 37 30  |) MOD 256). 1270|
00003a30  20 20 20 20 20 20 20 20  20 4f 50 54 20 46 4e 65  |         OPT FNe|
00003a40  71 75 62 28 28 66 66 2b  64 69 66 66 29 20 44 49  |qub((ff+diff) DI|
00003a50  56 20 32 35 36 29 0d 20  31 32 38 30 20 20 20 20  |V 256). 1280    |
00003a60  20 20 20 20 20 4f 50 54  20 46 4e 65 71 75 62 28  |     OPT FNequb(|
00003a70  28 7a 65 72 6f 2b 64 69  66 66 29 20 4d 4f 44 20  |(zero+diff) MOD |
00003a80  32 35 36 29 0d 20 31 32  39 30 20 20 20 20 20 20  |256). 1290      |
00003a90  20 20 20 4f 50 54 20 46  4e 65 71 75 62 28 28 7a  |   OPT FNequb((z|
00003aa0  65 72 6f 2b 64 69 66 66  29 20 44 49 56 20 32 35  |ero+diff) DIV 25|
00003ab0  36 29 0d 20 31 33 30 30  20 20 20 20 20 20 20 20  |6). 1300        |
00003ac0  20 4f 50 54 20 46 4e 65  71 75 62 28 28 6f 6e 65  | OPT FNequb((one|
00003ad0  2b 64 69 66 66 29 20 4d  4f 44 20 32 35 36 29 0d  |+diff) MOD 256).|
00003ae0  20 31 33 31 30 20 20 20  20 20 20 20 20 20 4f 50  | 1310         OP|
00003af0  54 20 46 4e 65 71 75 62  28 28 6f 6e 65 2b 64 69  |T FNequb((one+di|
00003b00  66 66 29 20 44 49 56 20  32 35 36 29 0d 20 31 33  |ff) DIV 256). 13|
00003b10  32 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |20         OPT F|
00003b20  4e 65 71 75 62 28 28 74  77 6f 2b 64 69 66 66 29  |Nequb((two+diff)|
00003b30  20 4d 4f 44 20 32 35 36  29 0d 20 31 33 33 30 20  | MOD 256). 1330 |
00003b40  20 20 20 20 20 20 20 20  4f 50 54 20 46 4e 65 71  |        OPT FNeq|
00003b50  75 62 28 28 74 77 6f 2b  64 69 66 66 29 20 44 49  |ub((two+diff) DI|
00003b60  56 20 32 35 36 29 0d 20  31 33 34 30 20 20 20 20  |V 256). 1340    |
00003b70  20 20 20 20 20 4f 50 54  20 46 4e 65 71 75 62 28  |     OPT FNequb(|
00003b80  28 74 68 72 65 65 2b 64  69 66 66 29 20 4d 4f 44  |(three+diff) MOD|
00003b90  20 32 35 36 29 0d 20 31  33 35 30 20 20 20 20 20  | 256). 1350     |
00003ba0  20 20 20 20 4f 50 54 20  46 4e 65 71 75 62 28 28  |    OPT FNequb((|
00003bb0  74 68 72 65 65 2b 64 69  66 66 29 20 44 49 56 20  |three+diff) DIV |
00003bc0  32 35 36 29 0d 20 31 33  36 30 20 20 20 20 20 20  |256). 1360      |
00003bd0  20 20 20 4f 50 54 20 46  4e 65 71 75 62 28 28 66  |   OPT FNequb((f|
00003be0  6f 75 72 2b 64 69 66 66  29 20 4d 4f 44 20 32 35  |our+diff) MOD 25|
00003bf0  36 29 0d 20 31 33 37 30  20 20 20 20 20 20 20 20  |6). 1370        |
00003c00  20 4f 50 54 20 46 4e 65  71 75 62 28 28 66 6f 75  | OPT FNequb((fou|
00003c10  72 2b 64 69 66 66 29 20  44 49 56 20 32 35 36 29  |r+diff) DIV 256)|
00003c20  0d 20 31 33 38 30 20 20  20 20 20 20 20 20 20 4f  |. 1380         O|
00003c30  50 54 20 46 4e 65 71 75  62 28 28 66 69 76 65 2b  |PT FNequb((five+|
00003c40  64 69 66 66 29 20 4d 4f  44 20 32 35 36 29 0d 20  |diff) MOD 256). |
00003c50  31 33 39 30 20 20 20 20  20 20 20 20 20 4f 50 54  |1390         OPT|
00003c60  20 46 4e 65 71 75 62 28  28 66 69 76 65 2b 64 69  | FNequb((five+di|
00003c70  66 66 29 20 44 49 56 20  32 35 36 29 0d 20 31 34  |ff) DIV 256). 14|
00003c80  30 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |00         OPT F|
00003c90  4e 65 71 75 62 28 28 73  69 78 2b 64 69 66 66 29  |Nequb((six+diff)|
00003ca0  20 4d 4f 44 20 32 35 36  29 0d 20 31 34 31 30 20  | MOD 256). 1410 |
00003cb0  20 20 20 20 20 20 20 20  4f 50 54 20 46 4e 65 71  |        OPT FNeq|
00003cc0  75 62 28 28 73 69 78 2b  64 69 66 66 29 20 44 49  |ub((six+diff) DI|
00003cd0  56 20 32 35 36 29 0d 20  31 34 32 30 20 20 20 20  |V 256). 1420    |
00003ce0  20 20 20 20 20 4f 50 54  20 46 4e 65 71 75 62 28  |     OPT FNequb(|
00003cf0  28 73 65 76 65 6e 2b 64  69 66 66 29 20 4d 4f 44  |(seven+diff) MOD|
00003d00  20 32 35 36 29 0d 20 31  34 33 30 20 20 20 20 20  | 256). 1430     |
00003d10  20 20 20 20 4f 50 54 20  46 4e 65 71 75 62 28 28  |    OPT FNequb((|
00003d20  73 65 76 65 6e 2b 64 69  66 66 29 20 44 49 56 20  |seven+diff) DIV |
00003d30  32 35 36 29 0d 20 31 34  34 30 20 20 20 20 20 20  |256). 1440      |
00003d40  20 20 20 4f 50 54 20 46  4e 65 71 75 62 28 28 65  |   OPT FNequb((e|
00003d50  69 67 68 74 2b 64 69 66  66 29 20 4d 4f 44 20 32  |ight+diff) MOD 2|
00003d60  35 36 29 0d 20 31 34 35  30 20 20 20 20 20 20 20  |56). 1450       |
00003d70  20 20 4f 50 54 20 46 4e  65 71 75 62 28 28 65 69  |  OPT FNequb((ei|
00003d80  67 68 74 2b 64 69 66 66  29 20 44 49 56 20 32 35  |ght+diff) DIV 25|
00003d90  36 29 0d 20 31 34 36 30  20 20 20 20 20 20 20 20  |6). 1460        |
00003da0  20 4f 50 54 20 46 4e 65  71 75 62 28 28 6e 69 6e  | OPT FNequb((nin|
00003db0  65 2b 64 69 66 66 29 20  4d 4f 44 20 32 35 36 29  |e+diff) MOD 256)|
00003dc0  0d 20 31 34 37 30 20 20  20 20 20 20 20 20 20 4f  |. 1470         O|
00003dd0  50 54 20 46 4e 65 71 75  62 28 28 6e 69 6e 65 2b  |PT FNequb((nine+|
00003de0  64 69 66 66 29 20 44 49  56 20 32 35 36 29 0d 20  |diff) DIV 256). |
00003df0  31 34 38 30 20 20 20 20  20 20 20 20 20 4f 50 54  |1480         OPT|
00003e00  20 46 4e 65 71 75 62 28  28 74 65 6e 2b 64 69 66  | FNequb((ten+dif|
00003e10  66 29 20 4d 4f 44 20 32  35 36 29 0d 20 31 34 39  |f) MOD 256). 149|
00003e20  30 20 20 20 20 20 20 20  20 20 4f 50 54 20 46 4e  |0         OPT FN|
00003e30  65 71 75 62 28 28 74 65  6e 2b 64 69 66 66 29 20  |equb((ten+diff) |
00003e40  44 49 56 20 32 35 36 29  0d 20 31 35 30 30 20 20  |DIV 256). 1500  |
00003e50  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
00003e60  62 28 28 65 6c 65 76 65  6e 2b 64 69 66 66 29 20  |b((eleven+diff) |
00003e70  4d 4f 44 20 32 35 36 29  0d 20 31 35 31 30 20 20  |MOD 256). 1510  |
00003e80  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
00003e90  62 28 28 65 6c 65 76 65  6e 2b 64 69 66 66 29 20  |b((eleven+diff) |
00003ea0  44 49 56 20 32 35 36 29  0d 20 31 35 32 30 20 20  |DIV 256). 1520  |
00003eb0  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
00003ec0  62 28 28 74 77 65 6c 76  65 2b 64 69 66 66 29 20  |b((twelve+diff) |
00003ed0  4d 4f 44 20 32 35 36 29  0d 20 31 35 33 30 20 20  |MOD 256). 1530  |
00003ee0  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
00003ef0  62 28 28 74 77 65 6c 76  65 2b 64 69 66 66 29 20  |b((twelve+diff) |
00003f00  44 49 56 20 32 35 36 29  0d 20 31 35 34 30 20 20  |DIV 256). 1540  |
00003f10  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
00003f20  62 28 28 74 68 69 72 74  65 65 6e 2b 64 69 66 66  |b((thirteen+diff|
00003f30  29 20 4d 4f 44 20 32 35  36 29 0d 20 31 35 35 30  |) MOD 256). 1550|
00003f40  20 20 20 20 20 20 20 20  20 4f 50 54 20 46 4e 65  |         OPT FNe|
00003f50  71 75 62 28 28 74 68 69  72 74 65 65 6e 2b 64 69  |qub((thirteen+di|
00003f60  66 66 29 20 44 49 56 20  32 35 36 29 0d 20 31 35  |ff) DIV 256). 15|
00003f70  36 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |60         OPT F|
00003f80  4e 65 71 75 62 28 28 66  6f 75 72 74 65 65 6e 2b  |Nequb((fourteen+|
00003f90  64 69 66 66 29 20 4d 4f  44 20 32 35 36 29 0d 20  |diff) MOD 256). |
00003fa0  31 35 37 30 20 20 20 20  20 20 20 20 20 4f 50 54  |1570         OPT|
00003fb0  20 46 4e 65 71 75 62 28  28 66 6f 75 72 74 65 65  | FNequb((fourtee|
00003fc0  6e 2b 64 69 66 66 29 20  44 49 56 20 32 35 36 29  |n+diff) DIV 256)|
00003fd0  0d 20 31 35 38 30 20 20  20 20 20 20 20 20 20 4f  |. 1580         O|
00003fe0  50 54 20 46 4e 65 71 75  62 28 28 66 69 66 74 65  |PT FNequb((fifte|
00003ff0  65 6e 2b 64 69 66 66 29  20 4d 4f 44 20 32 35 36  |en+diff) MOD 256|
00004000  29 0d 20 31 35 39 30 20  20 20 20 20 20 20 20 20  |). 1590         |
00004010  4f 50 54 20 46 4e 65 71  75 62 28 28 66 69 66 74  |OPT FNequb((fift|
00004020  65 65 6e 2b 64 69 66 66  29 20 44 49 56 20 32 35  |een+diff) DIV 25|
00004030  36 29 0d 20 31 36 30 30  20 20 20 20 20 20 20 20  |6). 1600        |
00004040  20 4f 50 54 20 46 4e 65  71 75 62 28 28 73 69 78  | OPT FNequb((six|
00004050  74 65 65 6e 2b 64 69 66  66 29 20 4d 4f 44 20 32  |teen+diff) MOD 2|
00004060  35 36 29 0d 20 31 36 31  30 20 20 20 20 20 20 20  |56). 1610       |
00004070  20 20 4f 50 54 20 46 4e  65 71 75 62 28 28 73 69  |  OPT FNequb((si|
00004080  78 74 65 65 6e 2b 64 69  66 66 29 20 44 49 56 20  |xteen+diff) DIV |
00004090  32 35 36 29 0d 20 31 36  32 30 20 20 20 20 20 20  |256). 1620      |
000040a0  20 20 20 4f 50 54 20 46  4e 65 71 75 62 28 28 73  |   OPT FNequb((s|
000040b0  65 76 65 6e 74 65 65 6e  2b 64 69 66 66 29 20 4d  |eventeen+diff) M|
000040c0  4f 44 20 32 35 36 29 0d  20 31 36 33 30 20 20 20  |OD 256). 1630   |
000040d0  20 20 20 20 20 20 4f 50  54 20 46 4e 65 71 75 62  |      OPT FNequb|
000040e0  28 28 73 65 76 65 6e 74  65 65 6e 2b 64 69 66 66  |((seventeen+diff|
000040f0  29 20 44 49 56 20 32 35  36 29 0d 20 31 36 34 30  |) DIV 256). 1640|
00004100  20 20 20 20 20 20 20 20  20 4f 50 54 20 46 4e 65  |         OPT FNe|
00004110  71 75 62 28 28 65 69 67  68 74 65 65 6e 2b 64 69  |qub((eighteen+di|
00004120  66 66 29 20 4d 4f 44 20  32 35 36 29 0d 20 31 36  |ff) MOD 256). 16|
00004130  35 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |50         OPT F|
00004140  4e 65 71 75 62 28 28 65  69 67 68 74 65 65 6e 2b  |Nequb((eighteen+|
00004150  64 69 66 66 29 20 44 49  56 20 32 35 36 29 0d 20  |diff) DIV 256). |
00004160  31 36 36 30 20 2e 66 65  0d 20 31 36 37 30 20 20  |1660 .fe. 1670  |
00004170  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
00004180  73 28 22 54 75 62 65 20  73 79 73 74 65 6d 20 70  |s("Tube system p|
00004190  6f 73 74 20 69 6e 69 74  2e 22 29 0d 20 31 36 38  |ost init."). 168|
000041a0  30 20 20 20 20 20 20 20  20 20 42 52 4b 0d 20 31  |0         BRK. 1|
000041b0  36 39 30 20 2e 66 66 0d  20 31 37 30 30 20 20 20  |690 .ff. 1700   |
000041c0  20 20 20 20 20 20 4f 50  54 20 46 4e 65 71 75 73  |      OPT FNequs|
000041d0  28 22 54 75 62 65 20 73  79 73 74 65 6d 20 6d 61  |("Tube system ma|
000041e0  69 6e 20 69 6e 69 74 2e  22 29 0d 20 31 37 31 30  |in init."). 1710|
000041f0  20 20 20 20 20 20 20 20  20 42 52 4b 0d 20 31 37  |         BRK. 17|
00004200  32 30 20 2e 7a 65 72 6f  0d 20 31 37 33 30 20 20  |20 .zero. 1730  |
00004210  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
00004220  73 28 22 4e 6f 20 6f 70  65 72 61 74 69 6f 6e 22  |s("No operation"|
00004230  29 0d 20 31 37 34 30 20  20 20 20 20 20 20 20 20  |). 1740         |
00004240  42 52 4b 0d 20 31 37 35  30 20 2e 6f 6e 65 0d 20  |BRK. 1750 .one. |
00004250  31 37 36 30 20 20 20 20  20 20 20 20 20 4f 50 54  |1760         OPT|
00004260  20 46 4e 65 71 75 73 28  22 41 62 73 2e 20 77 6f  | FNequs("Abs. wo|
00004270  72 6b 73 70 61 63 65 20  63 6c 61 69 6d 22 29 0d  |rkspace claim").|
00004280  20 31 37 37 30 20 20 20  20 20 20 20 20 20 42 52  | 1770         BR|
00004290  4b 0d 20 31 37 38 30 20  2e 74 77 6f 0d 20 31 37  |K. 1780 .two. 17|
000042a0  39 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |90         OPT F|
000042b0  4e 65 71 75 73 28 22 50  72 69 76 61 74 65 20 77  |Nequs("Private w|
000042c0  6f 72 6b 73 70 61 63 65  20 63 6c 61 69 6d 22 29  |orkspace claim")|
000042d0  0d 20 31 38 30 30 20 20  20 20 20 20 20 20 20 42  |. 1800         B|
000042e0  52 4b 0d 20 31 38 31 30  20 2e 74 68 72 65 65 0d  |RK. 1810 .three.|
000042f0  20 31 38 32 30 20 20 20  20 20 20 20 20 20 4f 50  | 1820         OP|
00004300  54 20 46 4e 65 71 75 73  28 22 41 75 74 6f 2d 62  |T FNequs("Auto-b|
00004310  6f 6f 74 22 29 0d 20 31  38 33 30 20 20 20 20 20  |oot"). 1830     |
00004320  20 20 20 20 42 52 4b 0d  20 31 38 34 30 20 2e 66  |    BRK. 1840 .f|
00004330  6f 75 72 0d 20 31 38 35  30 20 20 20 20 20 20 20  |our. 1850       |
00004340  20 20 4f 50 54 20 46 4e  65 71 75 73 28 22 55 6e  |  OPT FNequs("Un|
00004350  72 65 63 6f 67 6e 69 73  65 64 20 63 6f 6d 6d 61  |recognised comma|
00004360  6e 64 22 29 0d 20 31 38  36 30 20 20 20 20 20 20  |nd"). 1860      |
00004370  20 20 20 42 52 4b 0d 20  31 38 37 30 20 2e 66 69  |   BRK. 1870 .fi|
00004380  76 65 0d 20 31 38 38 30  20 20 20 20 20 20 20 20  |ve. 1880        |
00004390  20 4f 50 54 20 46 4e 65  71 75 73 28 22 55 6e 72  | OPT FNequs("Unr|
000043a0  65 63 6f 67 6e 69 73 65  64 20 69 6e 74 65 72 75  |ecognised interu|
000043b0  70 74 22 29 0d 20 31 38  39 30 20 20 20 20 20 20  |pt"). 1890      |
000043c0  20 20 20 42 52 4b 0d 20  31 39 30 30 20 2e 73 69  |   BRK. 1900 .si|
000043d0  78 0d 20 31 39 31 30 20  20 20 20 20 20 20 20 20  |x. 1910         |
000043e0  4f 50 54 20 46 4e 65 71  75 73 28 22 42 72 65 61  |OPT FNequs("Brea|
000043f0  6b 22 29 0d 20 31 39 32  30 20 20 20 20 20 20 20  |k"). 1920       |
00004400  20 20 42 52 4b 0d 20 31  39 33 30 20 2e 73 65 76  |  BRK. 1930 .sev|
00004410  65 6e 0d 20 31 39 34 30  20 20 20 20 20 20 20 20  |en. 1940        |
00004420  20 4f 50 54 20 46 4e 65  71 75 73 28 22 55 6e 72  | OPT FNequs("Unr|
00004430  65 63 6f 67 6e 69 73 65  64 20 4f 73 62 79 74 65  |ecognised Osbyte|
00004440  22 29 0d 20 31 39 35 30  20 20 20 20 20 20 20 20  |"). 1950        |
00004450  20 42 52 4b 0d 20 31 39  36 30 20 2e 65 69 67 68  | BRK. 1960 .eigh|
00004460  74 0d 20 31 39 37 30 20  20 20 20 20 20 20 20 20  |t. 1970         |
00004470  4f 50 54 20 46 4e 65 71  75 73 28 22 55 6e 72 65  |OPT FNequs("Unre|
00004480  63 6f 67 6e 69 73 65 64  20 4f 73 77 6f 72 64 22  |cognised Osword"|
00004490  29 0d 20 31 39 38 30 20  20 20 20 20 20 20 20 20  |). 1980         |
000044a0  42 52 4b 0d 20 31 39 39  30 20 2e 6e 69 6e 65 0d  |BRK. 1990 .nine.|
000044b0  20 32 30 30 30 20 20 20  20 20 20 20 20 20 4f 50  | 2000         OP|
000044c0  54 20 46 4e 65 71 75 73  28 22 48 65 6c 70 22 29  |T FNequs("Help")|
000044d0  0d 20 32 30 31 30 20 20  20 20 20 20 20 20 20 42  |. 2010         B|
000044e0  52 4b 0d 20 32 30 32 30  20 2e 74 65 6e 0d 20 32  |RK. 2020 .ten. 2|
000044f0  30 33 30 20 20 20 20 20  20 20 20 20 4f 50 54 20  |030         OPT |
00004500  46 4e 65 71 75 73 28 22  43 6c 61 69 6d 20 73 74  |FNequs("Claim st|
00004510  61 74 69 63 20 77 6f 72  6b 73 70 61 63 65 22 29  |atic workspace")|
00004520  0d 20 32 30 34 30 20 20  20 20 20 20 20 20 20 42  |. 2040         B|
00004530  52 4b 0d 20 32 30 35 30  20 2e 65 6c 65 76 65 6e  |RK. 2050 .eleven|
00004540  0d 20 32 30 36 30 20 20  20 20 20 20 20 20 20 4f  |. 2060         O|
00004550  50 54 20 46 4e 65 71 75  73 28 22 4e 4d 49 20 72  |PT FNequs("NMI r|
00004560  65 6c 65 61 73 65 22 29  0d 20 32 30 37 30 20 20  |elease"). 2070  |
00004570  20 20 20 20 20 20 20 42  52 4b 0d 20 32 30 38 30  |       BRK. 2080|
00004580  20 2e 74 77 65 6c 76 65  0d 20 32 30 39 30 20 20  | .twelve. 2090  |
00004590  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
000045a0  73 28 22 4e 4d 49 20 63  6c 61 69 6d 22 29 0d 20  |s("NMI claim"). |
000045b0  32 31 30 30 20 20 20 20  20 20 20 20 20 42 52 4b  |2100         BRK|
000045c0  0d 20 32 31 31 30 20 2e  74 68 69 72 74 65 65 6e  |. 2110 .thirteen|
000045d0  0d 20 32 31 32 30 20 20  20 20 20 20 20 20 20 4f  |. 2120         O|
000045e0  50 54 20 46 4e 65 71 75  73 28 22 52 46 53 20 69  |PT FNequs("RFS i|
000045f0  6e 69 74 69 61 6c 69 73  65 22 29 0d 20 32 31 33  |nitialise"). 213|
00004600  30 20 20 20 20 20 20 20  20 20 42 52 4b 0d 20 32  |0         BRK. 2|
00004610  31 34 30 20 2e 66 6f 75  72 74 65 65 6e 0d 20 32  |140 .fourteen. 2|
00004620  31 35 30 20 20 20 20 20  20 20 20 20 4f 50 54 20  |150         OPT |
00004630  46 4e 65 71 75 73 28 22  52 46 53 20 62 79 74 65  |FNequs("RFS byte|
00004640  20 67 65 74 22 29 0d 20  32 31 36 30 20 20 20 20  | get"). 2160    |
00004650  20 20 20 20 20 42 52 4b  0d 20 32 31 37 30 20 2e  |     BRK. 2170 .|
00004660  66 69 66 74 65 65 6e 0d  20 32 31 38 30 20 20 20  |fifteen. 2180   |
00004670  20 20 20 20 20 20 4f 50  54 20 46 4e 65 71 75 73  |      OPT FNequs|
00004680  28 22 56 65 63 74 6f 72  73 20 63 6c 61 69 6d 65  |("Vectors claime|
00004690  64 22 29 0d 20 32 31 39  30 20 20 20 20 20 20 20  |d"). 2190       |
000046a0  20 20 42 52 4b 0d 20 32  32 30 30 20 2e 73 69 78  |  BRK. 2200 .six|
000046b0  74 65 65 6e 0d 20 32 32  31 30 20 20 20 20 20 20  |teen. 2210      |
000046c0  20 20 20 4f 50 54 20 46  4e 65 71 75 73 28 22 53  |   OPT FNequs("S|
000046d0  50 4f 4f 4c 2f 45 58 45  43 20 66 69 6c 65 20 63  |POOL/EXEC file c|
000046e0  6c 6f 73 75 72 65 22 29  0d 20 32 32 32 30 20 20  |losure"). 2220  |
000046f0  20 20 20 20 20 20 20 42  52 4b 0d 20 32 32 33 30  |       BRK. 2230|
00004700  20 2e 73 65 76 65 6e 74  65 65 6e 0d 20 32 32 34  | .seventeen. 224|
00004710  30 20 20 20 20 20 20 20  20 20 4f 50 54 20 46 4e  |0         OPT FN|
00004720  65 71 75 73 28 22 46 6f  6e 74 20 69 6d 70 6c 6f  |equs("Font implo|
00004730  64 65 2f 65 78 70 6c 6f  64 65 22 29 0d 20 32 32  |de/explode"). 22|
00004740  35 30 20 20 20 20 20 20  20 20 20 42 52 4b 0d 20  |50         BRK. |
00004750  32 32 36 30 20 2e 65 69  67 68 74 65 65 6e 0d 20  |2260 .eighteen. |
00004760  32 32 37 30 20 20 20 20  20 20 20 20 20 4f 50 54  |2270         OPT|
00004770  20 46 4e 65 71 75 73 28  22 49 6e 69 74 2e 20 66  | FNequs("Init. f|
00004780  69 6c 69 6e 67 20 73 79  73 74 65 6d 22 29 0d 20  |iling system"). |
00004790  32 32 38 30 20 20 20 20  20 20 20 20 20 42 52 4b  |2280         BRK|
000047a0  0d 20 32 32 39 30 20 2e  6c 61 73 74 62 79 74 65  |. 2290 .lastbyte|
000047b0  0d 20 32 33 30 30 20 5d  0d 20 32 33 31 30 20 4e  |. 2300 ]. 2310 N|
000047c0  45 58 54 0d 20 32 33 32  30 20 49 4e 50 55 54 27  |EXT. 2320 INPUT'|
000047d0  22 53 61 76 65 20 66 69  6c 65 6e 61 6d 65 3f 20  |"Save filename? |
000047e0  3a 20 22 66 69 6c 65 6e  61 6d 65 24 0d 20 32 33  |: "filename$. 23|
000047f0  33 30 20 49 46 20 66 69  6c 65 6e 61 6d 65 24 3d  |30 IF filename$=|
00004800  22 22 20 45 4e 44 0d 20  32 33 34 30 20 24 73 61  |"" END. 2340 $sa|
00004810  76 65 3d 22 53 41 56 45  20 22 2b 66 69 6c 65 6e  |ve="SAVE "+filen|
00004820  61 6d 65 24 2b 22 20 22  2b 53 54 52 24 7e 28 48  |ame$+" "+STR$~(H|
00004830  49 4d 45 4d 29 2b 22 20  22 2b 53 54 52 24 7e 28  |IMEM)+" "+STR$~(|
00004840  6c 61 73 0d 20 20 20 20  20 20 74 62 79 74 65 29  |las.      tbyte)|
00004850  2b 22 20 46 46 46 46 38  30 30 30 20 46 46 46 46  |+" FFFF8000 FFFF|
00004860  38 30 30 30 22 0d 20 32  33 35 30 20 58 25 3d 73  |8000". 2350 X%=s|
00004870  61 76 65 20 4d 4f 44 20  32 35 36 0d 20 32 33 36  |ave MOD 256. 236|
00004880  30 20 59 25 3d 73 61 76  65 20 44 49 56 20 32 35  |0 Y%=save DIV 25|
00004890  36 0d 20 32 33 37 30 20  2a 4f 50 54 31 2c 32 0d  |6. 2370 *OPT1,2.|
000048a0  20 32 33 38 30 20 43 41  4c 4c 20 6f 73 63 6c 69  | 2380 CALL oscli|
000048b0  0d 20 32 33 39 30 20 2a  4f 50 54 31 2c 30 0d 20  |. 2390 *OPT1,0. |
000048c0  32 34 30 30 20 45 4e 44  0d 20 32 34 31 30 20 44  |2400 END. 2410 D|
000048d0  45 46 46 4e 65 71 75 62  28 62 79 74 65 29 0d 20  |EFFNequb(byte). |
000048e0  32 34 32 30 20 3f 50 25  3d 62 79 74 65 0d 20 32  |2420 ?P%=byte. 2|
000048f0  34 33 30 20 50 25 3d 50  25 2b 31 0d 20 32 34 34  |430 P%=P%+1. 244|
00004900  30 20 3d 70 61 73 73 0d  20 32 34 35 30 20 44 45  |0 =pass. 2450 DE|
00004910  46 46 4e 65 71 75 77 28  77 6f 72 64 29 0d 20 32  |FFNequw(word). 2|
00004920  34 36 30 20 3f 50 25 3d  77 6f 72 64 20 4d 4f 44  |460 ?P%=word MOD|
00004930  20 32 35 36 0d 20 32 34  37 30 20 50 25 3f 31 3d  | 256. 2470 P%?1=|
00004940  77 6f 72 64 20 44 49 56  20 32 35 36 0d 20 32 34  |word DIV 256. 24|
00004950  38 30 20 50 25 3d 50 25  2b 32 0d 20 32 34 39 30  |80 P%=P%+2. 2490|
00004960  20 3d 70 61 73 73 0d 20  32 35 30 30 20 44 45 46  | =pass. 2500 DEF|
00004970  46 4e 65 71 75 64 28 64  6f 75 62 6c 65 29 0d 20  |FNequd(double). |
00004980  32 35 31 30 20 21 50 25  3d 64 6f 75 62 6c 65 0d  |2510 !P%=double.|
00004990  20 32 35 32 30 20 50 25  3d 50 25 2b 34 0d 20 32  | 2520 P%=P%+4. 2|
000049a0  35 33 30 20 3d 70 61 73  73 0d 20 32 35 34 30 20  |530 =pass. 2540 |
000049b0  44 45 46 46 4e 65 71 75  73 28 73 74 72 69 6e 67  |DEFFNequs(string|
000049c0  24 29 0d 20 32 35 35 30  20 24 50 25 3d 73 74 72  |$). 2550 $P%=str|
000049d0  69 6e 67 24 0d 20 32 35  36 30 20 50 25 3d 50 25  |ing$. 2560 P%=P%|
000049e0  2b 4c 45 4e 28 73 74 72  69 6e 67 24 29 0d 20 32  |+LEN(string$). 2|
000049f0  35 37 30 20 3d 70 61 73  73 0d                    |570 =pass.|
000049fa
01_11_87/T\SWR02.m0
01_11_87/T\SWR02.m1
01_11_87/T\SWR02.m2
01_11_87/T\SWR02.m4
01_11_87/T\SWR02.m5