Home » CEEFAX disks » telesoftware12.adl » 17-02-89/A\Info

17-02-89/A\Info

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 » telesoftware12.adl
Filename: 17-02-89/A\Info
Read OK:
File size: 2FBA bytes
Load address: 0000
Exec address: FFFFFFFF
File contents
This package will give Assembly language users additional memory space for
the assembling of object code from large source code files.

The assembly method described here is intended for those who already are
familiar with 6502 assembly on the BBC. A reasonable knowledge of this,
and BBC BASIC is assumed in the notes. Beginners would, in any case, be
unlikely to need the extra memory space made available by using this
system.

Minimum hardware requirements are:

Model B computer Cassette recorder BASIC (any version) Any wordprocessor.

Working from cassette will be very slow, and BASIC 2 or later is to be
preferred.

The Assembler built-in the BBC Micro is undoubtedly excellent, but has one
notable failing. This is the fact that the assembling Source program has
to reside in the machine along with the assembled Object code, often in
the same area that the Object code is neede d to run from.

From BASIC 2 onwards this is partly alleviated by the ability to use
offset assembly (OPT 4 - 7), however the main problem still exists; namely
that of having the Source code taking up valuable space.

If you are sufficiently involved in assembly language programming then you
may feel it worth investing in a more sophisticated assembler ROM that can
assemble from Source text files, sending the Object code directly to other
files. But there is an alternative approach which goes a long way to
solving the problem.

Most of us have, without thinking about it, used the computer to perform
simple calculations entered directly from the keyboard. What is not so
obvious is that almost the whole of the BASIC language structure is
available from the keyboard. This includes the assembler. Try the
following:

>P%=&C00
>[OPT 2:LDA #ASC"A":JSR &FFEE:RTS
>CALL &C00

You should find that the computer will print the letter 'A'. Notice that
the assembling line must start with [OPT and all the statements are on
that line. There is no need for the closing ] as the assembler is
automatically switched off at the end of the line.

This can be expanded using labels and variables, and spread over several
lines so:

>NEW
>base=&C00
>oswrch=&FFEE
>P%=base
>[OPT 2:LDX #&0A
>[OPT 2:.label
>[OPT 2:LDA #ASC"A"
>[OPT 2:JSR oswrch
>[OPT 2:DEX
>[OPT 2:BNE label
>[OPT 2:RTS
>CALL base

All of that is a rather contrived way of sending 10 'A's to the screen.
You could be forgiven for thinking that this is an unbelievably tedious
way of assembling code, particularly as the idea is to assemble very large
amounts!

Fortunately there is a way of fooling the computer into thinking that it
is receiving keyboard entry. This is done by using '*EXEC <file>'. What is
needed is a wordprocessor that can produce unformatted raw text with no
added control codes or (time wasting) padding spaces. Wordwise is ideal
for this or, if you have the MASTER series, the text editor. View, and
other wordprocessors can be used if the file is saved with the 'Write
Text' option.

If the previous lines are typed in and saved to a file named (say)
'source', then all you need to do when you want to assemble the code is to
type '*EXEC source'. Note that the variable/label stack will start at
LOMEM which will be PAGE+2 so if you want code to be assembled here then
you must either move LOMEM or use offset assembly and save and re-load the
Object code.

If, for example, you want to assemble your brilliant new game at &1900 and
you expect the code to be less than 8k, construct the file 'source' as
below.

NEW:LOMEM=&3900:base=&1900:P%=base (CR) [OPT 2: {code} (CR) [OPT 2: {code}
(CR) etc.

It should be noted that the lines of code must not exceed 255 characters
(about 6 lines of 40 column text) and for safety I usually stick to about
half of that. The fewer lines you have the faster the code assembles but
you gain nothing memory-wise as the source code exists in file form. Also
LOMEM must be set before any variables are used, otherwise you'll lose
them again!

An astute reader will have noticed that I have only used OPT 2, whereas
usually one needs to use two pass assembly within a FOR-NEXT loop, the FOR
variable being used to set OPT. When assembling from the keyboard or from
an EXEC file, only the current line exists in the computer's memory (at
&700 actually), so FOR-NEXT and REPEAT-UNTIL constructs can only be made
to operate over this line, which can't be more than 255 bytes long.

The solution is to use '*EXEC source' twice, adjusting the OPT variable
acordingly. Using OPTs 1-3, and 5-7 causes confusion. You end up with
repeated lines on the screen, so stick to 0-2, and 4-6. As you don't want
to reset the whole system with NEW each pass, you also need to split the
file into two parts. Call them 'init' and 'code'. Taking this one step
further 'code' can be made to re-run itself so:


  'init' file :

NEW (CR)
LOMEM=&3900 (CR)
base=&1900 (CR)
zero=&70 (CR)
oswrch=&FFEE (CR)
osbyte=&FFF4 (CR)
I%=0 (CR)
*EXEC code (CR)

  'code' file :

P%=base (CR)
[OPTI%: {code} (CR)
[OPTI%: {code} (CR)
etc.
IF I%=0 THEN I%=2:*EXEC code (CR)


All you now need to do is to type '*EXEC init', and let it get on with it.
Notice that all constants should be set in 'init' in the same way that you
would use a PROCinit in a 'real' program. I've spread the lines out in the
example to make this clearer. Also in 'code' the OPT variable will be
entered for every new line. Using one of the resident integers makes it a
little clearer and less tedious to enter than a real variable.

Ideally you want the labels and variables to take up as little room in the
variable stack as possible, thereby making the maximum possible space
available to the assembled code. Use all the resident integers where
possible. This will cost you no memory at all.  P% (and in the case of
offset assembly, O%) are used by the assembler so are not available. I
suggest you use I% for the OPT variable. For other variables use minimum
possible abbreviations and real variables rather than non-resident
integers. The '%' takes a valuable byte out of the variable stack. Also
use lots of REMs and blank lines for clarity. They use up no memory at
all. The assembler drops out every line so REMs are quite possible, and in
fact clearer than comments. Purists will hate me for saying this, but
don't use unnecessary variables. Use the actual addresses for OS calls
etc., as below:


REM this is an A writer (CR)
 (CR)
[OPTI%:.a1:LDA #ASC"A":LDX #&0A (CR)
 (CR)
REM loop to here for more A's (CR)
 (CR)
[OPTI%:.a2:JSR &FFEE:DEX:BNE a2 (CR)
 (CR)
REM no more A's so exit (CR)
 (CR)
[OPTI%:RTS (CR)

A lot of people follow labels with a space rather than a colon. I strongly
advise you not to, when using this method of assembly.  From experience I
know it is very easy to accidentally remove spaces from a text file whilst
tidying up. Tedious when the error won 't be reported until the second
pass!

One problem that isn't obvious here is the computer's response to errors.
These will be reported in the usual way, but as you are assembling via the
'keyboard' there is no program for BASIC's error handler to stop, so it
will keep on trying to assemble with the error message being scrolled off
the top of the screen. Obviously you can't sit glued to the screen
watching for errors as they occur, and undetected ones can be extremely
difficult to identify, so an error handler has to be added.

The lines below should be put in at the very start of 'init' so that once
the code runs 'NEW' will wipe out the (no longer required) variables used.
The routine works by redirecting BRKV, where all errors pass. The new code
closes the current EXEC file, then puts BRKV back where it belongs. The
result is that you see the error message at the bottom of the screen. You
then know that the line above is the one containing the error.


LOMEM=&7000:brkv=&202:P%=&C00 (CR)
 (CR)
[OPT2:.store:EQUW &FFFF (CR)
 (CR)
[OPT2:.err:PHP:PHA:TXA:PHA:TYA:PHA (CR)
[OPT2:LDA #&77:JSR &FFF4 (CR)
[OPT2:SEI:LDA store:STA brkv (CR)
[OPT2:LDA store+1:STA brkv+1:CLI (CR)
[OPT2:PLA:TAY:PLA:TAX:PLA:PLP:JMP(brkv) (CR)
 (CR)
[OPT2:.set:SEI (CR)
[OPT2:LDA brkv:STA store (CR)
[OPT2:LDA brkv+1:STA store+1 (CR)
[OPT2:LDA #err MOD256:STA brkv (CR)
[OPT2:LDA #err DIV256:STA brkv+1 (CR)
[OPT2:CLI:RTS (CR)
 (CR)
CALL set (CR)

Be very careful to ensure that this bit of code doesn't itself contain
errors. I've used &C00 for the error code's location. This is normally a
safe place. The code is very short and could be put in one of several
other places if necessary.

With a little ingenuity you will find that almost all assembly can be done
from files like this, including lists and tables. These can sometimes be
pre-compiled in BASIC programs, and *LOAD used in conjunction with OSCLI
to locate them where they are required. Very occasionally there is a
problem that has to be solved with a procedure or function, which
obviously can't exist in a file. This is particularly true for BASIC 1
users who may need to synthesise the EQU and OSCLI operations. Fortunately
it is possible to tuck very small procedures away in memory and call them
when required. If you have a block of procedures that is less than 512
bytes long, and are careful about LOMEM it is possible to have it residing
at &900. Below is an arrangement that does just that.


  procedures :

10DEFPROCa:PRINT"PROCa":ENDPROC
20DEFPROCb:PRINT"PROCb":ENDPROC

  Save as 'PROC'


  'init' file :

PAGE=&900 (CR)
LOAD"PROC" (CR)
 (CR)
LOMEM=&7000: {etc. as before}


To run the whole suite type '*EXEC init'. This, or any later files can now
call the procedures or functions as they need to. If the procedures use
variables, they will be put safely on the variable stack above LOMEM.
Notice that I've used the maximum possible compression in the procedures
to save memory space. Also the LOAD command in 'init' must be on its own
line. Finally OLD must be used instead of NEW or the computer will lose
the program lines loaded!


A complete (rather contrived) set is as follows:


  PROGRAM :

10DEFPROCa:CLS:PRINT'"All done!":ENDPROC

  Save as 'PROC'


  'init' file :

PAGE=&900 (CR)
LOAD"PROC" (CR)
 (CR)
LOMEM=&7000 (CR)
brkv=&202 (CR)
P%=&C00 (CR)
 (CR)
[OPT2:.store:EQUW &FFFF (CR)
 (CR)
[OPT2:.err:PHP:PHA:TXA:PHA:TYA:PHA (CR)
[OPT2:LDA #&77:JSR &FFF4 (CR)
[OPT2:SEI:LDA store:STA brkv (CR)
[OPT2:LDA store+1:STA brkv+1:CLI (CR)
[OPT2:PLA:TAY:PLA:TAX:PLA:PLP:JMP (brkv) (CR)
 (CR)
[OPT2:.set:SEI (CR)
[OPT2:LDA brkv:STA store (CR)
[OPT2:LDA brkv+1:STA store+1 (CR)
[OPT2:LDA #err MOD256:STA brkv (CR)
[OPT2:LDA #err DIV256:STA brkv+1 (CR)
[OPT2:CLI:RTS (CR)
 (CR)
CALL set (CR)
OLD (CR)
LOMEM=&1A00 (CR)
base=&1900 (CR)
I%=0 (CR)
*EXEC code (CR)


  'code' file :

P%=base (CR)
REM this is an A writer (CR)
 (CR)
[OPTI%:.a1:LDX #&0A (CR)
 (CR)
REM loop to here for more A's (CR)
 (CR)
[OPTI%:.a2:LDA #ASC"A":JSR &FFEE:DEX:BNE a2 (CR)
 (CR)
REM no more A's so exit (CR)
 (CR)
[OPTI%:RTS (CR)

IF I%=2 THEN PROCa ELSE I%=2:*EXEC code (CR)

Once you develop really large Source code you will find that it won't all
fit in to one text file. This is not a problem. All you have to do is to
make files daisy-chain each other like the ones below.



  file 2:

REM basic tools (CR)
 (CR)
[OPTI%: {code} (CR)
etc
*EXEC ftools (CR)


  file 3:

REM filing tools (CR)
 (CR)
[OPTI%: {code} (CR)
etc
*EXEC mtools (CR)


  file 8:

REM subroutines (CR)
 (CR)
[OPTI%: {code} (CR)
etc
IF I%=6 THEN CLS:P.''"Finished" EL.I%=6:*EXEC btools (CR)



I use this method to produce a 16k Toolkit EPROM using offset assembly. It
requires 8 files and takes around five minutes to assemble from the DFS.
The machine used is a perfectly standard Model B with only Wordwise added.

If you stick to the format I've used here then the BASIC program 'PRINTER'
can be used to make a hard copy of your files. It is intended for use with
an Epson compatible printer using normal fan-fold paper.

The program prints a heading on each page with the filename and page
number. For clarity it will automatically strip off the '[OPTI %' and will
indent statements and comments, whilst leaving any BASIC untouched. There
is also an option to split the statements on to separate lines - this
really gobbles up paper but makes the code a delight to read.
00000000  54 68 69 73 20 70 61 63  6b 61 67 65 20 77 69 6c  |This package wil|
00000010  6c 20 67 69 76 65 20 41  73 73 65 6d 62 6c 79 20  |l give Assembly |
00000020  6c 61 6e 67 75 61 67 65  20 75 73 65 72 73 20 61  |language users a|
00000030  64 64 69 74 69 6f 6e 61  6c 20 6d 65 6d 6f 72 79  |dditional memory|
00000040  20 73 70 61 63 65 20 66  6f 72 0d 74 68 65 20 61  | space for.the a|
00000050  73 73 65 6d 62 6c 69 6e  67 20 6f 66 20 6f 62 6a  |ssembling of obj|
00000060  65 63 74 20 63 6f 64 65  20 66 72 6f 6d 20 6c 61  |ect code from la|
00000070  72 67 65 20 73 6f 75 72  63 65 20 63 6f 64 65 20  |rge source code |
00000080  66 69 6c 65 73 2e 0d 0d  54 68 65 20 61 73 73 65  |files...The asse|
00000090  6d 62 6c 79 20 6d 65 74  68 6f 64 20 64 65 73 63  |mbly method desc|
000000a0  72 69 62 65 64 20 68 65  72 65 20 69 73 20 69 6e  |ribed here is in|
000000b0  74 65 6e 64 65 64 20 66  6f 72 20 74 68 6f 73 65  |tended for those|
000000c0  20 77 68 6f 20 61 6c 72  65 61 64 79 20 61 72 65  | who already are|
000000d0  0d 66 61 6d 69 6c 69 61  72 20 77 69 74 68 20 36  |.familiar with 6|
000000e0  35 30 32 20 61 73 73 65  6d 62 6c 79 20 6f 6e 20  |502 assembly on |
000000f0  74 68 65 20 42 42 43 2e  20 41 20 72 65 61 73 6f  |the BBC. A reaso|
00000100  6e 61 62 6c 65 20 6b 6e  6f 77 6c 65 64 67 65 20  |nable knowledge |
00000110  6f 66 20 74 68 69 73 2c  0d 61 6e 64 20 42 42 43  |of this,.and BBC|
00000120  20 42 41 53 49 43 20 69  73 20 61 73 73 75 6d 65  | BASIC is assume|
00000130  64 20 69 6e 20 74 68 65  20 6e 6f 74 65 73 2e 20  |d in the notes. |
00000140  42 65 67 69 6e 6e 65 72  73 20 77 6f 75 6c 64 2c  |Beginners would,|
00000150  20 69 6e 20 61 6e 79 20  63 61 73 65 2c 20 62 65  | in any case, be|
00000160  0d 75 6e 6c 69 6b 65 6c  79 20 74 6f 20 6e 65 65  |.unlikely to nee|
00000170  64 20 74 68 65 20 65 78  74 72 61 20 6d 65 6d 6f  |d the extra memo|
00000180  72 79 20 73 70 61 63 65  20 6d 61 64 65 20 61 76  |ry space made av|
00000190  61 69 6c 61 62 6c 65 20  62 79 20 75 73 69 6e 67  |ailable by using|
000001a0  20 74 68 69 73 0d 73 79  73 74 65 6d 2e 0d 0d 4d  | this.system...M|
000001b0  69 6e 69 6d 75 6d 20 68  61 72 64 77 61 72 65 20  |inimum hardware |
000001c0  72 65 71 75 69 72 65 6d  65 6e 74 73 20 61 72 65  |requirements are|
000001d0  3a 0d 0d 4d 6f 64 65 6c  20 42 20 63 6f 6d 70 75  |:..Model B compu|
000001e0  74 65 72 20 43 61 73 73  65 74 74 65 20 72 65 63  |ter Cassette rec|
000001f0  6f 72 64 65 72 20 42 41  53 49 43 20 28 61 6e 79  |order BASIC (any|
00000200  20 76 65 72 73 69 6f 6e  29 20 41 6e 79 20 77 6f  | version) Any wo|
00000210  72 64 70 72 6f 63 65 73  73 6f 72 2e 0d 0d 57 6f  |rdprocessor...Wo|
00000220  72 6b 69 6e 67 20 66 72  6f 6d 20 63 61 73 73 65  |rking from casse|
00000230  74 74 65 20 77 69 6c 6c  20 62 65 20 76 65 72 79  |tte will be very|
00000240  20 73 6c 6f 77 2c 20 61  6e 64 20 42 41 53 49 43  | slow, and BASIC|
00000250  20 32 20 6f 72 20 6c 61  74 65 72 20 69 73 20 74  | 2 or later is t|
00000260  6f 20 62 65 0d 70 72 65  66 65 72 72 65 64 2e 0d  |o be.preferred..|
00000270  0d 54 68 65 20 41 73 73  65 6d 62 6c 65 72 20 62  |.The Assembler b|
00000280  75 69 6c 74 2d 69 6e 20  74 68 65 20 42 42 43 20  |uilt-in the BBC |
00000290  4d 69 63 72 6f 20 69 73  20 75 6e 64 6f 75 62 74  |Micro is undoubt|
000002a0  65 64 6c 79 20 65 78 63  65 6c 6c 65 6e 74 2c 20  |edly excellent, |
000002b0  62 75 74 20 68 61 73 20  6f 6e 65 0d 6e 6f 74 61  |but has one.nota|
000002c0  62 6c 65 20 66 61 69 6c  69 6e 67 2e 20 54 68 69  |ble failing. Thi|
000002d0  73 20 69 73 20 74 68 65  20 66 61 63 74 20 74 68  |s is the fact th|
000002e0  61 74 20 74 68 65 20 61  73 73 65 6d 62 6c 69 6e  |at the assemblin|
000002f0  67 20 53 6f 75 72 63 65  20 70 72 6f 67 72 61 6d  |g Source program|
00000300  20 68 61 73 0d 74 6f 20  72 65 73 69 64 65 20 69  | has.to reside i|
00000310  6e 20 74 68 65 20 6d 61  63 68 69 6e 65 20 61 6c  |n the machine al|
00000320  6f 6e 67 20 77 69 74 68  20 74 68 65 20 61 73 73  |ong with the ass|
00000330  65 6d 62 6c 65 64 20 4f  62 6a 65 63 74 20 63 6f  |embled Object co|
00000340  64 65 2c 20 6f 66 74 65  6e 20 69 6e 0d 74 68 65  |de, often in.the|
00000350  20 73 61 6d 65 20 61 72  65 61 20 74 68 61 74 20  | same area that |
00000360  74 68 65 20 4f 62 6a 65  63 74 20 63 6f 64 65 20  |the Object code |
00000370  69 73 20 6e 65 65 64 65  20 64 20 74 6f 20 72 75  |is neede d to ru|
00000380  6e 20 66 72 6f 6d 2e 0d  0d 46 72 6f 6d 20 42 41  |n from...From BA|
00000390  53 49 43 20 32 20 6f 6e  77 61 72 64 73 20 74 68  |SIC 2 onwards th|
000003a0  69 73 20 69 73 20 70 61  72 74 6c 79 20 61 6c 6c  |is is partly all|
000003b0  65 76 69 61 74 65 64 20  62 79 20 74 68 65 20 61  |eviated by the a|
000003c0  62 69 6c 69 74 79 20 74  6f 20 75 73 65 0d 6f 66  |bility to use.of|
000003d0  66 73 65 74 20 61 73 73  65 6d 62 6c 79 20 28 4f  |fset assembly (O|
000003e0  50 54 20 34 20 2d 20 37  29 2c 20 68 6f 77 65 76  |PT 4 - 7), howev|
000003f0  65 72 20 74 68 65 20 6d  61 69 6e 20 70 72 6f 62  |er the main prob|
00000400  6c 65 6d 20 73 74 69 6c  6c 20 65 78 69 73 74 73  |lem still exists|
00000410  3b 20 6e 61 6d 65 6c 79  0d 74 68 61 74 20 6f 66  |; namely.that of|
00000420  20 68 61 76 69 6e 67 20  74 68 65 20 53 6f 75 72  | having the Sour|
00000430  63 65 20 63 6f 64 65 20  74 61 6b 69 6e 67 20 75  |ce code taking u|
00000440  70 20 76 61 6c 75 61 62  6c 65 20 73 70 61 63 65  |p valuable space|
00000450  2e 0d 0d 49 66 20 79 6f  75 20 61 72 65 20 73 75  |...If you are su|
00000460  66 66 69 63 69 65 6e 74  6c 79 20 69 6e 76 6f 6c  |fficiently invol|
00000470  76 65 64 20 69 6e 20 61  73 73 65 6d 62 6c 79 20  |ved in assembly |
00000480  6c 61 6e 67 75 61 67 65  20 70 72 6f 67 72 61 6d  |language program|
00000490  6d 69 6e 67 20 74 68 65  6e 20 79 6f 75 0d 6d 61  |ming then you.ma|
000004a0  79 20 66 65 65 6c 20 69  74 20 77 6f 72 74 68 20  |y feel it worth |
000004b0  69 6e 76 65 73 74 69 6e  67 20 69 6e 20 61 20 6d  |investing in a m|
000004c0  6f 72 65 20 73 6f 70 68  69 73 74 69 63 61 74 65  |ore sophisticate|
000004d0  64 20 61 73 73 65 6d 62  6c 65 72 20 52 4f 4d 20  |d assembler ROM |
000004e0  74 68 61 74 20 63 61 6e  0d 61 73 73 65 6d 62 6c  |that can.assembl|
000004f0  65 20 66 72 6f 6d 20 53  6f 75 72 63 65 20 74 65  |e from Source te|
00000500  78 74 20 66 69 6c 65 73  2c 20 73 65 6e 64 69 6e  |xt files, sendin|
00000510  67 20 74 68 65 20 4f 62  6a 65 63 74 20 63 6f 64  |g the Object cod|
00000520  65 20 64 69 72 65 63 74  6c 79 20 74 6f 20 6f 74  |e directly to ot|
00000530  68 65 72 0d 66 69 6c 65  73 2e 20 42 75 74 20 74  |her.files. But t|
00000540  68 65 72 65 20 69 73 20  61 6e 20 61 6c 74 65 72  |here is an alter|
00000550  6e 61 74 69 76 65 20 61  70 70 72 6f 61 63 68 20  |native approach |
00000560  77 68 69 63 68 20 67 6f  65 73 20 61 20 6c 6f 6e  |which goes a lon|
00000570  67 20 77 61 79 20 74 6f  0d 73 6f 6c 76 69 6e 67  |g way to.solving|
00000580  20 74 68 65 20 70 72 6f  62 6c 65 6d 2e 0d 0d 4d  | the problem...M|
00000590  6f 73 74 20 6f 66 20 75  73 20 68 61 76 65 2c 20  |ost of us have, |
000005a0  77 69 74 68 6f 75 74 20  74 68 69 6e 6b 69 6e 67  |without thinking|
000005b0  20 61 62 6f 75 74 20 69  74 2c 20 75 73 65 64 20  | about it, used |
000005c0  74 68 65 20 63 6f 6d 70  75 74 65 72 20 74 6f 20  |the computer to |
000005d0  70 65 72 66 6f 72 6d 0d  73 69 6d 70 6c 65 20 63  |perform.simple c|
000005e0  61 6c 63 75 6c 61 74 69  6f 6e 73 20 65 6e 74 65  |alculations ente|
000005f0  72 65 64 20 64 69 72 65  63 74 6c 79 20 66 72 6f  |red directly fro|
00000600  6d 20 74 68 65 20 6b 65  79 62 6f 61 72 64 2e 20  |m the keyboard. |
00000610  57 68 61 74 20 69 73 20  6e 6f 74 20 73 6f 0d 6f  |What is not so.o|
00000620  62 76 69 6f 75 73 20 69  73 20 74 68 61 74 20 61  |bvious is that a|
00000630  6c 6d 6f 73 74 20 74 68  65 20 77 68 6f 6c 65 20  |lmost the whole |
00000640  6f 66 20 74 68 65 20 42  41 53 49 43 20 6c 61 6e  |of the BASIC lan|
00000650  67 75 61 67 65 20 73 74  72 75 63 74 75 72 65 20  |guage structure |
00000660  69 73 0d 61 76 61 69 6c  61 62 6c 65 20 66 72 6f  |is.available fro|
00000670  6d 20 74 68 65 20 6b 65  79 62 6f 61 72 64 2e 20  |m the keyboard. |
00000680  54 68 69 73 20 69 6e 63  6c 75 64 65 73 20 74 68  |This includes th|
00000690  65 20 61 73 73 65 6d 62  6c 65 72 2e 20 54 72 79  |e assembler. Try|
000006a0  20 74 68 65 0d 66 6f 6c  6c 6f 77 69 6e 67 3a 0d  | the.following:.|
000006b0  0d 3e 50 25 3d 26 43 30  30 0d 3e 5b 4f 50 54 20  |.>P%=&C00.>[OPT |
000006c0  32 3a 4c 44 41 20 23 41  53 43 22 41 22 3a 4a 53  |2:LDA #ASC"A":JS|
000006d0  52 20 26 46 46 45 45 3a  52 54 53 0d 3e 43 41 4c  |R &FFEE:RTS.>CAL|
000006e0  4c 20 26 43 30 30 0d 0d  59 6f 75 20 73 68 6f 75  |L &C00..You shou|
000006f0  6c 64 20 66 69 6e 64 20  74 68 61 74 20 74 68 65  |ld find that the|
00000700  20 63 6f 6d 70 75 74 65  72 20 77 69 6c 6c 20 70  | computer will p|
00000710  72 69 6e 74 20 74 68 65  20 6c 65 74 74 65 72 20  |rint the letter |
00000720  27 41 27 2e 20 4e 6f 74  69 63 65 20 74 68 61 74  |'A'. Notice that|
00000730  0d 74 68 65 20 61 73 73  65 6d 62 6c 69 6e 67 20  |.the assembling |
00000740  6c 69 6e 65 20 6d 75 73  74 20 73 74 61 72 74 20  |line must start |
00000750  77 69 74 68 20 5b 4f 50  54 20 61 6e 64 20 61 6c  |with [OPT and al|
00000760  6c 20 74 68 65 20 73 74  61 74 65 6d 65 6e 74 73  |l the statements|
00000770  20 61 72 65 20 6f 6e 0d  74 68 61 74 20 6c 69 6e  | are on.that lin|
00000780  65 2e 20 54 68 65 72 65  20 69 73 20 6e 6f 20 6e  |e. There is no n|
00000790  65 65 64 20 66 6f 72 20  74 68 65 20 63 6c 6f 73  |eed for the clos|
000007a0  69 6e 67 20 5d 20 61 73  20 74 68 65 20 61 73 73  |ing ] as the ass|
000007b0  65 6d 62 6c 65 72 20 69  73 0d 61 75 74 6f 6d 61  |embler is.automa|
000007c0  74 69 63 61 6c 6c 79 20  73 77 69 74 63 68 65 64  |tically switched|
000007d0  20 6f 66 66 20 61 74 20  74 68 65 20 65 6e 64 20  | off at the end |
000007e0  6f 66 20 74 68 65 20 6c  69 6e 65 2e 0d 0d 54 68  |of the line...Th|
000007f0  69 73 20 63 61 6e 20 62  65 20 65 78 70 61 6e 64  |is can be expand|
00000800  65 64 20 75 73 69 6e 67  20 6c 61 62 65 6c 73 20  |ed using labels |
00000810  61 6e 64 20 76 61 72 69  61 62 6c 65 73 2c 20 61  |and variables, a|
00000820  6e 64 20 73 70 72 65 61  64 20 6f 76 65 72 20 73  |nd spread over s|
00000830  65 76 65 72 61 6c 0d 6c  69 6e 65 73 20 73 6f 3a  |everal.lines so:|
00000840  0d 0d 3e 4e 45 57 0d 3e  62 61 73 65 3d 26 43 30  |..>NEW.>base=&C0|
00000850  30 0d 3e 6f 73 77 72 63  68 3d 26 46 46 45 45 0d  |0.>oswrch=&FFEE.|
00000860  3e 50 25 3d 62 61 73 65  0d 3e 5b 4f 50 54 20 32  |>P%=base.>[OPT 2|
00000870  3a 4c 44 58 20 23 26 30  41 0d 3e 5b 4f 50 54 20  |:LDX #&0A.>[OPT |
00000880  32 3a 2e 6c 61 62 65 6c  0d 3e 5b 4f 50 54 20 32  |2:.label.>[OPT 2|
00000890  3a 4c 44 41 20 23 41 53  43 22 41 22 0d 3e 5b 4f  |:LDA #ASC"A".>[O|
000008a0  50 54 20 32 3a 4a 53 52  20 6f 73 77 72 63 68 0d  |PT 2:JSR oswrch.|
000008b0  3e 5b 4f 50 54 20 32 3a  44 45 58 0d 3e 5b 4f 50  |>[OPT 2:DEX.>[OP|
000008c0  54 20 32 3a 42 4e 45 20  6c 61 62 65 6c 0d 3e 5b  |T 2:BNE label.>[|
000008d0  4f 50 54 20 32 3a 52 54  53 0d 3e 43 41 4c 4c 20  |OPT 2:RTS.>CALL |
000008e0  62 61 73 65 0d 0d 41 6c  6c 20 6f 66 20 74 68 61  |base..All of tha|
000008f0  74 20 69 73 20 61 20 72  61 74 68 65 72 20 63 6f  |t is a rather co|
00000900  6e 74 72 69 76 65 64 20  77 61 79 20 6f 66 20 73  |ntrived way of s|
00000910  65 6e 64 69 6e 67 20 31  30 20 27 41 27 73 20 74  |ending 10 'A's t|
00000920  6f 20 74 68 65 20 73 63  72 65 65 6e 2e 0d 59 6f  |o the screen..Yo|
00000930  75 20 63 6f 75 6c 64 20  62 65 20 66 6f 72 67 69  |u could be forgi|
00000940  76 65 6e 20 66 6f 72 20  74 68 69 6e 6b 69 6e 67  |ven for thinking|
00000950  20 74 68 61 74 20 74 68  69 73 20 69 73 20 61 6e  | that this is an|
00000960  20 75 6e 62 65 6c 69 65  76 61 62 6c 79 20 74 65  | unbelievably te|
00000970  64 69 6f 75 73 0d 77 61  79 20 6f 66 20 61 73 73  |dious.way of ass|
00000980  65 6d 62 6c 69 6e 67 20  63 6f 64 65 2c 20 70 61  |embling code, pa|
00000990  72 74 69 63 75 6c 61 72  6c 79 20 61 73 20 74 68  |rticularly as th|
000009a0  65 20 69 64 65 61 20 69  73 20 74 6f 20 61 73 73  |e idea is to ass|
000009b0  65 6d 62 6c 65 20 76 65  72 79 20 6c 61 72 67 65  |emble very large|
000009c0  0d 61 6d 6f 75 6e 74 73  21 0d 0d 46 6f 72 74 75  |.amounts!..Fortu|
000009d0  6e 61 74 65 6c 79 20 74  68 65 72 65 20 69 73 20  |nately there is |
000009e0  61 20 77 61 79 20 6f 66  20 66 6f 6f 6c 69 6e 67  |a way of fooling|
000009f0  20 74 68 65 20 63 6f 6d  70 75 74 65 72 20 69 6e  | the computer in|
00000a00  74 6f 20 74 68 69 6e 6b  69 6e 67 20 74 68 61 74  |to thinking that|
00000a10  20 69 74 0d 69 73 20 72  65 63 65 69 76 69 6e 67  | it.is receiving|
00000a20  20 6b 65 79 62 6f 61 72  64 20 65 6e 74 72 79 2e  | keyboard entry.|
00000a30  20 54 68 69 73 20 69 73  20 64 6f 6e 65 20 62 79  | This is done by|
00000a40  20 75 73 69 6e 67 20 27  2a 45 58 45 43 20 3c 66  | using '*EXEC <f|
00000a50  69 6c 65 3e 27 2e 20 57  68 61 74 20 69 73 0d 6e  |ile>'. What is.n|
00000a60  65 65 64 65 64 20 69 73  20 61 20 77 6f 72 64 70  |eeded is a wordp|
00000a70  72 6f 63 65 73 73 6f 72  20 74 68 61 74 20 63 61  |rocessor that ca|
00000a80  6e 20 70 72 6f 64 75 63  65 20 75 6e 66 6f 72 6d  |n produce unform|
00000a90  61 74 74 65 64 20 72 61  77 20 74 65 78 74 20 77  |atted raw text w|
00000aa0  69 74 68 20 6e 6f 0d 61  64 64 65 64 20 63 6f 6e  |ith no.added con|
00000ab0  74 72 6f 6c 20 63 6f 64  65 73 20 6f 72 20 28 74  |trol codes or (t|
00000ac0  69 6d 65 20 77 61 73 74  69 6e 67 29 20 70 61 64  |ime wasting) pad|
00000ad0  64 69 6e 67 20 73 70 61  63 65 73 2e 20 57 6f 72  |ding spaces. Wor|
00000ae0  64 77 69 73 65 20 69 73  20 69 64 65 61 6c 0d 66  |dwise is ideal.f|
00000af0  6f 72 20 74 68 69 73 20  6f 72 2c 20 69 66 20 79  |or this or, if y|
00000b00  6f 75 20 68 61 76 65 20  74 68 65 20 4d 41 53 54  |ou have the MAST|
00000b10  45 52 20 73 65 72 69 65  73 2c 20 74 68 65 20 74  |ER series, the t|
00000b20  65 78 74 20 65 64 69 74  6f 72 2e 20 56 69 65 77  |ext editor. View|
00000b30  2c 20 61 6e 64 0d 6f 74  68 65 72 20 77 6f 72 64  |, and.other word|
00000b40  70 72 6f 63 65 73 73 6f  72 73 20 63 61 6e 20 62  |processors can b|
00000b50  65 20 75 73 65 64 20 69  66 20 74 68 65 20 66 69  |e used if the fi|
00000b60  6c 65 20 69 73 20 73 61  76 65 64 20 77 69 74 68  |le is saved with|
00000b70  20 74 68 65 20 27 57 72  69 74 65 0d 54 65 78 74  | the 'Write.Text|
00000b80  27 20 6f 70 74 69 6f 6e  2e 0d 0d 49 66 20 74 68  |' option...If th|
00000b90  65 20 70 72 65 76 69 6f  75 73 20 6c 69 6e 65 73  |e previous lines|
00000ba0  20 61 72 65 20 74 79 70  65 64 20 69 6e 20 61 6e  | are typed in an|
00000bb0  64 20 73 61 76 65 64 20  74 6f 20 61 20 66 69 6c  |d saved to a fil|
00000bc0  65 20 6e 61 6d 65 64 20  28 73 61 79 29 0d 27 73  |e named (say).'s|
00000bd0  6f 75 72 63 65 27 2c 20  74 68 65 6e 20 61 6c 6c  |ource', then all|
00000be0  20 79 6f 75 20 6e 65 65  64 20 74 6f 20 64 6f 20  | you need to do |
00000bf0  77 68 65 6e 20 79 6f 75  20 77 61 6e 74 20 74 6f  |when you want to|
00000c00  20 61 73 73 65 6d 62 6c  65 20 74 68 65 20 63 6f  | assemble the co|
00000c10  64 65 20 69 73 20 74 6f  0d 74 79 70 65 20 27 2a  |de is to.type '*|
00000c20  45 58 45 43 20 73 6f 75  72 63 65 27 2e 20 4e 6f  |EXEC source'. No|
00000c30  74 65 20 74 68 61 74 20  74 68 65 20 76 61 72 69  |te that the vari|
00000c40  61 62 6c 65 2f 6c 61 62  65 6c 20 73 74 61 63 6b  |able/label stack|
00000c50  20 77 69 6c 6c 20 73 74  61 72 74 20 61 74 0d 4c  | will start at.L|
00000c60  4f 4d 45 4d 20 77 68 69  63 68 20 77 69 6c 6c 20  |OMEM which will |
00000c70  62 65 20 50 41 47 45 2b  32 20 73 6f 20 69 66 20  |be PAGE+2 so if |
00000c80  79 6f 75 20 77 61 6e 74  20 63 6f 64 65 20 74 6f  |you want code to|
00000c90  20 62 65 20 61 73 73 65  6d 62 6c 65 64 20 68 65  | be assembled he|
00000ca0  72 65 20 74 68 65 6e 0d  79 6f 75 20 6d 75 73 74  |re then.you must|
00000cb0  20 65 69 74 68 65 72 20  6d 6f 76 65 20 4c 4f 4d  | either move LOM|
00000cc0  45 4d 20 6f 72 20 75 73  65 20 6f 66 66 73 65 74  |EM or use offset|
00000cd0  20 61 73 73 65 6d 62 6c  79 20 61 6e 64 20 73 61  | assembly and sa|
00000ce0  76 65 20 61 6e 64 20 72  65 2d 6c 6f 61 64 20 74  |ve and re-load t|
00000cf0  68 65 0d 4f 62 6a 65 63  74 20 63 6f 64 65 2e 0d  |he.Object code..|
00000d00  0d 49 66 2c 20 66 6f 72  20 65 78 61 6d 70 6c 65  |.If, for example|
00000d10  2c 20 79 6f 75 20 77 61  6e 74 20 74 6f 20 61 73  |, you want to as|
00000d20  73 65 6d 62 6c 65 20 79  6f 75 72 20 62 72 69 6c  |semble your bril|
00000d30  6c 69 61 6e 74 20 6e 65  77 20 67 61 6d 65 20 61  |liant new game a|
00000d40  74 20 26 31 39 30 30 20  61 6e 64 0d 79 6f 75 20  |t &1900 and.you |
00000d50  65 78 70 65 63 74 20 74  68 65 20 63 6f 64 65 20  |expect the code |
00000d60  74 6f 20 62 65 20 6c 65  73 73 20 74 68 61 6e 20  |to be less than |
00000d70  38 6b 2c 20 63 6f 6e 73  74 72 75 63 74 20 74 68  |8k, construct th|
00000d80  65 20 66 69 6c 65 20 27  73 6f 75 72 63 65 27 20  |e file 'source' |
00000d90  61 73 0d 62 65 6c 6f 77  2e 0d 0d 4e 45 57 3a 4c  |as.below...NEW:L|
00000da0  4f 4d 45 4d 3d 26 33 39  30 30 3a 62 61 73 65 3d  |OMEM=&3900:base=|
00000db0  26 31 39 30 30 3a 50 25  3d 62 61 73 65 20 28 43  |&1900:P%=base (C|
00000dc0  52 29 20 5b 4f 50 54 20  32 3a 20 7b 63 6f 64 65  |R) [OPT 2: {code|
00000dd0  7d 20 28 43 52 29 20 5b  4f 50 54 20 32 3a 20 7b  |} (CR) [OPT 2: {|
00000de0  63 6f 64 65 7d 0d 28 43  52 29 20 65 74 63 2e 0d  |code}.(CR) etc..|
00000df0  0d 49 74 20 73 68 6f 75  6c 64 20 62 65 20 6e 6f  |.It should be no|
00000e00  74 65 64 20 74 68 61 74  20 74 68 65 20 6c 69 6e  |ted that the lin|
00000e10  65 73 20 6f 66 20 63 6f  64 65 20 6d 75 73 74 20  |es of code must |
00000e20  6e 6f 74 20 65 78 63 65  65 64 20 32 35 35 20 63  |not exceed 255 c|
00000e30  68 61 72 61 63 74 65 72  73 0d 28 61 62 6f 75 74  |haracters.(about|
00000e40  20 36 20 6c 69 6e 65 73  20 6f 66 20 34 30 20 63  | 6 lines of 40 c|
00000e50  6f 6c 75 6d 6e 20 74 65  78 74 29 20 61 6e 64 20  |olumn text) and |
00000e60  66 6f 72 20 73 61 66 65  74 79 20 49 20 75 73 75  |for safety I usu|
00000e70  61 6c 6c 79 20 73 74 69  63 6b 20 74 6f 20 61 62  |ally stick to ab|
00000e80  6f 75 74 0d 68 61 6c 66  20 6f 66 20 74 68 61 74  |out.half of that|
00000e90  2e 20 54 68 65 20 66 65  77 65 72 20 6c 69 6e 65  |. The fewer line|
00000ea0  73 20 79 6f 75 20 68 61  76 65 20 74 68 65 20 66  |s you have the f|
00000eb0  61 73 74 65 72 20 74 68  65 20 63 6f 64 65 20 61  |aster the code a|
00000ec0  73 73 65 6d 62 6c 65 73  20 62 75 74 0d 79 6f 75  |ssembles but.you|
00000ed0  20 67 61 69 6e 20 6e 6f  74 68 69 6e 67 20 6d 65  | gain nothing me|
00000ee0  6d 6f 72 79 2d 77 69 73  65 20 61 73 20 74 68 65  |mory-wise as the|
00000ef0  20 73 6f 75 72 63 65 20  63 6f 64 65 20 65 78 69  | source code exi|
00000f00  73 74 73 20 69 6e 20 66  69 6c 65 20 66 6f 72 6d  |sts in file form|
00000f10  2e 20 41 6c 73 6f 0d 4c  4f 4d 45 4d 20 6d 75 73  |. Also.LOMEM mus|
00000f20  74 20 62 65 20 73 65 74  20 62 65 66 6f 72 65 20  |t be set before |
00000f30  61 6e 79 20 76 61 72 69  61 62 6c 65 73 20 61 72  |any variables ar|
00000f40  65 20 75 73 65 64 2c 20  6f 74 68 65 72 77 69 73  |e used, otherwis|
00000f50  65 20 79 6f 75 27 6c 6c  20 6c 6f 73 65 0d 74 68  |e you'll lose.th|
00000f60  65 6d 20 61 67 61 69 6e  21 0d 0d 41 6e 20 61 73  |em again!..An as|
00000f70  74 75 74 65 20 72 65 61  64 65 72 20 77 69 6c 6c  |tute reader will|
00000f80  20 68 61 76 65 20 6e 6f  74 69 63 65 64 20 74 68  | have noticed th|
00000f90  61 74 20 49 20 68 61 76  65 20 6f 6e 6c 79 20 75  |at I have only u|
00000fa0  73 65 64 20 4f 50 54 20  32 2c 20 77 68 65 72 65  |sed OPT 2, where|
00000fb0  61 73 0d 75 73 75 61 6c  6c 79 20 6f 6e 65 20 6e  |as.usually one n|
00000fc0  65 65 64 73 20 74 6f 20  75 73 65 20 74 77 6f 20  |eeds to use two |
00000fd0  70 61 73 73 20 61 73 73  65 6d 62 6c 79 20 77 69  |pass assembly wi|
00000fe0  74 68 69 6e 20 61 20 46  4f 52 2d 4e 45 58 54 20  |thin a FOR-NEXT |
00000ff0  6c 6f 6f 70 2c 20 74 68  65 20 46 4f 52 0d 76 61  |loop, the FOR.va|
00001000  72 69 61 62 6c 65 20 62  65 69 6e 67 20 75 73 65  |riable being use|
00001010  64 20 74 6f 20 73 65 74  20 4f 50 54 2e 20 57 68  |d to set OPT. Wh|
00001020  65 6e 20 61 73 73 65 6d  62 6c 69 6e 67 20 66 72  |en assembling fr|
00001030  6f 6d 20 74 68 65 20 6b  65 79 62 6f 61 72 64 20  |om the keyboard |
00001040  6f 72 20 66 72 6f 6d 0d  61 6e 20 45 58 45 43 20  |or from.an EXEC |
00001050  66 69 6c 65 2c 20 6f 6e  6c 79 20 74 68 65 20 63  |file, only the c|
00001060  75 72 72 65 6e 74 20 6c  69 6e 65 20 65 78 69 73  |urrent line exis|
00001070  74 73 20 69 6e 20 74 68  65 20 63 6f 6d 70 75 74  |ts in the comput|
00001080  65 72 27 73 20 6d 65 6d  6f 72 79 20 28 61 74 0d  |er's memory (at.|
00001090  26 37 30 30 20 61 63 74  75 61 6c 6c 79 29 2c 20  |&700 actually), |
000010a0  73 6f 20 46 4f 52 2d 4e  45 58 54 20 61 6e 64 20  |so FOR-NEXT and |
000010b0  52 45 50 45 41 54 2d 55  4e 54 49 4c 20 63 6f 6e  |REPEAT-UNTIL con|
000010c0  73 74 72 75 63 74 73 20  63 61 6e 20 6f 6e 6c 79  |structs can only|
000010d0  20 62 65 20 6d 61 64 65  0d 74 6f 20 6f 70 65 72  | be made.to oper|
000010e0  61 74 65 20 6f 76 65 72  20 74 68 69 73 20 6c 69  |ate over this li|
000010f0  6e 65 2c 20 77 68 69 63  68 20 63 61 6e 27 74 20  |ne, which can't |
00001100  62 65 20 6d 6f 72 65 20  74 68 61 6e 20 32 35 35  |be more than 255|
00001110  20 62 79 74 65 73 20 6c  6f 6e 67 2e 0d 0d 54 68  | bytes long...Th|
00001120  65 20 73 6f 6c 75 74 69  6f 6e 20 69 73 20 74 6f  |e solution is to|
00001130  20 75 73 65 20 27 2a 45  58 45 43 20 73 6f 75 72  | use '*EXEC sour|
00001140  63 65 27 20 74 77 69 63  65 2c 20 61 64 6a 75 73  |ce' twice, adjus|
00001150  74 69 6e 67 20 74 68 65  20 4f 50 54 20 76 61 72  |ting the OPT var|
00001160  69 61 62 6c 65 0d 61 63  6f 72 64 69 6e 67 6c 79  |iable.acordingly|
00001170  2e 20 55 73 69 6e 67 20  4f 50 54 73 20 31 2d 33  |. Using OPTs 1-3|
00001180  2c 20 61 6e 64 20 35 2d  37 20 63 61 75 73 65 73  |, and 5-7 causes|
00001190  20 63 6f 6e 66 75 73 69  6f 6e 2e 20 59 6f 75 20  | confusion. You |
000011a0  65 6e 64 20 75 70 20 77  69 74 68 0d 72 65 70 65  |end up with.repe|
000011b0  61 74 65 64 20 6c 69 6e  65 73 20 6f 6e 20 74 68  |ated lines on th|
000011c0  65 20 73 63 72 65 65 6e  2c 20 73 6f 20 73 74 69  |e screen, so sti|
000011d0  63 6b 20 74 6f 20 30 2d  32 2c 20 61 6e 64 20 34  |ck to 0-2, and 4|
000011e0  2d 36 2e 20 41 73 20 79  6f 75 20 64 6f 6e 27 74  |-6. As you don't|
000011f0  20 77 61 6e 74 0d 74 6f  20 72 65 73 65 74 20 74  | want.to reset t|
00001200  68 65 20 77 68 6f 6c 65  20 73 79 73 74 65 6d 20  |he whole system |
00001210  77 69 74 68 20 4e 45 57  20 65 61 63 68 20 70 61  |with NEW each pa|
00001220  73 73 2c 20 79 6f 75 20  61 6c 73 6f 20 6e 65 65  |ss, you also nee|
00001230  64 20 74 6f 20 73 70 6c  69 74 20 74 68 65 0d 66  |d to split the.f|
00001240  69 6c 65 20 69 6e 74 6f  20 74 77 6f 20 70 61 72  |ile into two par|
00001250  74 73 2e 20 43 61 6c 6c  20 74 68 65 6d 20 27 69  |ts. Call them 'i|
00001260  6e 69 74 27 20 61 6e 64  20 27 63 6f 64 65 27 2e  |nit' and 'code'.|
00001270  20 54 61 6b 69 6e 67 20  74 68 69 73 20 6f 6e 65  | Taking this one|
00001280  20 73 74 65 70 0d 66 75  72 74 68 65 72 20 27 63  | step.further 'c|
00001290  6f 64 65 27 20 63 61 6e  20 62 65 20 6d 61 64 65  |ode' can be made|
000012a0  20 74 6f 20 72 65 2d 72  75 6e 20 69 74 73 65 6c  | to re-run itsel|
000012b0  66 20 73 6f 3a 0d 0d 0d  20 20 27 69 6e 69 74 27  |f so:...  'init'|
000012c0  20 66 69 6c 65 20 3a 0d  0d 4e 45 57 20 28 43 52  | file :..NEW (CR|
000012d0  29 0d 4c 4f 4d 45 4d 3d  26 33 39 30 30 20 28 43  |).LOMEM=&3900 (C|
000012e0  52 29 0d 62 61 73 65 3d  26 31 39 30 30 20 28 43  |R).base=&1900 (C|
000012f0  52 29 0d 7a 65 72 6f 3d  26 37 30 20 28 43 52 29  |R).zero=&70 (CR)|
00001300  0d 6f 73 77 72 63 68 3d  26 46 46 45 45 20 28 43  |.oswrch=&FFEE (C|
00001310  52 29 0d 6f 73 62 79 74  65 3d 26 46 46 46 34 20  |R).osbyte=&FFF4 |
00001320  28 43 52 29 0d 49 25 3d  30 20 28 43 52 29 0d 2a  |(CR).I%=0 (CR).*|
00001330  45 58 45 43 20 63 6f 64  65 20 28 43 52 29 0d 0d  |EXEC code (CR)..|
00001340  20 20 27 63 6f 64 65 27  20 66 69 6c 65 20 3a 0d  |  'code' file :.|
00001350  0d 50 25 3d 62 61 73 65  20 28 43 52 29 0d 5b 4f  |.P%=base (CR).[O|
00001360  50 54 49 25 3a 20 7b 63  6f 64 65 7d 20 28 43 52  |PTI%: {code} (CR|
00001370  29 0d 5b 4f 50 54 49 25  3a 20 7b 63 6f 64 65 7d  |).[OPTI%: {code}|
00001380  20 28 43 52 29 0d 65 74  63 2e 0d 49 46 20 49 25  | (CR).etc..IF I%|
00001390  3d 30 20 54 48 45 4e 20  49 25 3d 32 3a 2a 45 58  |=0 THEN I%=2:*EX|
000013a0  45 43 20 63 6f 64 65 20  28 43 52 29 0d 0d 0d 41  |EC code (CR)...A|
000013b0  6c 6c 20 79 6f 75 20 6e  6f 77 20 6e 65 65 64 20  |ll you now need |
000013c0  74 6f 20 64 6f 20 69 73  20 74 6f 20 74 79 70 65  |to do is to type|
000013d0  20 27 2a 45 58 45 43 20  69 6e 69 74 27 2c 20 61  | '*EXEC init', a|
000013e0  6e 64 20 6c 65 74 20 69  74 20 67 65 74 20 6f 6e  |nd let it get on|
000013f0  20 77 69 74 68 20 69 74  2e 0d 4e 6f 74 69 63 65  | with it..Notice|
00001400  20 74 68 61 74 20 61 6c  6c 20 63 6f 6e 73 74 61  | that all consta|
00001410  6e 74 73 20 73 68 6f 75  6c 64 20 62 65 20 73 65  |nts should be se|
00001420  74 20 69 6e 20 27 69 6e  69 74 27 20 69 6e 20 74  |t in 'init' in t|
00001430  68 65 20 73 61 6d 65 20  77 61 79 20 74 68 61 74  |he same way that|
00001440  20 79 6f 75 0d 77 6f 75  6c 64 20 75 73 65 20 61  | you.would use a|
00001450  20 50 52 4f 43 69 6e 69  74 20 69 6e 20 61 20 27  | PROCinit in a '|
00001460  72 65 61 6c 27 20 70 72  6f 67 72 61 6d 2e 20 49  |real' program. I|
00001470  27 76 65 20 73 70 72 65  61 64 20 74 68 65 20 6c  |'ve spread the l|
00001480  69 6e 65 73 20 6f 75 74  20 69 6e 20 74 68 65 0d  |ines out in the.|
00001490  65 78 61 6d 70 6c 65 20  74 6f 20 6d 61 6b 65 20  |example to make |
000014a0  74 68 69 73 20 63 6c 65  61 72 65 72 2e 20 41 6c  |this clearer. Al|
000014b0  73 6f 20 69 6e 20 27 63  6f 64 65 27 20 74 68 65  |so in 'code' the|
000014c0  20 4f 50 54 20 76 61 72  69 61 62 6c 65 20 77 69  | OPT variable wi|
000014d0  6c 6c 20 62 65 0d 65 6e  74 65 72 65 64 20 66 6f  |ll be.entered fo|
000014e0  72 20 65 76 65 72 79 20  6e 65 77 20 6c 69 6e 65  |r every new line|
000014f0  2e 20 55 73 69 6e 67 20  6f 6e 65 20 6f 66 20 74  |. Using one of t|
00001500  68 65 20 72 65 73 69 64  65 6e 74 20 69 6e 74 65  |he resident inte|
00001510  67 65 72 73 20 6d 61 6b  65 73 20 69 74 20 61 0d  |gers makes it a.|
00001520  6c 69 74 74 6c 65 20 63  6c 65 61 72 65 72 20 61  |little clearer a|
00001530  6e 64 20 6c 65 73 73 20  74 65 64 69 6f 75 73 20  |nd less tedious |
00001540  74 6f 20 65 6e 74 65 72  20 74 68 61 6e 20 61 20  |to enter than a |
00001550  72 65 61 6c 20 76 61 72  69 61 62 6c 65 2e 0d 0d  |real variable...|
00001560  49 64 65 61 6c 6c 79 20  79 6f 75 20 77 61 6e 74  |Ideally you want|
00001570  20 74 68 65 20 6c 61 62  65 6c 73 20 61 6e 64 20  | the labels and |
00001580  76 61 72 69 61 62 6c 65  73 20 74 6f 20 74 61 6b  |variables to tak|
00001590  65 20 75 70 20 61 73 20  6c 69 74 74 6c 65 20 72  |e up as little r|
000015a0  6f 6f 6d 20 69 6e 20 74  68 65 0d 76 61 72 69 61  |oom in the.varia|
000015b0  62 6c 65 20 73 74 61 63  6b 20 61 73 20 70 6f 73  |ble stack as pos|
000015c0  73 69 62 6c 65 2c 20 74  68 65 72 65 62 79 20 6d  |sible, thereby m|
000015d0  61 6b 69 6e 67 20 74 68  65 20 6d 61 78 69 6d 75  |aking the maximu|
000015e0  6d 20 70 6f 73 73 69 62  6c 65 20 73 70 61 63 65  |m possible space|
000015f0  0d 61 76 61 69 6c 61 62  6c 65 20 74 6f 20 74 68  |.available to th|
00001600  65 20 61 73 73 65 6d 62  6c 65 64 20 63 6f 64 65  |e assembled code|
00001610  2e 20 55 73 65 20 61 6c  6c 20 74 68 65 20 72 65  |. Use all the re|
00001620  73 69 64 65 6e 74 20 69  6e 74 65 67 65 72 73 20  |sident integers |
00001630  77 68 65 72 65 0d 70 6f  73 73 69 62 6c 65 2e 20  |where.possible. |
00001640  54 68 69 73 20 77 69 6c  6c 20 63 6f 73 74 20 79  |This will cost y|
00001650  6f 75 20 6e 6f 20 6d 65  6d 6f 72 79 20 61 74 20  |ou no memory at |
00001660  61 6c 6c 2e 20 20 50 25  20 28 61 6e 64 20 69 6e  |all.  P% (and in|
00001670  20 74 68 65 20 63 61 73  65 20 6f 66 0d 6f 66 66  | the case of.off|
00001680  73 65 74 20 61 73 73 65  6d 62 6c 79 2c 20 4f 25  |set assembly, O%|
00001690  29 20 61 72 65 20 75 73  65 64 20 62 79 20 74 68  |) are used by th|
000016a0  65 20 61 73 73 65 6d 62  6c 65 72 20 73 6f 20 61  |e assembler so a|
000016b0  72 65 20 6e 6f 74 20 61  76 61 69 6c 61 62 6c 65  |re not available|
000016c0  2e 20 49 0d 73 75 67 67  65 73 74 20 79 6f 75 20  |. I.suggest you |
000016d0  75 73 65 20 49 25 20 66  6f 72 20 74 68 65 20 4f  |use I% for the O|
000016e0  50 54 20 76 61 72 69 61  62 6c 65 2e 20 46 6f 72  |PT variable. For|
000016f0  20 6f 74 68 65 72 20 76  61 72 69 61 62 6c 65 73  | other variables|
00001700  20 75 73 65 20 6d 69 6e  69 6d 75 6d 0d 70 6f 73  | use minimum.pos|
00001710  73 69 62 6c 65 20 61 62  62 72 65 76 69 61 74 69  |sible abbreviati|
00001720  6f 6e 73 20 61 6e 64 20  72 65 61 6c 20 76 61 72  |ons and real var|
00001730  69 61 62 6c 65 73 20 72  61 74 68 65 72 20 74 68  |iables rather th|
00001740  61 6e 20 6e 6f 6e 2d 72  65 73 69 64 65 6e 74 0d  |an non-resident.|
00001750  69 6e 74 65 67 65 72 73  2e 20 54 68 65 20 27 25  |integers. The '%|
00001760  27 20 74 61 6b 65 73 20  61 20 76 61 6c 75 61 62  |' takes a valuab|
00001770  6c 65 20 62 79 74 65 20  6f 75 74 20 6f 66 20 74  |le byte out of t|
00001780  68 65 20 76 61 72 69 61  62 6c 65 20 73 74 61 63  |he variable stac|
00001790  6b 2e 20 41 6c 73 6f 0d  75 73 65 20 6c 6f 74 73  |k. Also.use lots|
000017a0  20 6f 66 20 52 45 4d 73  20 61 6e 64 20 62 6c 61  | of REMs and bla|
000017b0  6e 6b 20 6c 69 6e 65 73  20 66 6f 72 20 63 6c 61  |nk lines for cla|
000017c0  72 69 74 79 2e 20 54 68  65 79 20 75 73 65 20 75  |rity. They use u|
000017d0  70 20 6e 6f 20 6d 65 6d  6f 72 79 20 61 74 0d 61  |p no memory at.a|
000017e0  6c 6c 2e 20 54 68 65 20  61 73 73 65 6d 62 6c 65  |ll. The assemble|
000017f0  72 20 64 72 6f 70 73 20  6f 75 74 20 65 76 65 72  |r drops out ever|
00001800  79 20 6c 69 6e 65 20 73  6f 20 52 45 4d 73 20 61  |y line so REMs a|
00001810  72 65 20 71 75 69 74 65  20 70 6f 73 73 69 62 6c  |re quite possibl|
00001820  65 2c 20 61 6e 64 20 69  6e 0d 66 61 63 74 20 63  |e, and in.fact c|
00001830  6c 65 61 72 65 72 20 74  68 61 6e 20 63 6f 6d 6d  |learer than comm|
00001840  65 6e 74 73 2e 20 50 75  72 69 73 74 73 20 77 69  |ents. Purists wi|
00001850  6c 6c 20 68 61 74 65 20  6d 65 20 66 6f 72 20 73  |ll hate me for s|
00001860  61 79 69 6e 67 20 74 68  69 73 2c 20 62 75 74 0d  |aying this, but.|
00001870  64 6f 6e 27 74 20 75 73  65 20 75 6e 6e 65 63 65  |don't use unnece|
00001880  73 73 61 72 79 20 76 61  72 69 61 62 6c 65 73 2e  |ssary variables.|
00001890  20 55 73 65 20 74 68 65  20 61 63 74 75 61 6c 20  | Use the actual |
000018a0  61 64 64 72 65 73 73 65  73 20 66 6f 72 20 4f 53  |addresses for OS|
000018b0  20 63 61 6c 6c 73 0d 65  74 63 2e 2c 20 61 73 20  | calls.etc., as |
000018c0  62 65 6c 6f 77 3a 0d 0d  0d 52 45 4d 20 74 68 69  |below:...REM thi|
000018d0  73 20 69 73 20 61 6e 20  41 20 77 72 69 74 65 72  |s is an A writer|
000018e0  20 28 43 52 29 0d 20 28  43 52 29 0d 5b 4f 50 54  | (CR). (CR).[OPT|
000018f0  49 25 3a 2e 61 31 3a 4c  44 41 20 23 41 53 43 22  |I%:.a1:LDA #ASC"|
00001900  41 22 3a 4c 44 58 20 23  26 30 41 20 28 43 52 29  |A":LDX #&0A (CR)|
00001910  0d 20 28 43 52 29 0d 52  45 4d 20 6c 6f 6f 70 20  |. (CR).REM loop |
00001920  74 6f 20 68 65 72 65 20  66 6f 72 20 6d 6f 72 65  |to here for more|
00001930  20 41 27 73 20 28 43 52  29 0d 20 28 43 52 29 0d  | A's (CR). (CR).|
00001940  5b 4f 50 54 49 25 3a 2e  61 32 3a 4a 53 52 20 26  |[OPTI%:.a2:JSR &|
00001950  46 46 45 45 3a 44 45 58  3a 42 4e 45 20 61 32 20  |FFEE:DEX:BNE a2 |
00001960  28 43 52 29 0d 20 28 43  52 29 0d 52 45 4d 20 6e  |(CR). (CR).REM n|
00001970  6f 20 6d 6f 72 65 20 41  27 73 20 73 6f 20 65 78  |o more A's so ex|
00001980  69 74 20 28 43 52 29 0d  20 28 43 52 29 0d 5b 4f  |it (CR). (CR).[O|
00001990  50 54 49 25 3a 52 54 53  20 28 43 52 29 0d 0d 41  |PTI%:RTS (CR)..A|
000019a0  20 6c 6f 74 20 6f 66 20  70 65 6f 70 6c 65 20 66  | lot of people f|
000019b0  6f 6c 6c 6f 77 20 6c 61  62 65 6c 73 20 77 69 74  |ollow labels wit|
000019c0  68 20 61 20 73 70 61 63  65 20 72 61 74 68 65 72  |h a space rather|
000019d0  20 74 68 61 6e 20 61 20  63 6f 6c 6f 6e 2e 20 49  | than a colon. I|
000019e0  20 73 74 72 6f 6e 67 6c  79 0d 61 64 76 69 73 65  | strongly.advise|
000019f0  20 79 6f 75 20 6e 6f 74  20 74 6f 2c 20 77 68 65  | you not to, whe|
00001a00  6e 20 75 73 69 6e 67 20  74 68 69 73 20 6d 65 74  |n using this met|
00001a10  68 6f 64 20 6f 66 20 61  73 73 65 6d 62 6c 79 2e  |hod of assembly.|
00001a20  20 20 46 72 6f 6d 20 65  78 70 65 72 69 65 6e 63  |  From experienc|
00001a30  65 20 49 0d 6b 6e 6f 77  20 69 74 20 69 73 20 76  |e I.know it is v|
00001a40  65 72 79 20 65 61 73 79  20 74 6f 20 61 63 63 69  |ery easy to acci|
00001a50  64 65 6e 74 61 6c 6c 79  20 72 65 6d 6f 76 65 20  |dentally remove |
00001a60  73 70 61 63 65 73 20 66  72 6f 6d 20 61 20 74 65  |spaces from a te|
00001a70  78 74 20 66 69 6c 65 20  77 68 69 6c 73 74 0d 74  |xt file whilst.t|
00001a80  69 64 79 69 6e 67 20 75  70 2e 20 54 65 64 69 6f  |idying up. Tedio|
00001a90  75 73 20 77 68 65 6e 20  74 68 65 20 65 72 72 6f  |us when the erro|
00001aa0  72 20 77 6f 6e 20 27 74  20 62 65 20 72 65 70 6f  |r won 't be repo|
00001ab0  72 74 65 64 20 75 6e 74  69 6c 20 74 68 65 20 73  |rted until the s|
00001ac0  65 63 6f 6e 64 0d 70 61  73 73 21 0d 0d 4f 6e 65  |econd.pass!..One|
00001ad0  20 70 72 6f 62 6c 65 6d  20 74 68 61 74 20 69 73  | problem that is|
00001ae0  6e 27 74 20 6f 62 76 69  6f 75 73 20 68 65 72 65  |n't obvious here|
00001af0  20 69 73 20 74 68 65 20  63 6f 6d 70 75 74 65 72  | is the computer|
00001b00  27 73 20 72 65 73 70 6f  6e 73 65 20 74 6f 20 65  |'s response to e|
00001b10  72 72 6f 72 73 2e 0d 54  68 65 73 65 20 77 69 6c  |rrors..These wil|
00001b20  6c 20 62 65 20 72 65 70  6f 72 74 65 64 20 69 6e  |l be reported in|
00001b30  20 74 68 65 20 75 73 75  61 6c 20 77 61 79 2c 20  | the usual way, |
00001b40  62 75 74 20 61 73 20 79  6f 75 20 61 72 65 20 61  |but as you are a|
00001b50  73 73 65 6d 62 6c 69 6e  67 20 76 69 61 20 74 68  |ssembling via th|
00001b60  65 0d 27 6b 65 79 62 6f  61 72 64 27 20 74 68 65  |e.'keyboard' the|
00001b70  72 65 20 69 73 20 6e 6f  20 70 72 6f 67 72 61 6d  |re is no program|
00001b80  20 66 6f 72 20 42 41 53  49 43 27 73 20 65 72 72  | for BASIC's err|
00001b90  6f 72 20 68 61 6e 64 6c  65 72 20 74 6f 20 73 74  |or handler to st|
00001ba0  6f 70 2c 20 73 6f 20 69  74 0d 77 69 6c 6c 20 6b  |op, so it.will k|
00001bb0  65 65 70 20 6f 6e 20 74  72 79 69 6e 67 20 74 6f  |eep on trying to|
00001bc0  20 61 73 73 65 6d 62 6c  65 20 77 69 74 68 20 74  | assemble with t|
00001bd0  68 65 20 65 72 72 6f 72  20 6d 65 73 73 61 67 65  |he error message|
00001be0  20 62 65 69 6e 67 20 73  63 72 6f 6c 6c 65 64 20  | being scrolled |
00001bf0  6f 66 66 0d 74 68 65 20  74 6f 70 20 6f 66 20 74  |off.the top of t|
00001c00  68 65 20 73 63 72 65 65  6e 2e 20 4f 62 76 69 6f  |he screen. Obvio|
00001c10  75 73 6c 79 20 79 6f 75  20 63 61 6e 27 74 20 73  |usly you can't s|
00001c20  69 74 20 67 6c 75 65 64  20 74 6f 20 74 68 65 20  |it glued to the |
00001c30  73 63 72 65 65 6e 0d 77  61 74 63 68 69 6e 67 20  |screen.watching |
00001c40  66 6f 72 20 65 72 72 6f  72 73 20 61 73 20 74 68  |for errors as th|
00001c50  65 79 20 6f 63 63 75 72  2c 20 61 6e 64 20 75 6e  |ey occur, and un|
00001c60  64 65 74 65 63 74 65 64  20 6f 6e 65 73 20 63 61  |detected ones ca|
00001c70  6e 20 62 65 20 65 78 74  72 65 6d 65 6c 79 0d 64  |n be extremely.d|
00001c80  69 66 66 69 63 75 6c 74  20 74 6f 20 69 64 65 6e  |ifficult to iden|
00001c90  74 69 66 79 2c 20 73 6f  20 61 6e 20 65 72 72 6f  |tify, so an erro|
00001ca0  72 20 68 61 6e 64 6c 65  72 20 68 61 73 20 74 6f  |r handler has to|
00001cb0  20 62 65 20 61 64 64 65  64 2e 0d 0d 54 68 65 20  | be added...The |
00001cc0  6c 69 6e 65 73 20 62 65  6c 6f 77 20 73 68 6f 75  |lines below shou|
00001cd0  6c 64 20 62 65 20 70 75  74 20 69 6e 20 61 74 20  |ld be put in at |
00001ce0  74 68 65 20 76 65 72 79  20 73 74 61 72 74 20 6f  |the very start o|
00001cf0  66 20 27 69 6e 69 74 27  20 73 6f 20 74 68 61 74  |f 'init' so that|
00001d00  20 6f 6e 63 65 0d 74 68  65 20 63 6f 64 65 20 72  | once.the code r|
00001d10  75 6e 73 20 27 4e 45 57  27 20 77 69 6c 6c 20 77  |uns 'NEW' will w|
00001d20  69 70 65 20 6f 75 74 20  74 68 65 20 28 6e 6f 20  |ipe out the (no |
00001d30  6c 6f 6e 67 65 72 20 72  65 71 75 69 72 65 64 29  |longer required)|
00001d40  20 76 61 72 69 61 62 6c  65 73 20 75 73 65 64 2e  | variables used.|
00001d50  0d 54 68 65 20 72 6f 75  74 69 6e 65 20 77 6f 72  |.The routine wor|
00001d60  6b 73 20 62 79 20 72 65  64 69 72 65 63 74 69 6e  |ks by redirectin|
00001d70  67 20 42 52 4b 56 2c 20  77 68 65 72 65 20 61 6c  |g BRKV, where al|
00001d80  6c 20 65 72 72 6f 72 73  20 70 61 73 73 2e 20 54  |l errors pass. T|
00001d90  68 65 20 6e 65 77 20 63  6f 64 65 0d 63 6c 6f 73  |he new code.clos|
00001da0  65 73 20 74 68 65 20 63  75 72 72 65 6e 74 20 45  |es the current E|
00001db0  58 45 43 20 66 69 6c 65  2c 20 74 68 65 6e 20 70  |XEC file, then p|
00001dc0  75 74 73 20 42 52 4b 56  20 62 61 63 6b 20 77 68  |uts BRKV back wh|
00001dd0  65 72 65 20 69 74 20 62  65 6c 6f 6e 67 73 2e 20  |ere it belongs. |
00001de0  54 68 65 0d 72 65 73 75  6c 74 20 69 73 20 74 68  |The.result is th|
00001df0  61 74 20 79 6f 75 20 73  65 65 20 74 68 65 20 65  |at you see the e|
00001e00  72 72 6f 72 20 6d 65 73  73 61 67 65 20 61 74 20  |rror message at |
00001e10  74 68 65 20 62 6f 74 74  6f 6d 20 6f 66 20 74 68  |the bottom of th|
00001e20  65 20 73 63 72 65 65 6e  2e 20 59 6f 75 0d 74 68  |e screen. You.th|
00001e30  65 6e 20 6b 6e 6f 77 20  74 68 61 74 20 74 68 65  |en know that the|
00001e40  20 6c 69 6e 65 20 61 62  6f 76 65 20 69 73 20 74  | line above is t|
00001e50  68 65 20 6f 6e 65 20 63  6f 6e 74 61 69 6e 69 6e  |he one containin|
00001e60  67 20 74 68 65 20 65 72  72 6f 72 2e 0d 0d 0d 4c  |g the error....L|
00001e70  4f 4d 45 4d 3d 26 37 30  30 30 3a 62 72 6b 76 3d  |OMEM=&7000:brkv=|
00001e80  26 32 30 32 3a 50 25 3d  26 43 30 30 20 28 43 52  |&202:P%=&C00 (CR|
00001e90  29 0d 20 28 43 52 29 0d  5b 4f 50 54 32 3a 2e 73  |). (CR).[OPT2:.s|
00001ea0  74 6f 72 65 3a 45 51 55  57 20 26 46 46 46 46 20  |tore:EQUW &FFFF |
00001eb0  28 43 52 29 0d 20 28 43  52 29 0d 5b 4f 50 54 32  |(CR). (CR).[OPT2|
00001ec0  3a 2e 65 72 72 3a 50 48  50 3a 50 48 41 3a 54 58  |:.err:PHP:PHA:TX|
00001ed0  41 3a 50 48 41 3a 54 59  41 3a 50 48 41 20 28 43  |A:PHA:TYA:PHA (C|
00001ee0  52 29 0d 5b 4f 50 54 32  3a 4c 44 41 20 23 26 37  |R).[OPT2:LDA #&7|
00001ef0  37 3a 4a 53 52 20 26 46  46 46 34 20 28 43 52 29  |7:JSR &FFF4 (CR)|
00001f00  0d 5b 4f 50 54 32 3a 53  45 49 3a 4c 44 41 20 73  |.[OPT2:SEI:LDA s|
00001f10  74 6f 72 65 3a 53 54 41  20 62 72 6b 76 20 28 43  |tore:STA brkv (C|
00001f20  52 29 0d 5b 4f 50 54 32  3a 4c 44 41 20 73 74 6f  |R).[OPT2:LDA sto|
00001f30  72 65 2b 31 3a 53 54 41  20 62 72 6b 76 2b 31 3a  |re+1:STA brkv+1:|
00001f40  43 4c 49 20 28 43 52 29  0d 5b 4f 50 54 32 3a 50  |CLI (CR).[OPT2:P|
00001f50  4c 41 3a 54 41 59 3a 50  4c 41 3a 54 41 58 3a 50  |LA:TAY:PLA:TAX:P|
00001f60  4c 41 3a 50 4c 50 3a 4a  4d 50 28 62 72 6b 76 29  |LA:PLP:JMP(brkv)|
00001f70  20 28 43 52 29 0d 20 28  43 52 29 0d 5b 4f 50 54  | (CR). (CR).[OPT|
00001f80  32 3a 2e 73 65 74 3a 53  45 49 20 28 43 52 29 0d  |2:.set:SEI (CR).|
00001f90  5b 4f 50 54 32 3a 4c 44  41 20 62 72 6b 76 3a 53  |[OPT2:LDA brkv:S|
00001fa0  54 41 20 73 74 6f 72 65  20 28 43 52 29 0d 5b 4f  |TA store (CR).[O|
00001fb0  50 54 32 3a 4c 44 41 20  62 72 6b 76 2b 31 3a 53  |PT2:LDA brkv+1:S|
00001fc0  54 41 20 73 74 6f 72 65  2b 31 20 28 43 52 29 0d  |TA store+1 (CR).|
00001fd0  5b 4f 50 54 32 3a 4c 44  41 20 23 65 72 72 20 4d  |[OPT2:LDA #err M|
00001fe0  4f 44 32 35 36 3a 53 54  41 20 62 72 6b 76 20 28  |OD256:STA brkv (|
00001ff0  43 52 29 0d 5b 4f 50 54  32 3a 4c 44 41 20 23 65  |CR).[OPT2:LDA #e|
00002000  72 72 20 44 49 56 32 35  36 3a 53 54 41 20 62 72  |rr DIV256:STA br|
00002010  6b 76 2b 31 20 28 43 52  29 0d 5b 4f 50 54 32 3a  |kv+1 (CR).[OPT2:|
00002020  43 4c 49 3a 52 54 53 20  28 43 52 29 0d 20 28 43  |CLI:RTS (CR). (C|
00002030  52 29 0d 43 41 4c 4c 20  73 65 74 20 28 43 52 29  |R).CALL set (CR)|
00002040  0d 0d 42 65 20 76 65 72  79 20 63 61 72 65 66 75  |..Be very carefu|
00002050  6c 20 74 6f 20 65 6e 73  75 72 65 20 74 68 61 74  |l to ensure that|
00002060  20 74 68 69 73 20 62 69  74 20 6f 66 20 63 6f 64  | this bit of cod|
00002070  65 20 64 6f 65 73 6e 27  74 20 69 74 73 65 6c 66  |e doesn't itself|
00002080  20 63 6f 6e 74 61 69 6e  0d 65 72 72 6f 72 73 2e  | contain.errors.|
00002090  20 49 27 76 65 20 75 73  65 64 20 26 43 30 30 20  | I've used &C00 |
000020a0  66 6f 72 20 74 68 65 20  65 72 72 6f 72 20 63 6f  |for the error co|
000020b0  64 65 27 73 20 6c 6f 63  61 74 69 6f 6e 2e 20 54  |de's location. T|
000020c0  68 69 73 20 69 73 20 6e  6f 72 6d 61 6c 6c 79 20  |his is normally |
000020d0  61 0d 73 61 66 65 20 70  6c 61 63 65 2e 20 54 68  |a.safe place. Th|
000020e0  65 20 63 6f 64 65 20 69  73 20 76 65 72 79 20 73  |e code is very s|
000020f0  68 6f 72 74 20 61 6e 64  20 63 6f 75 6c 64 20 62  |hort and could b|
00002100  65 20 70 75 74 20 69 6e  20 6f 6e 65 20 6f 66 20  |e put in one of |
00002110  73 65 76 65 72 61 6c 0d  6f 74 68 65 72 20 70 6c  |several.other pl|
00002120  61 63 65 73 20 69 66 20  6e 65 63 65 73 73 61 72  |aces if necessar|
00002130  79 2e 0d 0d 57 69 74 68  20 61 20 6c 69 74 74 6c  |y...With a littl|
00002140  65 20 69 6e 67 65 6e 75  69 74 79 20 79 6f 75 20  |e ingenuity you |
00002150  77 69 6c 6c 20 66 69 6e  64 20 74 68 61 74 20 61  |will find that a|
00002160  6c 6d 6f 73 74 20 61 6c  6c 20 61 73 73 65 6d 62  |lmost all assemb|
00002170  6c 79 20 63 61 6e 20 62  65 20 64 6f 6e 65 0d 66  |ly can be done.f|
00002180  72 6f 6d 20 66 69 6c 65  73 20 6c 69 6b 65 20 74  |rom files like t|
00002190  68 69 73 2c 20 69 6e 63  6c 75 64 69 6e 67 20 6c  |his, including l|
000021a0  69 73 74 73 20 61 6e 64  20 74 61 62 6c 65 73 2e  |ists and tables.|
000021b0  20 54 68 65 73 65 20 63  61 6e 20 73 6f 6d 65 74  | These can somet|
000021c0  69 6d 65 73 20 62 65 0d  70 72 65 2d 63 6f 6d 70  |imes be.pre-comp|
000021d0  69 6c 65 64 20 69 6e 20  42 41 53 49 43 20 70 72  |iled in BASIC pr|
000021e0  6f 67 72 61 6d 73 2c 20  61 6e 64 20 2a 4c 4f 41  |ograms, and *LOA|
000021f0  44 20 75 73 65 64 20 69  6e 20 63 6f 6e 6a 75 6e  |D used in conjun|
00002200  63 74 69 6f 6e 20 77 69  74 68 20 4f 53 43 4c 49  |ction with OSCLI|
00002210  0d 74 6f 20 6c 6f 63 61  74 65 20 74 68 65 6d 20  |.to locate them |
00002220  77 68 65 72 65 20 74 68  65 79 20 61 72 65 20 72  |where they are r|
00002230  65 71 75 69 72 65 64 2e  20 56 65 72 79 20 6f 63  |equired. Very oc|
00002240  63 61 73 69 6f 6e 61 6c  6c 79 20 74 68 65 72 65  |casionally there|
00002250  20 69 73 20 61 0d 70 72  6f 62 6c 65 6d 20 74 68  | is a.problem th|
00002260  61 74 20 68 61 73 20 74  6f 20 62 65 20 73 6f 6c  |at has to be sol|
00002270  76 65 64 20 77 69 74 68  20 61 20 70 72 6f 63 65  |ved with a proce|
00002280  64 75 72 65 20 6f 72 20  66 75 6e 63 74 69 6f 6e  |dure or function|
00002290  2c 20 77 68 69 63 68 0d  6f 62 76 69 6f 75 73 6c  |, which.obviousl|
000022a0  79 20 63 61 6e 27 74 20  65 78 69 73 74 20 69 6e  |y can't exist in|
000022b0  20 61 20 66 69 6c 65 2e  20 54 68 69 73 20 69 73  | a file. This is|
000022c0  20 70 61 72 74 69 63 75  6c 61 72 6c 79 20 74 72  | particularly tr|
000022d0  75 65 20 66 6f 72 20 42  41 53 49 43 20 31 0d 75  |ue for BASIC 1.u|
000022e0  73 65 72 73 20 77 68 6f  20 6d 61 79 20 6e 65 65  |sers who may nee|
000022f0  64 20 74 6f 20 73 79 6e  74 68 65 73 69 73 65 20  |d to synthesise |
00002300  74 68 65 20 45 51 55 20  61 6e 64 20 4f 53 43 4c  |the EQU and OSCL|
00002310  49 20 6f 70 65 72 61 74  69 6f 6e 73 2e 20 46 6f  |I operations. Fo|
00002320  72 74 75 6e 61 74 65 6c  79 0d 69 74 20 69 73 20  |rtunately.it is |
00002330  70 6f 73 73 69 62 6c 65  20 74 6f 20 74 75 63 6b  |possible to tuck|
00002340  20 76 65 72 79 20 73 6d  61 6c 6c 20 70 72 6f 63  | very small proc|
00002350  65 64 75 72 65 73 20 61  77 61 79 20 69 6e 20 6d  |edures away in m|
00002360  65 6d 6f 72 79 20 61 6e  64 20 63 61 6c 6c 20 74  |emory and call t|
00002370  68 65 6d 0d 77 68 65 6e  20 72 65 71 75 69 72 65  |hem.when require|
00002380  64 2e 20 49 66 20 79 6f  75 20 68 61 76 65 20 61  |d. If you have a|
00002390  20 62 6c 6f 63 6b 20 6f  66 20 70 72 6f 63 65 64  | block of proced|
000023a0  75 72 65 73 20 74 68 61  74 20 69 73 20 6c 65 73  |ures that is les|
000023b0  73 20 74 68 61 6e 20 35  31 32 0d 62 79 74 65 73  |s than 512.bytes|
000023c0  20 6c 6f 6e 67 2c 20 61  6e 64 20 61 72 65 20 63  | long, and are c|
000023d0  61 72 65 66 75 6c 20 61  62 6f 75 74 20 4c 4f 4d  |areful about LOM|
000023e0  45 4d 20 69 74 20 69 73  20 70 6f 73 73 69 62 6c  |EM it is possibl|
000023f0  65 20 74 6f 20 68 61 76  65 20 69 74 20 72 65 73  |e to have it res|
00002400  69 64 69 6e 67 0d 61 74  20 26 39 30 30 2e 20 42  |iding.at &900. B|
00002410  65 6c 6f 77 20 69 73 20  61 6e 20 61 72 72 61 6e  |elow is an arran|
00002420  67 65 6d 65 6e 74 20 74  68 61 74 20 64 6f 65 73  |gement that does|
00002430  20 6a 75 73 74 20 74 68  61 74 2e 0d 0d 0d 20 20  | just that....  |
00002440  70 72 6f 63 65 64 75 72  65 73 20 3a 0d 0d 31 30  |procedures :..10|
00002450  44 45 46 50 52 4f 43 61  3a 50 52 49 4e 54 22 50  |DEFPROCa:PRINT"P|
00002460  52 4f 43 61 22 3a 45 4e  44 50 52 4f 43 0d 32 30  |ROCa":ENDPROC.20|
00002470  44 45 46 50 52 4f 43 62  3a 50 52 49 4e 54 22 50  |DEFPROCb:PRINT"P|
00002480  52 4f 43 62 22 3a 45 4e  44 50 52 4f 43 0d 0d 20  |ROCb":ENDPROC.. |
00002490  20 53 61 76 65 20 61 73  20 27 50 52 4f 43 27 0d  | Save as 'PROC'.|
000024a0  0d 0d 20 20 27 69 6e 69  74 27 20 66 69 6c 65 20  |..  'init' file |
000024b0  3a 0d 0d 50 41 47 45 3d  26 39 30 30 20 28 43 52  |:..PAGE=&900 (CR|
000024c0  29 0d 4c 4f 41 44 22 50  52 4f 43 22 20 28 43 52  |).LOAD"PROC" (CR|
000024d0  29 0d 20 28 43 52 29 0d  4c 4f 4d 45 4d 3d 26 37  |). (CR).LOMEM=&7|
000024e0  30 30 30 3a 20 7b 65 74  63 2e 20 61 73 20 62 65  |000: {etc. as be|
000024f0  66 6f 72 65 7d 0d 0d 0d  54 6f 20 72 75 6e 20 74  |fore}...To run t|
00002500  68 65 20 77 68 6f 6c 65  20 73 75 69 74 65 20 74  |he whole suite t|
00002510  79 70 65 20 27 2a 45 58  45 43 20 69 6e 69 74 27  |ype '*EXEC init'|
00002520  2e 20 54 68 69 73 2c 20  6f 72 20 61 6e 79 20 6c  |. This, or any l|
00002530  61 74 65 72 20 66 69 6c  65 73 20 63 61 6e 20 6e  |ater files can n|
00002540  6f 77 0d 63 61 6c 6c 20  74 68 65 20 70 72 6f 63  |ow.call the proc|
00002550  65 64 75 72 65 73 20 6f  72 20 66 75 6e 63 74 69  |edures or functi|
00002560  6f 6e 73 20 61 73 20 74  68 65 79 20 6e 65 65 64  |ons as they need|
00002570  20 74 6f 2e 20 49 66 20  74 68 65 20 70 72 6f 63  | to. If the proc|
00002580  65 64 75 72 65 73 20 75  73 65 0d 76 61 72 69 61  |edures use.varia|
00002590  62 6c 65 73 2c 20 74 68  65 79 20 77 69 6c 6c 20  |bles, they will |
000025a0  62 65 20 70 75 74 20 73  61 66 65 6c 79 20 6f 6e  |be put safely on|
000025b0  20 74 68 65 20 76 61 72  69 61 62 6c 65 20 73 74  | the variable st|
000025c0  61 63 6b 20 61 62 6f 76  65 20 4c 4f 4d 45 4d 2e  |ack above LOMEM.|
000025d0  0d 4e 6f 74 69 63 65 20  74 68 61 74 20 49 27 76  |.Notice that I'v|
000025e0  65 20 75 73 65 64 20 74  68 65 20 6d 61 78 69 6d  |e used the maxim|
000025f0  75 6d 20 70 6f 73 73 69  62 6c 65 20 63 6f 6d 70  |um possible comp|
00002600  72 65 73 73 69 6f 6e 20  69 6e 20 74 68 65 20 70  |ression in the p|
00002610  72 6f 63 65 64 75 72 65  73 0d 74 6f 20 73 61 76  |rocedures.to sav|
00002620  65 20 6d 65 6d 6f 72 79  20 73 70 61 63 65 2e 20  |e memory space. |
00002630  41 6c 73 6f 20 74 68 65  20 4c 4f 41 44 20 63 6f  |Also the LOAD co|
00002640  6d 6d 61 6e 64 20 69 6e  20 27 69 6e 69 74 27 20  |mmand in 'init' |
00002650  6d 75 73 74 20 62 65 20  6f 6e 20 69 74 73 20 6f  |must be on its o|
00002660  77 6e 0d 6c 69 6e 65 2e  20 46 69 6e 61 6c 6c 79  |wn.line. Finally|
00002670  20 4f 4c 44 20 6d 75 73  74 20 62 65 20 75 73 65  | OLD must be use|
00002680  64 20 69 6e 73 74 65 61  64 20 6f 66 20 4e 45 57  |d instead of NEW|
00002690  20 6f 72 20 74 68 65 20  63 6f 6d 70 75 74 65 72  | or the computer|
000026a0  20 77 69 6c 6c 20 6c 6f  73 65 0d 74 68 65 20 70  | will lose.the p|
000026b0  72 6f 67 72 61 6d 20 6c  69 6e 65 73 20 6c 6f 61  |rogram lines loa|
000026c0  64 65 64 21 0d 0d 0d 41  20 63 6f 6d 70 6c 65 74  |ded!...A complet|
000026d0  65 20 28 72 61 74 68 65  72 20 63 6f 6e 74 72 69  |e (rather contri|
000026e0  76 65 64 29 20 73 65 74  20 69 73 20 61 73 20 66  |ved) set is as f|
000026f0  6f 6c 6c 6f 77 73 3a 0d  0d 0d 20 20 50 52 4f 47  |ollows:...  PROG|
00002700  52 41 4d 20 3a 0d 0d 31  30 44 45 46 50 52 4f 43  |RAM :..10DEFPROC|
00002710  61 3a 43 4c 53 3a 50 52  49 4e 54 27 22 41 6c 6c  |a:CLS:PRINT'"All|
00002720  20 64 6f 6e 65 21 22 3a  45 4e 44 50 52 4f 43 0d  | done!":ENDPROC.|
00002730  0d 20 20 53 61 76 65 20  61 73 20 27 50 52 4f 43  |.  Save as 'PROC|
00002740  27 0d 0d 0d 20 20 27 69  6e 69 74 27 20 66 69 6c  |'...  'init' fil|
00002750  65 20 3a 0d 0d 50 41 47  45 3d 26 39 30 30 20 28  |e :..PAGE=&900 (|
00002760  43 52 29 0d 4c 4f 41 44  22 50 52 4f 43 22 20 28  |CR).LOAD"PROC" (|
00002770  43 52 29 0d 20 28 43 52  29 0d 4c 4f 4d 45 4d 3d  |CR). (CR).LOMEM=|
00002780  26 37 30 30 30 20 28 43  52 29 0d 62 72 6b 76 3d  |&7000 (CR).brkv=|
00002790  26 32 30 32 20 28 43 52  29 0d 50 25 3d 26 43 30  |&202 (CR).P%=&C0|
000027a0  30 20 28 43 52 29 0d 20  28 43 52 29 0d 5b 4f 50  |0 (CR). (CR).[OP|
000027b0  54 32 3a 2e 73 74 6f 72  65 3a 45 51 55 57 20 26  |T2:.store:EQUW &|
000027c0  46 46 46 46 20 28 43 52  29 0d 20 28 43 52 29 0d  |FFFF (CR). (CR).|
000027d0  5b 4f 50 54 32 3a 2e 65  72 72 3a 50 48 50 3a 50  |[OPT2:.err:PHP:P|
000027e0  48 41 3a 54 58 41 3a 50  48 41 3a 54 59 41 3a 50  |HA:TXA:PHA:TYA:P|
000027f0  48 41 20 28 43 52 29 0d  5b 4f 50 54 32 3a 4c 44  |HA (CR).[OPT2:LD|
00002800  41 20 23 26 37 37 3a 4a  53 52 20 26 46 46 46 34  |A #&77:JSR &FFF4|
00002810  20 28 43 52 29 0d 5b 4f  50 54 32 3a 53 45 49 3a  | (CR).[OPT2:SEI:|
00002820  4c 44 41 20 73 74 6f 72  65 3a 53 54 41 20 62 72  |LDA store:STA br|
00002830  6b 76 20 28 43 52 29 0d  5b 4f 50 54 32 3a 4c 44  |kv (CR).[OPT2:LD|
00002840  41 20 73 74 6f 72 65 2b  31 3a 53 54 41 20 62 72  |A store+1:STA br|
00002850  6b 76 2b 31 3a 43 4c 49  20 28 43 52 29 0d 5b 4f  |kv+1:CLI (CR).[O|
00002860  50 54 32 3a 50 4c 41 3a  54 41 59 3a 50 4c 41 3a  |PT2:PLA:TAY:PLA:|
00002870  54 41 58 3a 50 4c 41 3a  50 4c 50 3a 4a 4d 50 20  |TAX:PLA:PLP:JMP |
00002880  28 62 72 6b 76 29 20 28  43 52 29 0d 20 28 43 52  |(brkv) (CR). (CR|
00002890  29 0d 5b 4f 50 54 32 3a  2e 73 65 74 3a 53 45 49  |).[OPT2:.set:SEI|
000028a0  20 28 43 52 29 0d 5b 4f  50 54 32 3a 4c 44 41 20  | (CR).[OPT2:LDA |
000028b0  62 72 6b 76 3a 53 54 41  20 73 74 6f 72 65 20 28  |brkv:STA store (|
000028c0  43 52 29 0d 5b 4f 50 54  32 3a 4c 44 41 20 62 72  |CR).[OPT2:LDA br|
000028d0  6b 76 2b 31 3a 53 54 41  20 73 74 6f 72 65 2b 31  |kv+1:STA store+1|
000028e0  20 28 43 52 29 0d 5b 4f  50 54 32 3a 4c 44 41 20  | (CR).[OPT2:LDA |
000028f0  23 65 72 72 20 4d 4f 44  32 35 36 3a 53 54 41 20  |#err MOD256:STA |
00002900  62 72 6b 76 20 28 43 52  29 0d 5b 4f 50 54 32 3a  |brkv (CR).[OPT2:|
00002910  4c 44 41 20 23 65 72 72  20 44 49 56 32 35 36 3a  |LDA #err DIV256:|
00002920  53 54 41 20 62 72 6b 76  2b 31 20 28 43 52 29 0d  |STA brkv+1 (CR).|
00002930  5b 4f 50 54 32 3a 43 4c  49 3a 52 54 53 20 28 43  |[OPT2:CLI:RTS (C|
00002940  52 29 0d 20 28 43 52 29  0d 43 41 4c 4c 20 73 65  |R). (CR).CALL se|
00002950  74 20 28 43 52 29 0d 4f  4c 44 20 28 43 52 29 0d  |t (CR).OLD (CR).|
00002960  4c 4f 4d 45 4d 3d 26 31  41 30 30 20 28 43 52 29  |LOMEM=&1A00 (CR)|
00002970  0d 62 61 73 65 3d 26 31  39 30 30 20 28 43 52 29  |.base=&1900 (CR)|
00002980  0d 49 25 3d 30 20 28 43  52 29 0d 2a 45 58 45 43  |.I%=0 (CR).*EXEC|
00002990  20 63 6f 64 65 20 28 43  52 29 0d 0d 0d 20 20 27  | code (CR)...  '|
000029a0  63 6f 64 65 27 20 66 69  6c 65 20 3a 0d 0d 50 25  |code' file :..P%|
000029b0  3d 62 61 73 65 20 28 43  52 29 0d 52 45 4d 20 74  |=base (CR).REM t|
000029c0  68 69 73 20 69 73 20 61  6e 20 41 20 77 72 69 74  |his is an A writ|
000029d0  65 72 20 28 43 52 29 0d  20 28 43 52 29 0d 5b 4f  |er (CR). (CR).[O|
000029e0  50 54 49 25 3a 2e 61 31  3a 4c 44 58 20 23 26 30  |PTI%:.a1:LDX #&0|
000029f0  41 20 28 43 52 29 0d 20  28 43 52 29 0d 52 45 4d  |A (CR). (CR).REM|
00002a00  20 6c 6f 6f 70 20 74 6f  20 68 65 72 65 20 66 6f  | loop to here fo|
00002a10  72 20 6d 6f 72 65 20 41  27 73 20 28 43 52 29 0d  |r more A's (CR).|
00002a20  20 28 43 52 29 0d 5b 4f  50 54 49 25 3a 2e 61 32  | (CR).[OPTI%:.a2|
00002a30  3a 4c 44 41 20 23 41 53  43 22 41 22 3a 4a 53 52  |:LDA #ASC"A":JSR|
00002a40  20 26 46 46 45 45 3a 44  45 58 3a 42 4e 45 20 61  | &FFEE:DEX:BNE a|
00002a50  32 20 28 43 52 29 0d 20  28 43 52 29 0d 52 45 4d  |2 (CR). (CR).REM|
00002a60  20 6e 6f 20 6d 6f 72 65  20 41 27 73 20 73 6f 20  | no more A's so |
00002a70  65 78 69 74 20 28 43 52  29 0d 20 28 43 52 29 0d  |exit (CR). (CR).|
00002a80  5b 4f 50 54 49 25 3a 52  54 53 20 28 43 52 29 0d  |[OPTI%:RTS (CR).|
00002a90  0d 49 46 20 49 25 3d 32  20 54 48 45 4e 20 50 52  |.IF I%=2 THEN PR|
00002aa0  4f 43 61 20 45 4c 53 45  20 49 25 3d 32 3a 2a 45  |OCa ELSE I%=2:*E|
00002ab0  58 45 43 20 63 6f 64 65  20 28 43 52 29 0d 0d 4f  |XEC code (CR)..O|
00002ac0  6e 63 65 20 79 6f 75 20  64 65 76 65 6c 6f 70 20  |nce you develop |
00002ad0  72 65 61 6c 6c 79 20 6c  61 72 67 65 20 53 6f 75  |really large Sou|
00002ae0  72 63 65 20 63 6f 64 65  20 79 6f 75 20 77 69 6c  |rce code you wil|
00002af0  6c 20 66 69 6e 64 20 74  68 61 74 20 69 74 20 77  |l find that it w|
00002b00  6f 6e 27 74 20 61 6c 6c  0d 66 69 74 20 69 6e 20  |on't all.fit in |
00002b10  74 6f 20 6f 6e 65 20 74  65 78 74 20 66 69 6c 65  |to one text file|
00002b20  2e 20 54 68 69 73 20 69  73 20 6e 6f 74 20 61 20  |. This is not a |
00002b30  70 72 6f 62 6c 65 6d 2e  20 41 6c 6c 20 79 6f 75  |problem. All you|
00002b40  20 68 61 76 65 20 74 6f  20 64 6f 20 69 73 20 74  | have to do is t|
00002b50  6f 0d 6d 61 6b 65 20 66  69 6c 65 73 20 64 61 69  |o.make files dai|
00002b60  73 79 2d 63 68 61 69 6e  20 65 61 63 68 20 6f 74  |sy-chain each ot|
00002b70  68 65 72 20 6c 69 6b 65  20 74 68 65 20 6f 6e 65  |her like the one|
00002b80  73 20 62 65 6c 6f 77 2e  0d 0d 0d 0d 20 20 66 69  |s below.....  fi|
00002b90  6c 65 20 32 3a 0d 0d 52  45 4d 20 62 61 73 69 63  |le 2:..REM basic|
00002ba0  20 74 6f 6f 6c 73 20 28  43 52 29 0d 20 28 43 52  | tools (CR). (CR|
00002bb0  29 0d 5b 4f 50 54 49 25  3a 20 7b 63 6f 64 65 7d  |).[OPTI%: {code}|
00002bc0  20 28 43 52 29 0d 65 74  63 0d 2a 45 58 45 43 20  | (CR).etc.*EXEC |
00002bd0  66 74 6f 6f 6c 73 20 28  43 52 29 0d 0d 0d 20 20  |ftools (CR)...  |
00002be0  66 69 6c 65 20 33 3a 0d  0d 52 45 4d 20 66 69 6c  |file 3:..REM fil|
00002bf0  69 6e 67 20 74 6f 6f 6c  73 20 28 43 52 29 0d 20  |ing tools (CR). |
00002c00  28 43 52 29 0d 5b 4f 50  54 49 25 3a 20 7b 63 6f  |(CR).[OPTI%: {co|
00002c10  64 65 7d 20 28 43 52 29  0d 65 74 63 0d 2a 45 58  |de} (CR).etc.*EX|
00002c20  45 43 20 6d 74 6f 6f 6c  73 20 28 43 52 29 0d 0d  |EC mtools (CR)..|
00002c30  0d 20 20 66 69 6c 65 20  38 3a 0d 0d 52 45 4d 20  |.  file 8:..REM |
00002c40  73 75 62 72 6f 75 74 69  6e 65 73 20 28 43 52 29  |subroutines (CR)|
00002c50  0d 20 28 43 52 29 0d 5b  4f 50 54 49 25 3a 20 7b  |. (CR).[OPTI%: {|
00002c60  63 6f 64 65 7d 20 28 43  52 29 0d 65 74 63 0d 49  |code} (CR).etc.I|
00002c70  46 20 49 25 3d 36 20 54  48 45 4e 20 43 4c 53 3a  |F I%=6 THEN CLS:|
00002c80  50 2e 27 27 22 46 69 6e  69 73 68 65 64 22 20 45  |P.''"Finished" E|
00002c90  4c 2e 49 25 3d 36 3a 2a  45 58 45 43 20 62 74 6f  |L.I%=6:*EXEC bto|
00002ca0  6f 6c 73 20 28 43 52 29  0d 0d 0d 0d 49 20 75 73  |ols (CR)....I us|
00002cb0  65 20 74 68 69 73 20 6d  65 74 68 6f 64 20 74 6f  |e this method to|
00002cc0  20 70 72 6f 64 75 63 65  20 61 20 31 36 6b 20 54  | produce a 16k T|
00002cd0  6f 6f 6c 6b 69 74 20 45  50 52 4f 4d 20 75 73 69  |oolkit EPROM usi|
00002ce0  6e 67 20 6f 66 66 73 65  74 20 61 73 73 65 6d 62  |ng offset assemb|
00002cf0  6c 79 2e 20 49 74 0d 72  65 71 75 69 72 65 73 20  |ly. It.requires |
00002d00  38 20 66 69 6c 65 73 20  61 6e 64 20 74 61 6b 65  |8 files and take|
00002d10  73 20 61 72 6f 75 6e 64  20 66 69 76 65 20 6d 69  |s around five mi|
00002d20  6e 75 74 65 73 20 74 6f  20 61 73 73 65 6d 62 6c  |nutes to assembl|
00002d30  65 20 66 72 6f 6d 20 74  68 65 20 44 46 53 2e 0d  |e from the DFS..|
00002d40  54 68 65 20 6d 61 63 68  69 6e 65 20 75 73 65 64  |The machine used|
00002d50  20 69 73 20 61 20 70 65  72 66 65 63 74 6c 79 20  | is a perfectly |
00002d60  73 74 61 6e 64 61 72 64  20 4d 6f 64 65 6c 20 42  |standard Model B|
00002d70  20 77 69 74 68 20 6f 6e  6c 79 20 57 6f 72 64 77  | with only Wordw|
00002d80  69 73 65 20 61 64 64 65  64 2e 0d 0d 49 66 20 79  |ise added...If y|
00002d90  6f 75 20 73 74 69 63 6b  20 74 6f 20 74 68 65 20  |ou stick to the |
00002da0  66 6f 72 6d 61 74 20 49  27 76 65 20 75 73 65 64  |format I've used|
00002db0  20 68 65 72 65 20 74 68  65 6e 20 74 68 65 20 42  | here then the B|
00002dc0  41 53 49 43 20 70 72 6f  67 72 61 6d 20 27 50 52  |ASIC program 'PR|
00002dd0  49 4e 54 45 52 27 0d 63  61 6e 20 62 65 20 75 73  |INTER'.can be us|
00002de0  65 64 20 74 6f 20 6d 61  6b 65 20 61 20 68 61 72  |ed to make a har|
00002df0  64 20 63 6f 70 79 20 6f  66 20 79 6f 75 72 20 66  |d copy of your f|
00002e00  69 6c 65 73 2e 20 49 74  20 69 73 20 69 6e 74 65  |iles. It is inte|
00002e10  6e 64 65 64 20 66 6f 72  20 75 73 65 20 77 69 74  |nded for use wit|
00002e20  68 0d 61 6e 20 45 70 73  6f 6e 20 63 6f 6d 70 61  |h.an Epson compa|
00002e30  74 69 62 6c 65 20 70 72  69 6e 74 65 72 20 75 73  |tible printer us|
00002e40  69 6e 67 20 6e 6f 72 6d  61 6c 20 66 61 6e 2d 66  |ing normal fan-f|
00002e50  6f 6c 64 20 70 61 70 65  72 2e 0d 0d 54 68 65 20  |old paper...The |
00002e60  70 72 6f 67 72 61 6d 20  70 72 69 6e 74 73 20 61  |program prints a|
00002e70  20 68 65 61 64 69 6e 67  20 6f 6e 20 65 61 63 68  | heading on each|
00002e80  20 70 61 67 65 20 77 69  74 68 20 74 68 65 20 66  | page with the f|
00002e90  69 6c 65 6e 61 6d 65 20  61 6e 64 20 70 61 67 65  |ilename and page|
00002ea0  0d 6e 75 6d 62 65 72 2e  20 46 6f 72 20 63 6c 61  |.number. For cla|
00002eb0  72 69 74 79 20 69 74 20  77 69 6c 6c 20 61 75 74  |rity it will aut|
00002ec0  6f 6d 61 74 69 63 61 6c  6c 79 20 73 74 72 69 70  |omatically strip|
00002ed0  20 6f 66 66 20 74 68 65  20 27 5b 4f 50 54 49 20  | off the '[OPTI |
00002ee0  25 27 20 61 6e 64 20 77  69 6c 6c 0d 69 6e 64 65  |%' and will.inde|
00002ef0  6e 74 20 73 74 61 74 65  6d 65 6e 74 73 20 61 6e  |nt statements an|
00002f00  64 20 63 6f 6d 6d 65 6e  74 73 2c 20 77 68 69 6c  |d comments, whil|
00002f10  73 74 20 6c 65 61 76 69  6e 67 20 61 6e 79 20 42  |st leaving any B|
00002f20  41 53 49 43 20 75 6e 74  6f 75 63 68 65 64 2e 20  |ASIC untouched. |
00002f30  54 68 65 72 65 0d 69 73  20 61 6c 73 6f 20 61 6e  |There.is also an|
00002f40  20 6f 70 74 69 6f 6e 20  74 6f 20 73 70 6c 69 74  | option to split|
00002f50  20 74 68 65 20 73 74 61  74 65 6d 65 6e 74 73 20  | the statements |
00002f60  6f 6e 20 74 6f 20 73 65  70 61 72 61 74 65 20 6c  |on to separate l|
00002f70  69 6e 65 73 20 2d 20 74  68 69 73 0d 72 65 61 6c  |ines - this.real|
00002f80  6c 79 20 67 6f 62 62 6c  65 73 20 75 70 20 70 61  |ly gobbles up pa|
00002f90  70 65 72 20 62 75 74 20  6d 61 6b 65 73 20 74 68  |per but makes th|
00002fa0  65 20 63 6f 64 65 20 61  20 64 65 6c 69 67 68 74  |e code a delight|
00002fb0  20 74 6f 20 72 65 61 64  2e 0d                    | to read..|
00002fba
17-02-89/A\Info.m0
17-02-89/A\Info.m1
17-02-89/A\Info.m2
17-02-89/A\Info.m4
17-02-89/A\Info.m5