Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_21.ADF » F/M\Ctut1

F/M\Ctut1

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 » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_21.ADF
Filename: F/M\Ctut1
Read OK:
File size: 1895 bytes
Load address: 4D204556
Exec address: 7574432F
File contents
USING THE ASSEMBLER 4
~~~~~~~~~~~~~~~~~~~~~
By Richard Dimond

I hope that you are following me all right and that you have been able to
create some characters as I will be showing how to move these about the
screen and also selecting menu options.

Firstly, I must explain about where M/code can be stored as we shall need
more room from now as page &C is used for the characters.  Loading M/code
to &900 is useful for short routines and utilities but not for a game.

There are three other options -

     1.  Using a DIM statement to reserve space above TOP
     2.  Lowering HIMEM to reserve space above this
     3.  Raising PAGE to reverve space below

Options 2 & 3 are perhaps best for a completed game which is fully M/coded
but for the present I shall use option 1 as this is easier to set up.  

The disadvantage is that the M/code has to be assembled each time as the
area used varies as the assembler listing lengthens.

I have re-written the assembler listing for this method and included all
the subroutines so far.  These have been revised to make them clearer and
include the variables as explained last time.

I have put the data for the character on page 94 of the manual for those
who have not created one yet.  Also I have put a basic main loop in so
that the program will run and you can move the character around though,
since the M/code is very fast, you will not have much control yet.

MOVEMENT
~~~~~~~~
This routine uses the OS subroutine OSBYTE.  This is used for the M/code
equivalent of the *FX calls.

Register A is loaded with the value of the FX call and registers X & Y the
parameters needed.   Thus -

     LDA#15:LDX#0:LDY#0:JMPosbyte

is the equivalent of *FX15,0 used for clearing the buffers.

for reading the keys, we use OSBYTE with register A loaded with 129.  Y is
loaded with &FF and X with the negative INKEY value of the key.  With this
routine, the Carry flag is clear until the key is pressed and so a test on
the Carry flag will show whether or not the key is pressed.

I have put the subroutine 'move' in for using keys Z, X, : & / for Left,
Right, Up and Down.

Thus for the Z key is -

  .lt LDA#129:LDX#&9E:LDY#&FF:JSRosbyte          \ INKEY-98 
  BCCrt:JSRleft

For the present, the movement subroutines simply increase or decrease the
co-ordinates for printing the character.  They will need to be added to
later.

As I said, it is too fast to control so I have added the subroutine delay
-
   .delay PHA:TXA:PHA:TYA:PHA:    \ save register values on stack
          LDXspeed:.xloop :LDY#255:.yloop DEY:BNEyloop:DEX:BNExloop:
          PLA:TAY:PLA:TAX:PLA:RTS \ restore register values

The subroutine will need to be called in the main loop by -

    320   JSRdelay
    350   JSRdelay

It is entered twice so that the character is flashes evenly.

The value entered in speed can be varied to alter the speed. Also for
longer delays you can add some NOPs into the loops.  This opcode does not
do anything as it's name suggests but does cause a little delay in the
operation of the code.

While it is only really necessary to save the values in X and Y registers
in this routine, I have included the 3 to illustrate the use of the stack.  
This is often done in this way.  Note that the three values must be PULLed
off in reverse order.

I suggest you should experiment with this and also try changing the MODE. 
I have used MODE 4.  If you use MODE 2 or 5, you will need to alter the 39
in PROCright to 19 to prevent the character moving off the screen.

At present, to stop the program you will need to press BREAK.  It is best
to provide for pressing ESCAPE and this can be done by using -

      LDA#129:LDX#&8F:LDY#&FF:JSRosbyte   \ INKEY-113  ESCAPE
      BCCcont:RTS                         \ Return to BASIC
      .cont

This must be in the main loop since, if it were in a subroutine, it would
simply end the routine and not return to BASIC.

MAKING CHOICES
~~~~~~~~~~~~~~
Whether it is to select from a menu or simply to answer a yes or no
question, we shall need to make our choice.

For this we use the OS routine OSRDCH (&FFE0).

The routine will stop the program and wait for a key to be pressed when it
will put the ASC value of the key into register A.

If ESCAPE is pressed, the Carry flag is set so a test of this flag can be
used for breaking out of the program and returning to BASIC -

         .rdch      JSRosrdch
                    BCCcont
                    RTS                  \  to BASIC
        .cont       (rest of program)

For answering a question add -

                    CMP#ASC"Y":BEQ yes
                    CMP#ASC"N":BEQ no
                    JMPrdch
         .yes       JSR instructions      \ (or whatever)
         .no        (rest of program)

This can be extended or altered to any keys.

You can select 3 or more choices by a series of letters or numbers by
using -

          .rdch      JSRosrdch
                     CMP#ASC"1":BCCrdch    \ back if <ASC"1"
                     CMP#ASC"4":BCSdrch    \ back if >ASC"3"
                     CMP#ASC"1":BEQchoice1
                     CMP#ASC"2":BEQchoice2
                     CMP#ASC"3":BEQchoice3
          .choice1   JSRoption1:JMPrep
                     JSRoption2:JMPrep
                     JSRoption3:JMPrep
          .rep       (rest of program)

The speed of the game can be selected by -

    200    .spset     JSRosrdch
                      CMP#ASC"1":BCCspset
                      CMP#ASC"4":BCSspset
                      SEC:SBC#48
                      ASL A:ASL A:ASL A:ASL A
                      STAspeed

Enter this in the program before the main loop.

The keys 1 - 3 are selected again then 48 is subtracted from the ASC value
so that the values given are 1, 2 & 3.  The 4 ASL A shift the bytes left 4
times, this multiplies by 2 each time and thus gives valuues for speed of
16, 32 & 48.

Note that the Carry flag must be set before the subtraction.

I hope my articles are giving some ideas for writing programs in M/code. 
If there are any problems or questions so far, I am always happy to try to
help.  As I said last time, the more we experiment, the more we learn.

I am hoping to show how to set up a screen and how they may be loaded next
time.
00000000  0d 55 53 49 4e 47 20 54  48 45 20 41 53 53 45 4d  |.USING THE ASSEM|
00000010  42 4c 45 52 20 34 0d 7e  7e 7e 7e 7e 7e 7e 7e 7e  |BLER 4.~~~~~~~~~|
00000020  7e 7e 7e 7e 7e 7e 7e 7e  7e 7e 7e 7e 0d 42 79 20  |~~~~~~~~~~~~.By |
00000030  52 69 63 68 61 72 64 20  44 69 6d 6f 6e 64 0d 0d  |Richard Dimond..|
00000040  49 20 68 6f 70 65 20 74  68 61 74 20 79 6f 75 20  |I hope that you |
00000050  61 72 65 20 66 6f 6c 6c  6f 77 69 6e 67 20 6d 65  |are following me|
00000060  1a 20 61 6c 6c 20 72 69  67 68 74 20 61 6e 64 20  |. all right and |
00000070  74 68 61 74 20 79 6f 75  20 68 61 76 65 20 62 65  |that you have be|
00000080  65 6e 20 61 62 6c 65 20  74 6f 0d 63 72 65 61 74  |en able to.creat|
00000090  65 20 73 6f 6d 65 20 63  68 61 72 61 63 74 65 72  |e some character|
000000a0  73 20 61 73 20 49 20 77  69 6c 6c 20 62 65 20 73  |s as I will be s|
000000b0  68 6f 77 69 6e 67 1a 20  68 6f 77 1a 20 74 6f 1a  |howing. how. to.|
000000c0  20 6d 6f 76 65 20 74 68  65 73 65 20 61 62 6f 75  | move these abou|
000000d0  74 20 74 68 65 0d 73 63  72 65 65 6e 20 61 6e 64  |t the.screen and|
000000e0  20 61 6c 73 6f 20 73 65  6c 65 63 74 69 6e 67 20  | also selecting |
000000f0  6d 65 6e 75 20 6f 70 74  69 6f 6e 73 2e 0d 0d 46  |menu options...F|
00000100  69 72 73 74 6c 79 2c 20  49 20 6d 75 73 74 20 65  |irstly, I must e|
00000110  78 70 6c 61 69 6e 20 61  62 6f 75 74 20 77 68 65  |xplain about whe|
00000120  72 65 20 4d 2f 63 6f 64  65 20 63 61 6e 20 62 65  |re M/code can be|
00000130  20 73 74 6f 72 65 64 20  61 73 1a 20 77 65 20 73  | stored as. we s|
00000140  68 61 6c 6c 20 6e 65 65  64 0d 6d 6f 72 65 20 72  |hall need.more r|
00000150  6f 6f 6d 20 66 72 6f 6d  20 6e 6f 77 20 61 73 1a  |oom from now as.|
00000160  20 70 61 67 65 20 26 43  20 69 73 20 75 73 65 64  | page &C is used|
00000170  20 66 6f 72 20 74 68 65  20 63 68 61 72 61 63 74  | for the charact|
00000180  65 72 73 2e 20 20 4c 6f  61 64 69 6e 67 20 4d 2f  |ers.  Loading M/|
00000190  63 6f 64 65 0d 74 6f 20  26 39 30 30 20 69 73 20  |code.to &900 is |
000001a0  75 73 65 66 75 6c 20 66  6f 72 20 73 68 6f 72 74  |useful for short|
000001b0  20 72 6f 75 74 69 6e 65  73 20 61 6e 64 20 75 74  | routines and ut|
000001c0  69 6c 69 74 69 65 73 20  62 75 74 20 6e 6f 74 20  |ilities but not |
000001d0  66 6f 72 20 61 20 67 61  6d 65 2e 0d 0d 54 68 65  |for a game...The|
000001e0  72 65 20 61 72 65 20 74  68 72 65 65 20 6f 74 68  |re are three oth|
000001f0  65 72 20 6f 70 74 69 6f  6e 73 20 2d 0d 0d 20 20  |er options -..  |
00000200  20 20 20 31 2e 20 20 55  73 69 6e 67 20 61 20 44  |   1.  Using a D|
00000210  49 4d 20 73 74 61 74 65  6d 65 6e 74 20 74 6f 20  |IM statement to |
00000220  72 65 73 65 72 76 65 20  73 70 61 63 65 20 61 62  |reserve space ab|
00000230  6f 76 65 20 54 4f 50 0d  20 20 20 20 20 32 2e 20  |ove TOP.     2. |
00000240  20 4c 6f 77 65 72 69 6e  67 20 48 49 4d 45 4d 20  | Lowering HIMEM |
00000250  74 6f 20 72 65 73 65 72  76 65 20 73 70 61 63 65  |to reserve space|
00000260  20 61 62 6f 76 65 20 74  68 69 73 0d 20 20 20 20  | above this.    |
00000270  20 33 2e 20 20 52 61 69  73 69 6e 67 20 50 41 47  | 3.  Raising PAG|
00000280  45 20 74 6f 20 72 65 76  65 72 76 65 20 73 70 61  |E to reverve spa|
00000290  63 65 20 62 65 6c 6f 77  0d 0d 4f 70 74 69 6f 6e  |ce below..Option|
000002a0  73 20 32 20 26 20 33 20  61 72 65 20 70 65 72 68  |s 2 & 3 are perh|
000002b0  61 70 73 20 62 65 73 74  20 66 6f 72 20 61 20 63  |aps best for a c|
000002c0  6f 6d 70 6c 65 74 65 64  20 67 61 6d 65 20 77 68  |ompleted game wh|
000002d0  69 63 68 20 69 73 20 66  75 6c 6c 79 20 4d 2f 63  |ich is fully M/c|
000002e0  6f 64 65 64 0d 62 75 74  1a 20 66 6f 72 1a 20 74  |oded.but. for. t|
000002f0  68 65 20 70 72 65 73 65  6e 74 20 49 20 73 68 61  |he present I sha|
00000300  6c 6c 20 75 73 65 20 6f  70 74 69 6f 6e 20 31 20  |ll use option 1 |
00000310  61 73 20 74 68 69 73 20  69 73 20 65 61 73 69 65  |as this is easie|
00000320  72 20 74 6f 20 73 65 74  20 75 70 2e 20 20 0d 0d  |r to set up.  ..|
00000330  54 68 65 20 64 69 73 61  64 76 61 6e 74 61 67 65  |The disadvantage|
00000340  20 69 73 1a 20 74 68 61  74 1a 20 74 68 65 20 4d  | is. that. the M|
00000350  2f 63 6f 64 65 20 68 61  73 20 74 6f 20 62 65 20  |/code has to be |
00000360  61 73 73 65 6d 62 6c 65  64 20 65 61 63 68 20 74  |assembled each t|
00000370  69 6d 65 20 61 73 20 74  68 65 0d 61 72 65 61 20  |ime as the.area |
00000380  75 73 65 64 20 76 61 72  69 65 73 20 61 73 20 74  |used varies as t|
00000390  68 65 20 61 73 73 65 6d  62 6c 65 72 20 6c 69 73  |he assembler lis|
000003a0  74 69 6e 67 20 6c 65 6e  67 74 68 65 6e 73 2e 0d  |ting lengthens..|
000003b0  0d 49 20 68 61 76 65 20  72 65 2d 77 72 69 74 74  |.I have re-writt|
000003c0  65 6e 20 74 68 65 20 61  73 73 65 6d 62 6c 65 72  |en the assembler|
000003d0  1a 20 6c 69 73 74 69 6e  67 1a 20 66 6f 72 20 74  |. listing. for t|
000003e0  68 69 73 20 6d 65 74 68  6f 64 20 61 6e 64 20 69  |his method and i|
000003f0  6e 63 6c 75 64 65 64 20  61 6c 6c 0d 74 68 65 20  |ncluded all.the |
00000400  73 75 62 72 6f 75 74 69  6e 65 73 20 73 6f 20 66  |subroutines so f|
00000410  61 72 2e 20 20 54 68 65  73 65 20 68 61 76 65 20  |ar.  These have |
00000420  62 65 65 6e 1a 20 72 65  76 69 73 65 64 20 74 6f  |been. revised to|
00000430  20 6d 61 6b 65 20 74 68  65 6d 20 63 6c 65 61 72  | make them clear|
00000440  65 72 20 61 6e 64 0d 69  6e 63 6c 75 64 65 20 74  |er and.include t|
00000450  68 65 20 76 61 72 69 61  62 6c 65 73 20 61 73 20  |he variables as |
00000460  65 78 70 6c 61 69 6e 65  64 20 6c 61 73 74 20 74  |explained last t|
00000470  69 6d 65 2e 0d 0d 49 20  68 61 76 65 20 70 75 74  |ime...I have put|
00000480  20 74 68 65 20 64 61 74  61 20 66 6f 72 1a 20 74  | the data for. t|
00000490  68 65 1a 20 63 68 61 72  61 63 74 65 72 20 6f 6e  |he. character on|
000004a0  20 70 61 67 65 20 39 34  20 6f 66 20 74 68 65 20  | page 94 of the |
000004b0  6d 61 6e 75 61 6c 20 66  6f 72 20 74 68 6f 73 65  |manual for those|
000004c0  0d 77 68 6f 20 68 61 76  65 20 6e 6f 74 20 63 72  |.who have not cr|
000004d0  65 61 74 65 64 20 6f 6e  65 1a 20 79 65 74 2e 1a  |eated one. yet..|
000004e0  20 20 41 6c 73 6f 1a 20  49 1a 20 68 61 76 65 20  |  Also. I. have |
000004f0  70 75 74 20 61 20 62 61  73 69 63 20 6d 61 69 6e  |put a basic main|
00000500  20 6c 6f 6f 70 20 69 6e  20 73 6f 0d 74 68 61 74  | loop in so.that|
00000510  20 74 68 65 20 70 72 6f  67 72 61 6d 20 77 69 6c  | the program wil|
00000520  6c 20 72 75 6e 20 61 6e  64 20 79 6f 75 20 63 61  |l run and you ca|
00000530  6e 20 6d 6f 76 65 1a 20  74 68 65 1a 20 63 68 61  |n move. the. cha|
00000540  72 61 63 74 65 72 1a 20  61 72 6f 75 6e 64 20 74  |racter. around t|
00000550  68 6f 75 67 68 2c 0d 73  69 6e 63 65 20 74 68 65  |hough,.since the|
00000560  20 4d 2f 63 6f 64 65 20  69 73 20 76 65 72 79 20  | M/code is very |
00000570  66 61 73 74 2c 20 79 6f  75 20 77 69 6c 6c 20 6e  |fast, you will n|
00000580  6f 74 20 68 61 76 65 20  6d 75 63 68 20 63 6f 6e  |ot have much con|
00000590  74 72 6f 6c 20 79 65 74  2e 0d 0d 4d 4f 56 45 4d  |trol yet...MOVEM|
000005a0  45 4e 54 0d 7e 7e 7e 7e  7e 7e 7e 7e 0d 54 68 69  |ENT.~~~~~~~~.Thi|
000005b0  73 20 72 6f 75 74 69 6e  65 20 75 73 65 73 20 74  |s routine uses t|
000005c0  68 65 20 4f 53 20 73 75  62 72 6f 75 74 69 6e 65  |he OS subroutine|
000005d0  20 4f 53 42 59 54 45 2e  20 20 54 68 69 73 1a 20  | OSBYTE.  This. |
000005e0  69 73 1a 20 75 73 65 64  20 66 6f 72 20 74 68 65  |is. used for the|
000005f0  20 4d 2f 63 6f 64 65 0d  65 71 75 69 76 61 6c 65  | M/code.equivale|
00000600  6e 74 20 6f 66 20 74 68  65 20 2a 46 58 20 63 61  |nt of the *FX ca|
00000610  6c 6c 73 2e 0d 0d 52 65  67 69 73 74 65 72 20 41  |lls...Register A|
00000620  20 69 73 20 6c 6f 61 64  65 64 20 77 69 74 68 20  | is loaded with |
00000630  74 68 65 20 76 61 6c 75  65 20 6f 66 20 74 68 65  |the value of the|
00000640  20 46 58 20 63 61 6c 6c  20 61 6e 64 20 72 65 67  | FX call and reg|
00000650  69 73 74 65 72 73 20 58  20 26 20 59 20 74 68 65  |isters X & Y the|
00000660  0d 70 61 72 61 6d 65 74  65 72 73 20 6e 65 65 64  |.parameters need|
00000670  65 64 2e 20 20 20 54 68  75 73 20 2d 0d 0d 20 20  |ed.   Thus -..  |
00000680  20 20 20 4c 44 41 23 31  35 3a 4c 44 58 23 30 3a  |   LDA#15:LDX#0:|
00000690  4c 44 59 23 30 3a 4a 4d  50 6f 73 62 79 74 65 0d  |LDY#0:JMPosbyte.|
000006a0  0d 69 73 20 74 68 65 20  65 71 75 69 76 61 6c 65  |.is the equivale|
000006b0  6e 74 20 6f 66 20 2a 46  58 31 35 2c 30 20 75 73  |nt of *FX15,0 us|
000006c0  65 64 20 66 6f 72 20 63  6c 65 61 72 69 6e 67 20  |ed for clearing |
000006d0  74 68 65 20 62 75 66 66  65 72 73 2e 0d 0d 66 6f  |the buffers...fo|
000006e0  72 20 72 65 61 64 69 6e  67 20 74 68 65 20 6b 65  |r reading the ke|
000006f0  79 73 2c 20 77 65 20 75  73 65 20 4f 53 42 59 54  |ys, we use OSBYT|
00000700  45 20 77 69 74 68 20 72  65 67 69 73 74 65 72 20  |E with register |
00000710  41 20 6c 6f 61 64 65 64  20 77 69 74 68 20 31 32  |A loaded with 12|
00000720  39 2e 20 20 59 20 69 73  0d 6c 6f 61 64 65 64 20  |9.  Y is.loaded |
00000730  77 69 74 68 20 26 46 46  20 61 6e 64 20 58 20 77  |with &FF and X w|
00000740  69 74 68 20 74 68 65 20  6e 65 67 61 74 69 76 65  |ith the negative|
00000750  20 49 4e 4b 45 59 20 76  61 6c 75 65 20 6f 66 20  | INKEY value of |
00000760  74 68 65 20 6b 65 79 2e  20 20 57 69 74 68 20 74  |the key.  With t|
00000770  68 69 73 0d 72 6f 75 74  69 6e 65 2c 20 74 68 65  |his.routine, the|
00000780  20 43 61 72 72 79 20 66  6c 61 67 20 69 73 20 63  | Carry flag is c|
00000790  6c 65 61 72 20 75 6e 74  69 6c 20 74 68 65 20 6b  |lear until the k|
000007a0  65 79 20 69 73 20 70 72  65 73 73 65 64 20 61 6e  |ey is pressed an|
000007b0  64 20 73 6f 20 61 20 74  65 73 74 20 6f 6e 0d 74  |d so a test on.t|
000007c0  68 65 20 43 61 72 72 79  20 66 6c 61 67 20 77 69  |he Carry flag wi|
000007d0  6c 6c 20 73 68 6f 77 20  77 68 65 74 68 65 72 20  |ll show whether |
000007e0  6f 72 20 6e 6f 74 20 74  68 65 20 6b 65 79 20 69  |or not the key i|
000007f0  73 20 70 72 65 73 73 65  64 2e 0d 0d 49 20 68 61  |s pressed...I ha|
00000800  76 65 20 70 75 74 20 74  68 65 20 73 75 62 72 6f  |ve put the subro|
00000810  75 74 69 6e 65 1a 20 27  6d 6f 76 65 27 1a 20 69  |utine. 'move'. i|
00000820  6e 20 66 6f 72 20 75 73  69 6e 67 20 6b 65 79 73  |n for using keys|
00000830  20 5a 2c 20 58 2c 20 3a  20 26 20 2f 20 66 6f 72  | Z, X, : & / for|
00000840  20 4c 65 66 74 2c 0d 52  69 67 68 74 2c 20 55 70  | Left,.Right, Up|
00000850  20 61 6e 64 20 44 6f 77  6e 2e 0d 0d 54 68 75 73  | and Down...Thus|
00000860  20 66 6f 72 20 74 68 65  20 5a 20 6b 65 79 20 69  | for the Z key i|
00000870  73 20 2d 0d 0d 20 20 2e  6c 74 20 4c 44 41 23 31  |s -..  .lt LDA#1|
00000880  32 39 3a 4c 44 58 23 26  39 45 3a 4c 44 59 23 26  |29:LDX#&9E:LDY#&|
00000890  46 46 3a 4a 53 52 6f 73  62 79 74 65 20 20 20 20  |FF:JSRosbyte    |
000008a0  20 20 20 20 20 20 5c 20  49 4e 4b 45 59 2d 39 38  |      \ INKEY-98|
000008b0  20 0d 20 20 42 43 43 72  74 3a 4a 53 52 6c 65 66  | .  BCCrt:JSRlef|
000008c0  74 0d 0d 46 6f 72 1a 20  74 68 65 20 70 72 65 73  |t..For. the pres|
000008d0  65 6e 74 2c 20 74 68 65  20 6d 6f 76 65 6d 65 6e  |ent, the movemen|
000008e0  74 20 73 75 62 72 6f 75  74 69 6e 65 73 20 73 69  |t subroutines si|
000008f0  6d 70 6c 79 20 69 6e 63  72 65 61 73 65 20 6f 72  |mply increase or|
00000900  20 64 65 63 72 65 61 73  65 20 74 68 65 0d 63 6f  | decrease the.co|
00000910  2d 6f 72 64 69 6e 61 74  65 73 20 66 6f 72 1a 20  |-ordinates for. |
00000920  70 72 69 6e 74 69 6e 67  1a 20 74 68 65 1a 20 63  |printing. the. c|
00000930  68 61 72 61 63 74 65 72  2e 20 20 54 68 65 79 20  |haracter.  They |
00000940  77 69 6c 6c 20 6e 65 65  64 20 74 6f 20 62 65 20  |will need to be |
00000950  61 64 64 65 64 20 74 6f  0d 6c 61 74 65 72 2e 0d  |added to.later..|
00000960  0d 41 73 20 49 20 73 61  69 64 2c 20 69 74 20 69  |.As I said, it i|
00000970  73 20 74 6f 6f 20 66 61  73 74 1a 20 74 6f 20 63  |s too fast. to c|
00000980  6f 6e 74 72 6f 6c 20 73  6f 20 49 20 68 61 76 65  |ontrol so I have|
00000990  20 61 64 64 65 64 20 74  68 65 20 73 75 62 72 6f  | added the subro|
000009a0  75 74 69 6e 65 20 64 65  6c 61 79 0d 2d 0d 20 20  |utine delay.-.  |
000009b0  20 2e 64 65 6c 61 79 20  50 48 41 3a 54 58 41 3a  | .delay PHA:TXA:|
000009c0  50 48 41 3a 54 59 41 3a  50 48 41 3a 20 20 20 20  |PHA:TYA:PHA:    |
000009d0  5c 20 73 61 76 65 20 72  65 67 69 73 74 65 72 20  |\ save register |
000009e0  76 61 6c 75 65 73 20 6f  6e 20 73 74 61 63 6b 0d  |values on stack.|
000009f0  20 20 20 20 20 20 20 20  20 20 4c 44 58 73 70 65  |          LDXspe|
00000a00  65 64 3a 2e 78 6c 6f 6f  70 20 3a 4c 44 59 23 32  |ed:.xloop :LDY#2|
00000a10  35 35 3a 2e 79 6c 6f 6f  70 20 44 45 59 3a 42 4e  |55:.yloop DEY:BN|
00000a20  45 79 6c 6f 6f 70 3a 44  45 58 3a 42 4e 45 78 6c  |Eyloop:DEX:BNExl|
00000a30  6f 6f 70 3a 0d 20 20 20  20 20 20 20 20 20 20 50  |oop:.          P|
00000a40  4c 41 3a 54 41 59 3a 50  4c 41 3a 54 41 58 3a 50  |LA:TAY:PLA:TAX:P|
00000a50  4c 41 3a 52 54 53 20 5c  20 72 65 73 74 6f 72 65  |LA:RTS \ restore|
00000a60  20 72 65 67 69 73 74 65  72 20 76 61 6c 75 65 73  | register values|
00000a70  0d 0d 54 68 65 20 73 75  62 72 6f 75 74 69 6e 65  |..The subroutine|
00000a80  20 77 69 6c 6c 20 6e 65  65 64 20 74 6f 20 62 65  | will need to be|
00000a90  20 63 61 6c 6c 65 64 20  69 6e 20 74 68 65 20 6d  | called in the m|
00000aa0  61 69 6e 20 6c 6f 6f 70  20 62 79 20 2d 0d 0d 20  |ain loop by -.. |
00000ab0  20 20 20 33 32 30 20 20  20 4a 53 52 64 65 6c 61  |   320   JSRdela|
00000ac0  79 0d 20 20 20 20 33 35  30 20 20 20 4a 53 52 64  |y.    350   JSRd|
00000ad0  65 6c 61 79 0d 0d 49 74  20 69 73 20 65 6e 74 65  |elay..It is ente|
00000ae0  72 65 64 20 74 77 69 63  65 20 73 6f 20 74 68 61  |red twice so tha|
00000af0  74 20 74 68 65 20 63 68  61 72 61 63 74 65 72 20  |t the character |
00000b00  69 73 20 66 6c 61 73 68  65 73 20 65 76 65 6e 6c  |is flashes evenl|
00000b10  79 2e 0d 0d 54 68 65 20  76 61 6c 75 65 20 65 6e  |y...The value en|
00000b20  74 65 72 65 64 20 69 6e  20 73 70 65 65 64 20 63  |tered in speed c|
00000b30  61 6e 20 62 65 20 76 61  72 69 65 64 1a 20 74 6f  |an be varied. to|
00000b40  1a 20 61 6c 74 65 72 1a  20 74 68 65 1a 20 73 70  |. alter. the. sp|
00000b50  65 65 64 2e 1a 20 41 6c  73 6f 20 66 6f 72 0d 6c  |eed.. Also for.l|
00000b60  6f 6e 67 65 72 1a 20 64  65 6c 61 79 73 20 79 6f  |onger. delays yo|
00000b70  75 20 63 61 6e 20 61 64  64 20 73 6f 6d 65 20 4e  |u can add some N|
00000b80  4f 50 73 20 69 6e 74 6f  20 74 68 65 20 6c 6f 6f  |OPs into the loo|
00000b90  70 73 2e 20 20 54 68 69  73 20 6f 70 63 6f 64 65  |ps.  This opcode|
00000ba0  20 64 6f 65 73 20 6e 6f  74 0d 64 6f 20 61 6e 79  | does not.do any|
00000bb0  74 68 69 6e 67 1a 20 61  73 1a 20 69 74 27 73 1a  |thing. as. it's.|
00000bc0  20 6e 61 6d 65 1a 20 73  75 67 67 65 73 74 73 20  | name. suggests |
00000bd0  62 75 74 20 64 6f 65 73  20 63 61 75 73 65 20 61  |but does cause a|
00000be0  20 6c 69 74 74 6c 65 20  64 65 6c 61 79 20 69 6e  | little delay in|
00000bf0  20 74 68 65 0d 6f 70 65  72 61 74 69 6f 6e 20 6f  | the.operation o|
00000c00  66 20 74 68 65 20 63 6f  64 65 2e 0d 0d 57 68 69  |f the code...Whi|
00000c10  6c 65 20 69 74 20 69 73  20 6f 6e 6c 79 20 72 65  |le it is only re|
00000c20  61 6c 6c 79 20 6e 65 63  65 73 73 61 72 79 20 74  |ally necessary t|
00000c30  6f 20 73 61 76 65 1a 20  74 68 65 20 76 61 6c 75  |o save. the valu|
00000c40  65 73 20 69 6e 20 58 20  61 6e 64 20 59 20 72 65  |es in X and Y re|
00000c50  67 69 73 74 65 72 73 0d  69 6e 20 74 68 69 73 20  |gisters.in this |
00000c60  72 6f 75 74 69 6e 65 2c  20 49 20 68 61 76 65 20  |routine, I have |
00000c70  69 6e 63 6c 75 64 65 64  20 74 68 65 20 33 20 74  |included the 3 t|
00000c80  6f 20 69 6c 6c 75 73 74  72 61 74 65 20 74 68 65  |o illustrate the|
00000c90  20 75 73 65 20 6f 66 20  74 68 65 20 73 74 61 63  | use of the stac|
00000ca0  6b 2e 20 20 0d 54 68 69  73 20 69 73 20 6f 66 74  |k.  .This is oft|
00000cb0  65 6e 20 64 6f 6e 65 20  69 6e 20 74 68 69 73 20  |en done in this |
00000cc0  77 61 79 2e 20 20 4e 6f  74 65 20 74 68 61 74 20  |way.  Note that |
00000cd0  74 68 65 20 74 68 72 65  65 20 76 61 6c 75 65 73  |the three values|
00000ce0  20 6d 75 73 74 20 62 65  20 50 55 4c 4c 65 64 0d  | must be PULLed.|
00000cf0  6f 66 66 20 69 6e 20 72  65 76 65 72 73 65 20 6f  |off in reverse o|
00000d00  72 64 65 72 2e 0d 0d 49  20 73 75 67 67 65 73 74  |rder...I suggest|
00000d10  20 79 6f 75 20 73 68 6f  75 6c 64 20 65 78 70 65  | you should expe|
00000d20  72 69 6d 65 6e 74 20 77  69 74 68 1a 20 74 68 69  |riment with. thi|
00000d30  73 20 61 6e 64 20 61 6c  73 6f 20 74 72 79 20 63  |s and also try c|
00000d40  68 61 6e 67 69 6e 67 20  74 68 65 20 4d 4f 44 45  |hanging the MODE|
00000d50  2e 20 0d 49 20 68 61 76  65 20 75 73 65 64 20 4d  |. .I have used M|
00000d60  4f 44 45 20 34 2e 20 20  49 66 20 79 6f 75 20 75  |ODE 4.  If you u|
00000d70  73 65 20 4d 4f 44 45 20  32 20 6f 72 20 35 2c 20  |se MODE 2 or 5, |
00000d80  79 6f 75 20 77 69 6c 6c  20 6e 65 65 64 20 74 6f  |you will need to|
00000d90  20 61 6c 74 65 72 20 74  68 65 20 33 39 0d 69 6e  | alter the 39.in|
00000da0  20 50 52 4f 43 72 69 67  68 74 20 74 6f 20 31 39  | PROCright to 19|
00000db0  20 74 6f 20 70 72 65 76  65 6e 74 20 74 68 65 20  | to prevent the |
00000dc0  63 68 61 72 61 63 74 65  72 20 6d 6f 76 69 6e 67  |character moving|
00000dd0  20 6f 66 66 20 74 68 65  20 73 63 72 65 65 6e 2e  | off the screen.|
00000de0  0d 0d 41 74 20 70 72 65  73 65 6e 74 2c 20 74 6f  |..At present, to|
00000df0  20 73 74 6f 70 20 74 68  65 20 70 72 6f 67 72 61  | stop the progra|
00000e00  6d 20 79 6f 75 1a 20 77  69 6c 6c 20 6e 65 65 64  |m you. will need|
00000e10  20 74 6f 20 70 72 65 73  73 20 42 52 45 41 4b 2e  | to press BREAK.|
00000e20  20 20 49 74 20 69 73 20  62 65 73 74 0d 74 6f 20  |  It is best.to |
00000e30  70 72 6f 76 69 64 65 20  66 6f 72 20 70 72 65 73  |provide for pres|
00000e40  73 69 6e 67 20 45 53 43  41 50 45 20 61 6e 64 20  |sing ESCAPE and |
00000e50  74 68 69 73 20 63 61 6e  20 62 65 20 64 6f 6e 65  |this can be done|
00000e60  20 62 79 20 75 73 69 6e  67 20 2d 0d 0d 20 20 20  | by using -..   |
00000e70  20 20 20 4c 44 41 23 31  32 39 3a 4c 44 58 23 26  |   LDA#129:LDX#&|
00000e80  38 46 3a 4c 44 59 23 26  46 46 3a 4a 53 52 6f 73  |8F:LDY#&FF:JSRos|
00000e90  62 79 74 65 20 20 20 5c  20 49 4e 4b 45 59 2d 31  |byte   \ INKEY-1|
00000ea0  31 33 20 20 45 53 43 41  50 45 0d 20 20 20 20 20  |13  ESCAPE.     |
00000eb0  20 42 43 43 63 6f 6e 74  3a 52 54 53 20 20 20 20  | BCCcont:RTS    |
00000ec0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000ed0  20 20 20 20 20 5c 20 52  65 74 75 72 6e 20 74 6f  |     \ Return to|
00000ee0  20 42 41 53 49 43 0d 20  20 20 20 20 20 2e 63 6f  | BASIC.      .co|
00000ef0  6e 74 0d 0d 54 68 69 73  20 6d 75 73 74 20 62 65  |nt..This must be|
00000f00  20 69 6e 20 74 68 65 20  6d 61 69 6e 20 6c 6f 6f  | in the main loo|
00000f10  70 20 73 69 6e 63 65 2c  1a 20 69 66 20 69 74 20  |p since,. if it |
00000f20  77 65 72 65 20 69 6e 20  61 20 73 75 62 72 6f 75  |were in a subrou|
00000f30  74 69 6e 65 2c 20 69 74  20 77 6f 75 6c 64 0d 73  |tine, it would.s|
00000f40  69 6d 70 6c 79 20 65 6e  64 20 74 68 65 20 72 6f  |imply end the ro|
00000f50  75 74 69 6e 65 20 61 6e  64 20 6e 6f 74 20 72 65  |utine and not re|
00000f60  74 75 72 6e 20 74 6f 20  42 41 53 49 43 2e 0d 0d  |turn to BASIC...|
00000f70  4d 41 4b 49 4e 47 20 43  48 4f 49 43 45 53 0d 7e  |MAKING CHOICES.~|
00000f80  7e 7e 7e 7e 7e 7e 7e 7e  7e 7e 7e 7e 7e 0d 57 68  |~~~~~~~~~~~~~.Wh|
00000f90  65 74 68 65 72 1a 20 69  74 1a 20 69 73 1a 20 74  |ether. it. is. t|
00000fa0  6f 1a 20 73 65 6c 65 63  74 1a 20 66 72 6f 6d 1a  |o. select. from.|
00000fb0  20 61 1a 20 6d 65 6e 75  20 6f 72 20 73 69 6d 70  | a. menu or simp|
00000fc0  6c 79 20 74 6f 20 61 6e  73 77 65 72 20 61 20 79  |ly to answer a y|
00000fd0  65 73 20 6f 72 20 6e 6f  0d 71 75 65 73 74 69 6f  |es or no.questio|
00000fe0  6e 2c 20 77 65 20 73 68  61 6c 6c 20 6e 65 65 64  |n, we shall need|
00000ff0  20 74 6f 20 6d 61 6b 65  20 6f 75 72 20 63 68 6f  | to make our cho|
00001000  69 63 65 2e 0d 0d 46 6f  72 20 74 68 69 73 20 77  |ice...For this w|
00001010  65 20 75 73 65 20 74 68  65 20 4f 53 20 72 6f 75  |e use the OS rou|
00001020  74 69 6e 65 20 4f 53 52  44 43 48 20 28 26 46 46  |tine OSRDCH (&FF|
00001030  45 30 29 2e 0d 0d 54 68  65 20 72 6f 75 74 69 6e  |E0)...The routin|
00001040  65 20 77 69 6c 6c 20 73  74 6f 70 20 74 68 65 20  |e will stop the |
00001050  70 72 6f 67 72 61 6d 20  61 6e 64 20 77 61 69 74  |program and wait|
00001060  20 66 6f 72 20 61 20 6b  65 79 20 74 6f 20 62 65  | for a key to be|
00001070  20 70 72 65 73 73 65 64  20 77 68 65 6e 20 69 74  | pressed when it|
00001080  0d 77 69 6c 6c 20 70 75  74 20 74 68 65 20 41 53  |.will put the AS|
00001090  43 20 76 61 6c 75 65 20  6f 66 20 74 68 65 20 6b  |C value of the k|
000010a0  65 79 20 69 6e 74 6f 20  72 65 67 69 73 74 65 72  |ey into register|
000010b0  20 41 2e 0d 0d 49 66 20  45 53 43 41 50 45 20 69  | A...If ESCAPE i|
000010c0  73 20 70 72 65 73 73 65  64 2c 20 74 68 65 20 43  |s pressed, the C|
000010d0  61 72 72 79 20 66 6c 61  67 20 69 73 1a 20 73 65  |arry flag is. se|
000010e0  74 20 73 6f 20 61 20 74  65 73 74 20 6f 66 20 74  |t so a test of t|
000010f0  68 69 73 20 66 6c 61 67  20 63 61 6e 20 62 65 0d  |his flag can be.|
00001100  75 73 65 64 20 66 6f 72  20 62 72 65 61 6b 69 6e  |used for breakin|
00001110  67 20 6f 75 74 20 6f 66  20 74 68 65 20 70 72 6f  |g out of the pro|
00001120  67 72 61 6d 20 61 6e 64  20 72 65 74 75 72 6e 69  |gram and returni|
00001130  6e 67 20 74 6f 20 42 41  53 49 43 20 2d 0d 0d 20  |ng to BASIC -.. |
00001140  20 20 20 20 20 20 20 20  2e 72 64 63 68 20 20 20  |        .rdch   |
00001150  20 20 20 4a 53 52 6f 73  72 64 63 68 0d 20 20 20  |   JSRosrdch.   |
00001160  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001170  20 42 43 43 63 6f 6e 74  0d 20 20 20 20 20 20 20  | BCCcont.       |
00001180  20 20 20 20 20 20 20 20  20 20 20 20 20 52 54 53  |             RTS|
00001190  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000011a0  20 20 5c 20 20 74 6f 20  42 41 53 49 43 0d 20 20  |  \  to BASIC.  |
000011b0  20 20 20 20 20 20 2e 63  6f 6e 74 20 20 20 20 20  |      .cont     |
000011c0  20 20 28 72 65 73 74 20  6f 66 20 70 72 6f 67 72  |  (rest of progr|
000011d0  61 6d 29 0d 0d 46 6f 72  20 61 6e 73 77 65 72 69  |am)..For answeri|
000011e0  6e 67 20 61 20 71 75 65  73 74 69 6f 6e 20 61 64  |ng a question ad|
000011f0  64 20 2d 0d 0d 20 20 20  20 20 20 20 20 20 20 20  |d -..           |
00001200  20 20 20 20 20 20 20 20  20 43 4d 50 23 41 53 43  |         CMP#ASC|
00001210  22 59 22 3a 42 45 51 20  79 65 73 0d 20 20 20 20  |"Y":BEQ yes.    |
00001220  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001230  43 4d 50 23 41 53 43 22  4e 22 3a 42 45 51 20 6e  |CMP#ASC"N":BEQ n|
00001240  6f 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |o.              |
00001250  20 20 20 20 20 20 4a 4d  50 72 64 63 68 0d 20 20  |      JMPrdch.  |
00001260  20 20 20 20 20 20 20 2e  79 65 73 20 20 20 20 20  |       .yes     |
00001270  20 20 4a 53 52 20 69 6e  73 74 72 75 63 74 69 6f  |  JSR instructio|
00001280  6e 73 20 20 20 20 20 20  5c 20 28 6f 72 20 77 68  |ns      \ (or wh|
00001290  61 74 65 76 65 72 29 0d  20 20 20 20 20 20 20 20  |atever).        |
000012a0  20 2e 6e 6f 20 20 20 20  20 20 20 20 28 72 65 73  | .no        (res|
000012b0  74 20 6f 66 20 70 72 6f  67 72 61 6d 29 0d 0d 54  |t of program)..T|
000012c0  68 69 73 20 63 61 6e 20  62 65 20 65 78 74 65 6e  |his can be exten|
000012d0  64 65 64 20 6f 72 20 61  6c 74 65 72 65 64 20 74  |ded or altered t|
000012e0  6f 20 61 6e 79 20 6b 65  79 73 2e 0d 0d 59 6f 75  |o any keys...You|
000012f0  1a 20 63 61 6e 1a 20 73  65 6c 65 63 74 1a 20 33  |. can. select. 3|
00001300  1a 20 6f 72 1a 20 6d 6f  72 65 20 63 68 6f 69 63  |. or. more choic|
00001310  65 73 20 62 79 20 61 20  73 65 72 69 65 73 20 6f  |es by a series o|
00001320  66 20 6c 65 74 74 65 72  73 20 6f 72 20 6e 75 6d  |f letters or num|
00001330  62 65 72 73 20 62 79 0d  75 73 69 6e 67 20 2d 0d  |bers by.using -.|
00001340  0d 20 20 20 20 20 20 20  20 20 20 2e 72 64 63 68  |.          .rdch|
00001350  20 20 20 20 20 20 4a 53  52 6f 73 72 64 63 68 0d  |      JSRosrdch.|
00001360  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001370  20 20 20 20 20 43 4d 50  23 41 53 43 22 31 22 3a  |     CMP#ASC"1":|
00001380  42 43 43 72 64 63 68 20  20 20 20 5c 20 62 61 63  |BCCrdch    \ bac|
00001390  6b 20 69 66 20 3c 41 53  43 22 31 22 0d 20 20 20  |k if <ASC"1".   |
000013a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000013b0  20 20 43 4d 50 23 41 53  43 22 34 22 3a 42 43 53  |  CMP#ASC"4":BCS|
000013c0  64 72 63 68 20 20 20 20  5c 20 62 61 63 6b 20 69  |drch    \ back i|
000013d0  66 20 3e 41 53 43 22 33  22 0d 20 20 20 20 20 20  |f >ASC"3".      |
000013e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 43  |               C|
000013f0  4d 50 23 41 53 43 22 31  22 3a 42 45 51 63 68 6f  |MP#ASC"1":BEQcho|
00001400  69 63 65 31 0d 20 20 20  20 20 20 20 20 20 20 20  |ice1.           |
00001410  20 20 20 20 20 20 20 20  20 20 43 4d 50 23 41 53  |          CMP#AS|
00001420  43 22 32 22 3a 42 45 51  63 68 6f 69 63 65 32 0d  |C"2":BEQchoice2.|
00001430  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001440  20 20 20 20 20 43 4d 50  23 41 53 43 22 33 22 3a  |     CMP#ASC"3":|
00001450  42 45 51 63 68 6f 69 63  65 33 0d 20 20 20 20 20  |BEQchoice3.     |
00001460  20 20 20 20 20 2e 63 68  6f 69 63 65 31 20 20 20  |     .choice1   |
00001470  4a 53 52 6f 70 74 69 6f  6e 31 3a 4a 4d 50 72 65  |JSRoption1:JMPre|
00001480  70 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |p.              |
00001490  20 20 20 20 20 20 20 4a  53 52 6f 70 74 69 6f 6e  |       JSRoption|
000014a0  32 3a 4a 4d 50 72 65 70  0d 20 20 20 20 20 20 20  |2:JMPrep.       |
000014b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4a 53  |              JS|
000014c0  52 6f 70 74 69 6f 6e 33  3a 4a 4d 50 72 65 70 0d  |Roption3:JMPrep.|
000014d0  20 20 20 20 20 20 20 20  20 20 2e 72 65 70 20 20  |          .rep  |
000014e0  20 20 20 20 20 28 72 65  73 74 20 6f 66 20 70 72  |     (rest of pr|
000014f0  6f 67 72 61 6d 29 0d 0d  54 68 65 20 73 70 65 65  |ogram)..The spee|
00001500  64 20 6f 66 20 74 68 65  20 67 61 6d 65 20 63 61  |d of the game ca|
00001510  6e 20 62 65 20 73 65 6c  65 63 74 65 64 20 62 79  |n be selected by|
00001520  20 2d 0d 0d 20 20 20 20  32 30 30 20 20 20 20 2e  | -..    200    .|
00001530  73 70 73 65 74 20 20 20  20 20 4a 53 52 6f 73 72  |spset     JSRosr|
00001540  64 63 68 0d 20 20 20 20  20 20 20 20 20 20 20 20  |dch.            |
00001550  20 20 20 20 20 20 20 20  20 20 43 4d 50 23 41 53  |          CMP#AS|
00001560  43 22 31 22 3a 42 43 43  73 70 73 65 74 0d 20 20  |C"1":BCCspset.  |
00001570  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001580  20 20 20 20 43 4d 50 23  41 53 43 22 34 22 3a 42  |    CMP#ASC"4":B|
00001590  43 53 73 70 73 65 74 0d  20 20 20 20 20 20 20 20  |CSspset.        |
000015a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 45  |              SE|
000015b0  43 3a 53 42 43 23 34 38  0d 20 20 20 20 20 20 20  |C:SBC#48.       |
000015c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 41  |               A|
000015d0  53 4c 20 41 3a 41 53 4c  20 41 3a 41 53 4c 20 41  |SL A:ASL A:ASL A|
000015e0  3a 41 53 4c 20 41 0d 20  20 20 20 20 20 20 20 20  |:ASL A.         |
000015f0  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 41  |             STA|
00001600  73 70 65 65 64 0d 0d 45  6e 74 65 72 20 74 68 69  |speed..Enter thi|
00001610  73 20 69 6e 20 74 68 65  20 70 72 6f 67 72 61 6d  |s in the program|
00001620  20 62 65 66 6f 72 65 20  74 68 65 20 6d 61 69 6e  | before the main|
00001630  20 6c 6f 6f 70 2e 0d 0d  54 68 65 20 6b 65 79 73  | loop...The keys|
00001640  20 31 20 2d 20 33 20 61  72 65 20 73 65 6c 65 63  | 1 - 3 are selec|
00001650  74 65 64 20 61 67 61 69  6e 20 74 68 65 6e 20 34  |ted again then 4|
00001660  38 20 69 73 20 73 75 62  74 72 61 63 74 65 64 20  |8 is subtracted |
00001670  66 72 6f 6d 20 74 68 65  20 41 53 43 20 76 61 6c  |from the ASC val|
00001680  75 65 0d 73 6f 20 74 68  61 74 20 74 68 65 20 76  |ue.so that the v|
00001690  61 6c 75 65 73 20 67 69  76 65 6e 20 61 72 65 20  |alues given are |
000016a0  31 2c 20 32 20 26 20 33  2e 20 20 54 68 65 20 34  |1, 2 & 3.  The 4|
000016b0  20 41 53 4c 20 41 20 73  68 69 66 74 20 74 68 65  | ASL A shift the|
000016c0  20 62 79 74 65 73 20 6c  65 66 74 20 34 0d 74 69  | bytes left 4.ti|
000016d0  6d 65 73 2c 20 74 68 69  73 20 6d 75 6c 74 69 70  |mes, this multip|
000016e0  6c 69 65 73 20 62 79 20  32 20 65 61 63 68 1a 20  |lies by 2 each. |
000016f0  74 69 6d 65 20 61 6e 64  20 74 68 75 73 20 67 69  |time and thus gi|
00001700  76 65 73 20 76 61 6c 75  75 65 73 20 66 6f 72 20  |ves valuues for |
00001710  73 70 65 65 64 20 6f 66  0d 31 36 2c 20 33 32 20  |speed of.16, 32 |
00001720  26 20 34 38 2e 0d 0d 4e  6f 74 65 20 74 68 61 74  |& 48...Note that|
00001730  20 74 68 65 20 43 61 72  72 79 20 66 6c 61 67 20  | the Carry flag |
00001740  6d 75 73 74 20 62 65 20  73 65 74 20 62 65 66 6f  |must be set befo|
00001750  72 65 20 74 68 65 20 73  75 62 74 72 61 63 74 69  |re the subtracti|
00001760  6f 6e 2e 0d 0d 49 1a 20  68 6f 70 65 1a 20 6d 79  |on...I. hope. my|
00001770  20 61 72 74 69 63 6c 65  73 20 61 72 65 20 67 69  | articles are gi|
00001780  76 69 6e 67 20 73 6f 6d  65 20 69 64 65 61 73 20  |ving some ideas |
00001790  66 6f 72 20 77 72 69 74  69 6e 67 20 70 72 6f 67  |for writing prog|
000017a0  72 61 6d 73 20 69 6e 20  4d 2f 63 6f 64 65 2e 20  |rams in M/code. |
000017b0  0d 49 66 20 74 68 65 72  65 20 61 72 65 20 61 6e  |.If there are an|
000017c0  79 20 70 72 6f 62 6c 65  6d 73 20 6f 72 20 71 75  |y problems or qu|
000017d0  65 73 74 69 6f 6e 73 20  73 6f 20 66 61 72 2c 20  |estions so far, |
000017e0  49 20 61 6d 20 61 6c 77  61 79 73 20 68 61 70 70  |I am always happ|
000017f0  79 20 74 6f 20 74 72 79  20 74 6f 0d 68 65 6c 70  |y to try to.help|
00001800  2e 20 20 41 73 20 49 20  73 61 69 64 20 6c 61 73  |.  As I said las|
00001810  74 20 74 69 6d 65 2c 20  74 68 65 20 6d 6f 72 65  |t time, the more|
00001820  20 77 65 20 65 78 70 65  72 69 6d 65 6e 74 2c 20  | we experiment, |
00001830  74 68 65 20 6d 6f 72 65  20 77 65 20 6c 65 61 72  |the more we lear|
00001840  6e 2e 0d 0d 49 20 61 6d  20 68 6f 70 69 6e 67 20  |n...I am hoping |
00001850  74 6f 20 73 68 6f 77 20  68 6f 77 20 74 6f 20 73  |to show how to s|
00001860  65 74 20 75 70 20 61 20  73 63 72 65 65 6e 20 61  |et up a screen a|
00001870  6e 64 20 68 6f 77 20 74  68 65 79 20 6d 61 79 20  |nd how they may |
00001880  62 65 20 6c 6f 61 64 65  64 20 6e 65 78 74 0d 74  |be loaded next.t|
00001890  69 6d 65 2e 0d                                    |ime..|
00001895
F/M\Ctut1.m0
F/M\Ctut1.m1
F/M\Ctut1.m2
F/M\Ctut1.m4
F/M\Ctut1.m5