Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_19.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_19.ADF
Filename: F/M\CTUT1
Read OK:
File size: 1043 bytes
Load address: 6D206576
Exec address: 742D632F
File contents
USING THE ASSEMBLER 2
~~~~~~~~~~~~~~~~~~~~~
By Richard Dimond

I hope my introductory article has encouraged some experimenting with the
assembler.  How have you been getting on?  Have you been  able to find out
how to give the commands to change MODE and the colours and clear the
screen?  These are all quite simple if you think of the VDU codes -

  MODE <num>  .mode LDA#22:JSR&FFEE:LDA#<num>:JSR&FFEE     \VDU22,<num>
  COLOUR<col> .colour LDA#17:JSR&FFEE:LDA#<col>:JSR&FFEE   \VDU17,<col>
  GCOL0,<col> .gcol LDA#18:JSR&FFEE:LDA#0:JSR&FFEE:LDA#<col>:JSR&FFEE
                                                           \VDU18,0,col
  CLS         .cls  LDA#12:JSR&FFEE                        \VDU12
  CLG         .clg  LDA#16:JSR&FFEE                        \VDU16

These could all be entered as subroutines and called with JSR<label>.  If
a variable is to be entered, this can be done by LDX#<num> .... TXA ....
as in the 'tab' routine.  Though, as they are short, it is best to enter
them in the main loop as required.

However, if you are entering a series of commands, a simpler method is to
use a loop - you will find loops used a lot in M/code, they are rather
like REPEAT/UNTIL loops in BASIC.  As I said last time, the VDU codes can
be used with the 'print' rotine  and instead of using 'tab', enter in the
data -
        .text EQUB31:EQUB<x>:EQUB<y>:EQUS"<..TEXT.."+CHR$&FF
           \VDU31,x,y:PRINT"..TEXT.."

If you think of MODE 5:COLOUR2:COLOUR129 as -
                VDU22,5,17,2,17,129

Then enter the data -
         .mode_col EQUB22:EQUB5:EQUB17:EQUB2:EQUB17:EQUB129:EQUB&FF
and use the 'print' routine as before.

While you can use the print routine in this way, it cannot be used if you
need the value 255 in the code.  This can occur with PLOT routines which I
hope to cover next time.  It is then necessary to use a different form of
loop.  You need to return from the routine after the number of values have
been printed and this can be done comparing the value of Y register -

       .comms   STX &70
                STY &71
                LDY #0
       .cloop   LDA(&70),Y
                JSR &FFEE
                INY
                CPY #<num>    / num = no. of values
                BNE cloop
                RTS

The disadvantage of this method is that the value of 'num' needs to be
altered if the number of values is changed.  It is easier to do this if it
done before the routine is called as in previous routines.

It is also better to load Y register with the number of values and to
decrement Y.  The routine is then stopped when Y reaches zero.  Alter the
routine to -
  
         .comms   STX &70
                  STY &71
                  TAY
         .cloop   LDA(&70),Y
                  JSR &FFEE
                  DEY
                  BNE cloop
                  RTS

This will need the values entered in reverse order as the addresses are
read in reverse.  This routine is used by -

                  LDA #num
                  LDX #data MOD256
                  LDY #data DIV256
                  JMP comms

The cursor can be switched by using the BASIC values in this routine -

    Cursor off - 23,1,0,0,0,0,0,0,0,0  
           on  - 23,1,1,0,0,0,0,0,0,0

Entered as EQUB0:EQUB0:etc....(reverse order)..EQUB1:EQUB23

If the the cursor is to be turned on and off in the program, it is better
to  use a subroutine -

             .cur  LDA#23
                   JSR&FFEE
                   LDA#1
                   JSR&FFEE
                   TXA
                   JSR&FFEE
                   LDX#7
              .lp  LDA#0
                   JSR&FFEE
                   DEX
                   BNElp
                   RTS

Then LDX#0 for cursor off or LDX#1 for cursor on before calling the
routine. If you add these lines at the beginning of this routine -

        .curoff LDA#1:BNEc:.curon LDA#0:TAX:.c

you may simply use JSR curoff or JSR curon.

I hope that I have given you something more to think about and to try out.  
I learnt through trying things out and by my mistakes!!

Next time I hope to give routines for PLOT, DRAW and for VDU23 characters.

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 32 0d 7e  7e 7e 7e 7e 7e 7e 7e 7e  |BLER 2.~~~~~~~~~|
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 6d  79 20 69 6e 74 72 6f 64  |I hope my introd|
00000050  75 63 74 6f 72 79 20 61  72 74 69 63 6c 65 1a 20  |uctory article. |
00000060  68 61 73 20 65 6e 63 6f  75 72 61 67 65 64 20 73  |has encouraged s|
00000070  6f 6d 65 20 65 78 70 65  72 69 6d 65 6e 74 69 6e  |ome experimentin|
00000080  67 20 77 69 74 68 20 74  68 65 0d 61 73 73 65 6d  |g with the.assem|
00000090  62 6c 65 72 2e 20 20 48  6f 77 20 68 61 76 65 20  |bler.  How have |
000000a0  79 6f 75 20 62 65 65 6e  20 67 65 74 74 69 6e 67  |you been getting|
000000b0  20 6f 6e 3f 20 20 48 61  76 65 20 79 6f 75 20 62  | on?  Have you b|
000000c0  65 65 6e 20 20 61 62 6c  65 20 74 6f 20 66 69 6e  |een  able to fin|
000000d0  64 20 6f 75 74 0d 68 6f  77 20 74 6f 20 67 69 76  |d out.how to giv|
000000e0  65 20 74 68 65 20 63 6f  6d 6d 61 6e 64 73 1a 20  |e the commands. |
000000f0  74 6f 1a 20 63 68 61 6e  67 65 1a 20 4d 4f 44 45  |to. change. MODE|
00000100  1a 20 61 6e 64 1a 20 74  68 65 20 63 6f 6c 6f 75  |. and. the colou|
00000110  72 73 20 61 6e 64 20 63  6c 65 61 72 20 74 68 65  |rs and clear the|
00000120  0d 73 63 72 65 65 6e 3f  20 20 54 68 65 73 65 20  |.screen?  These |
00000130  61 72 65 20 61 6c 6c 20  71 75 69 74 65 20 73 69  |are all quite si|
00000140  6d 70 6c 65 20 69 66 20  79 6f 75 20 74 68 69 6e  |mple if you thin|
00000150  6b 20 6f 66 20 74 68 65  20 56 44 55 20 63 6f 64  |k of the VDU cod|
00000160  65 73 20 2d 0d 0d 20 20  4d 4f 44 45 20 3c 6e 75  |es -..  MODE <nu|
00000170  6d 3e 20 20 2e 6d 6f 64  65 20 4c 44 41 23 32 32  |m>  .mode LDA#22|
00000180  3a 4a 53 52 26 46 46 45  45 3a 4c 44 41 23 3c 6e  |:JSR&FFEE:LDA#<n|
00000190  75 6d 3e 3a 4a 53 52 26  46 46 45 45 20 20 20 20  |um>:JSR&FFEE    |
000001a0  20 5c 56 44 55 32 32 2c  3c 6e 75 6d 3e 0d 20 20  | \VDU22,<num>.  |
000001b0  43 4f 4c 4f 55 52 3c 63  6f 6c 3e 20 2e 63 6f 6c  |COLOUR<col> .col|
000001c0  6f 75 72 20 4c 44 41 23  31 37 3a 4a 53 52 26 46  |our LDA#17:JSR&F|
000001d0  46 45 45 3a 4c 44 41 23  3c 63 6f 6c 3e 3a 4a 53  |FEE:LDA#<col>:JS|
000001e0  52 26 46 46 45 45 20 20  20 5c 56 44 55 31 37 2c  |R&FFEE   \VDU17,|
000001f0  3c 63 6f 6c 3e 0d 20 20  47 43 4f 4c 30 2c 3c 63  |<col>.  GCOL0,<c|
00000200  6f 6c 3e 20 2e 67 63 6f  6c 20 4c 44 41 23 31 38  |ol> .gcol LDA#18|
00000210  3a 4a 53 52 26 46 46 45  45 3a 4c 44 41 23 30 3a  |:JSR&FFEE:LDA#0:|
00000220  4a 53 52 26 46 46 45 45  3a 4c 44 41 23 3c 63 6f  |JSR&FFEE:LDA#<co|
00000230  6c 3e 3a 4a 53 52 26 46  46 45 45 0d 20 20 20 20  |l>:JSR&FFEE.    |
00000240  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000270  20 20 20 20 20 20 20 5c  56 44 55 31 38 2c 30 2c  |       \VDU18,0,|
00000280  63 6f 6c 0d 20 20 43 4c  53 20 20 20 20 20 20 20  |col.  CLS       |
00000290  20 20 2e 63 6c 73 20 20  4c 44 41 23 31 32 3a 4a  |  .cls  LDA#12:J|
000002a0  53 52 26 46 46 45 45 20  20 20 20 20 20 20 20 20  |SR&FFEE         |
000002b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
000002c0  56 44 55 31 32 0d 20 20  43 4c 47 20 20 20 20 20  |VDU12.  CLG     |
000002d0  20 20 20 20 2e 63 6c 67  20 20 4c 44 41 23 31 36  |    .clg  LDA#16|
000002e0  3a 4a 53 52 26 46 46 45  45 20 20 20 20 20 20 20  |:JSR&FFEE       |
000002f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000300  20 5c 56 44 55 31 36 0d  0d 54 68 65 73 65 20 63  | \VDU16..These c|
00000310  6f 75 6c 64 20 61 6c 6c  20 62 65 20 65 6e 74 65  |ould all be ente|
00000320  72 65 64 1a 20 61 73 20  73 75 62 72 6f 75 74 69  |red. as subrouti|
00000330  6e 65 73 20 61 6e 64 20  63 61 6c 6c 65 64 20 77  |nes and called w|
00000340  69 74 68 20 4a 53 52 3c  6c 61 62 65 6c 3e 2e 20  |ith JSR<label>. |
00000350  20 49 66 0d 61 20 76 61  72 69 61 62 6c 65 20 69  | If.a variable i|
00000360  73 20 74 6f 20 62 65 20  65 6e 74 65 72 65 64 2c  |s to be entered,|
00000370  1a 20 74 68 69 73 1a 20  63 61 6e 20 62 65 20 64  |. this. can be d|
00000380  6f 6e 65 20 62 79 20 4c  44 58 23 3c 6e 75 6d 3e  |one by LDX#<num>|
00000390  20 2e 2e 2e 2e 20 54 58  41 20 2e 2e 2e 2e 0d 61  | .... TXA .....a|
000003a0  73 20 69 6e 20 74 68 65  20 27 74 61 62 27 20 72  |s in the 'tab' r|
000003b0  6f 75 74 69 6e 65 2e 20  20 54 68 6f 75 67 68 2c  |outine.  Though,|
000003c0  20 61 73 20 74 68 65 79  1a 20 61 72 65 1a 20 73  | as they. are. s|
000003d0  68 6f 72 74 2c 20 69 74  20 69 73 20 62 65 73 74  |hort, it is best|
000003e0  20 74 6f 20 65 6e 74 65  72 0d 74 68 65 6d 20 69  | to enter.them i|
000003f0  6e 20 74 68 65 20 6d 61  69 6e 20 6c 6f 6f 70 20  |n the main loop |
00000400  61 73 20 72 65 71 75 69  72 65 64 2e 0d 0d 48 6f  |as required...Ho|
00000410  77 65 76 65 72 2c 20 69  66 20 79 6f 75 20 61 72  |wever, if you ar|
00000420  65 20 65 6e 74 65 72 69  6e 67 20 61 20 73 65 72  |e entering a ser|
00000430  69 65 73 1a 20 6f 66 20  63 6f 6d 6d 61 6e 64 73  |ies. of commands|
00000440  2c 20 61 20 73 69 6d 70  6c 65 72 20 6d 65 74 68  |, a simpler meth|
00000450  6f 64 20 69 73 20 74 6f  0d 75 73 65 20 61 20 6c  |od is to.use a l|
00000460  6f 6f 70 20 2d 20 79 6f  75 20 77 69 6c 6c 20 66  |oop - you will f|
00000470  69 6e 64 20 6c 6f 6f 70  73 1a 20 75 73 65 64 1a  |ind loops. used.|
00000480  20 61 1a 20 6c 6f 74 1a  20 69 6e 20 4d 2f 63 6f  | a. lot. in M/co|
00000490  64 65 2c 20 74 68 65 79  20 61 72 65 20 72 61 74  |de, they are rat|
000004a0  68 65 72 0d 6c 69 6b 65  20 52 45 50 45 41 54 2f  |her.like REPEAT/|
000004b0  55 4e 54 49 4c 20 6c 6f  6f 70 73 20 69 6e 20 42  |UNTIL loops in B|
000004c0  41 53 49 43 2e 20 20 41  73 20 49 20 73 61 69 64  |ASIC.  As I said|
000004d0  20 6c 61 73 74 20 74 69  6d 65 2c 20 74 68 65 20  | last time, the |
000004e0  56 44 55 1a 20 63 6f 64  65 73 20 63 61 6e 0d 62  |VDU. codes can.b|
000004f0  65 1a 20 75 73 65 64 20  77 69 74 68 20 74 68 65  |e. used with the|
00000500  20 27 70 72 69 6e 74 27  20 72 6f 74 69 6e 65 20  | 'print' rotine |
00000510  20 61 6e 64 20 69 6e 73  74 65 61 64 20 6f 66 20  | and instead of |
00000520  75 73 69 6e 67 20 27 74  61 62 27 2c 20 65 6e 74  |using 'tab', ent|
00000530  65 72 20 69 6e 20 74 68  65 0d 64 61 74 61 20 2d  |er in the.data -|
00000540  0d 20 20 20 20 20 20 20  20 2e 74 65 78 74 20 45  |.        .text E|
00000550  51 55 42 33 31 3a 45 51  55 42 3c 78 3e 3a 45 51  |QUB31:EQUB<x>:EQ|
00000560  55 42 3c 79 3e 3a 45 51  55 53 22 3c 2e 2e 54 45  |UB<y>:EQUS"<..TE|
00000570  58 54 2e 2e 22 2b 43 48  52 24 26 46 46 0d 20 20  |XT.."+CHR$&FF.  |
00000580  20 20 20 20 20 20 20 20  20 5c 56 44 55 33 31 2c  |         \VDU31,|
00000590  78 2c 79 3a 50 52 49 4e  54 22 2e 2e 54 45 58 54  |x,y:PRINT"..TEXT|
000005a0  2e 2e 22 0d 0d 49 66 20  79 6f 75 20 74 68 69 6e  |.."..If you thin|
000005b0  6b 20 6f 66 20 4d 4f 44  45 20 35 3a 43 4f 4c 4f  |k of MODE 5:COLO|
000005c0  55 52 32 3a 43 4f 4c 4f  55 52 31 32 39 20 61 73  |UR2:COLOUR129 as|
000005d0  20 2d 0d 20 20 20 20 20  20 20 20 20 20 20 20 20  | -.             |
000005e0  20 20 20 56 44 55 32 32  2c 35 2c 31 37 2c 32 2c  |   VDU22,5,17,2,|
000005f0  31 37 2c 31 32 39 0d 0d  54 68 65 6e 20 65 6e 74  |17,129..Then ent|
00000600  65 72 20 74 68 65 20 64  61 74 61 20 2d 0d 20 20  |er the data -.  |
00000610  20 20 20 20 20 20 20 2e  6d 6f 64 65 5f 63 6f 6c  |       .mode_col|
00000620  20 45 51 55 42 32 32 3a  45 51 55 42 35 3a 45 51  | EQUB22:EQUB5:EQ|
00000630  55 42 31 37 3a 45 51 55  42 32 3a 45 51 55 42 31  |UB17:EQUB2:EQUB1|
00000640  37 3a 45 51 55 42 31 32  39 3a 45 51 55 42 26 46  |7:EQUB129:EQUB&F|
00000650  46 0d 61 6e 64 20 75 73  65 20 74 68 65 20 27 70  |F.and use the 'p|
00000660  72 69 6e 74 27 20 72 6f  75 74 69 6e 65 20 61 73  |rint' routine as|
00000670  20 62 65 66 6f 72 65 2e  0d 0d 57 68 69 6c 65 20  | before...While |
00000680  79 6f 75 20 63 61 6e 20  75 73 65 20 74 68 65 20  |you can use the |
00000690  70 72 69 6e 74 20 72 6f  75 74 69 6e 65 1a 20 69  |print routine. i|
000006a0  6e 20 74 68 69 73 20 77  61 79 2c 20 69 74 20 63  |n this way, it c|
000006b0  61 6e 6e 6f 74 20 62 65  20 75 73 65 64 20 69 66  |annot be used if|
000006c0  20 79 6f 75 0d 6e 65 65  64 20 74 68 65 20 76 61  | you.need the va|
000006d0  6c 75 65 20 32 35 35 20  69 6e 20 74 68 65 20 63  |lue 255 in the c|
000006e0  6f 64 65 2e 20 20 54 68  69 73 20 63 61 6e 20 6f  |ode.  This can o|
000006f0  63 63 75 72 20 77 69 74  68 20 50 4c 4f 54 20 72  |ccur with PLOT r|
00000700  6f 75 74 69 6e 65 73 20  77 68 69 63 68 20 49 0d  |outines which I.|
00000710  68 6f 70 65 20 74 6f 20  63 6f 76 65 72 20 6e 65  |hope to cover ne|
00000720  78 74 20 74 69 6d 65 2e  1a 20 20 49 74 20 69 73  |xt time..  It is|
00000730  20 74 68 65 6e 20 6e 65  63 65 73 73 61 72 79 20  | then necessary |
00000740  74 6f 20 75 73 65 20 61  20 64 69 66 66 65 72 65  |to use a differe|
00000750  6e 74 20 66 6f 72 6d 20  6f 66 0d 6c 6f 6f 70 2e  |nt form of.loop.|
00000760  20 20 59 6f 75 20 6e 65  65 64 20 74 6f 20 72 65  |  You need to re|
00000770  74 75 72 6e 20 66 72 6f  6d 20 74 68 65 20 72 6f  |turn from the ro|
00000780  75 74 69 6e 65 20 61 66  74 65 72 20 74 68 65 20  |utine after the |
00000790  6e 75 6d 62 65 72 20 6f  66 20 76 61 6c 75 65 73  |number of values|
000007a0  20 68 61 76 65 0d 62 65  65 6e 20 70 72 69 6e 74  | have.been print|
000007b0  65 64 20 61 6e 64 20 74  68 69 73 20 63 61 6e 20  |ed and this can |
000007c0  62 65 20 64 6f 6e 65 20  63 6f 6d 70 61 72 69 6e  |be done comparin|
000007d0  67 20 74 68 65 20 76 61  6c 75 65 20 6f 66 20 59  |g the value of Y|
000007e0  20 72 65 67 69 73 74 65  72 20 2d 0d 0d 20 20 20  | register -..   |
000007f0  20 20 20 20 2e 63 6f 6d  6d 73 20 20 20 53 54 58  |    .comms   STX|
00000800  20 26 37 30 0d 20 20 20  20 20 20 20 20 20 20 20  | &70.           |
00000810  20 20 20 20 20 53 54 59  20 26 37 31 0d 20 20 20  |     STY &71.   |
00000820  20 20 20 20 20 20 20 20  20 20 20 20 20 4c 44 59  |             LDY|
00000830  20 23 30 0d 20 20 20 20  20 20 20 2e 63 6c 6f 6f  | #0.       .cloo|
00000840  70 20 20 20 4c 44 41 28  26 37 30 29 2c 59 0d 20  |p   LDA(&70),Y. |
00000850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4a  |               J|
00000860  53 52 20 26 46 46 45 45  0d 20 20 20 20 20 20 20  |SR &FFEE.       |
00000870  20 20 20 20 20 20 20 20  20 49 4e 59 0d 20 20 20  |         INY.   |
00000880  20 20 20 20 20 20 20 20  20 20 20 20 20 43 50 59  |             CPY|
00000890  20 23 3c 6e 75 6d 3e 20  20 20 20 2f 20 6e 75 6d  | #<num>    / num|
000008a0  20 3d 20 6e 6f 2e 20 6f  66 20 76 61 6c 75 65 73  | = no. of values|
000008b0  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
000008c0  20 42 4e 45 20 63 6c 6f  6f 70 0d 20 20 20 20 20  | BNE cloop.     |
000008d0  20 20 20 20 20 20 20 20  20 20 20 52 54 53 0d 0d  |           RTS..|
000008e0  54 68 65 1a 20 64 69 73  61 64 76 61 6e 74 61 67  |The. disadvantag|
000008f0  65 20 6f 66 20 74 68 69  73 20 6d 65 74 68 6f 64  |e of this method|
00000900  20 69 73 20 74 68 61 74  20 74 68 65 20 76 61 6c  | is that the val|
00000910  75 65 20 6f 66 20 27 6e  75 6d 27 1a 20 6e 65 65  |ue of 'num'. nee|
00000920  64 73 1a 20 74 6f 1a 20  62 65 0d 61 6c 74 65 72  |ds. to. be.alter|
00000930  65 64 20 69 66 20 74 68  65 20 6e 75 6d 62 65 72  |ed if the number|
00000940  20 6f 66 20 76 61 6c 75  65 73 20 69 73 20 63 68  | of values is ch|
00000950  61 6e 67 65 64 2e 20 20  49 74 20 69 73 20 65 61  |anged.  It is ea|
00000960  73 69 65 72 20 74 6f 20  64 6f 20 74 68 69 73 20  |sier to do this |
00000970  69 66 20 69 74 0d 64 6f  6e 65 20 62 65 66 6f 72  |if it.done befor|
00000980  65 20 74 68 65 20 72 6f  75 74 69 6e 65 20 69 73  |e the routine is|
00000990  20 63 61 6c 6c 65 64 20  61 73 20 69 6e 20 70 72  | called as in pr|
000009a0  65 76 69 6f 75 73 20 72  6f 75 74 69 6e 65 73 2e  |evious routines.|
000009b0  0d 0d 49 74 20 69 73 1a  20 61 6c 73 6f 1a 20 62  |..It is. also. b|
000009c0  65 74 74 65 72 1a 20 74  6f 1a 20 6c 6f 61 64 1a  |etter. to. load.|
000009d0  20 59 20 72 65 67 69 73  74 65 72 20 77 69 74 68  | Y register with|
000009e0  20 74 68 65 20 6e 75 6d  62 65 72 20 6f 66 20 76  | the number of v|
000009f0  61 6c 75 65 73 20 61 6e  64 20 74 6f 0d 64 65 63  |alues and to.dec|
00000a00  72 65 6d 65 6e 74 20 59  2e 20 20 54 68 65 20 72  |rement Y.  The r|
00000a10  6f 75 74 69 6e 65 20 69  73 20 74 68 65 6e 20 73  |outine is then s|
00000a20  74 6f 70 70 65 64 1a 20  77 68 65 6e 20 59 20 72  |topped. when Y r|
00000a30  65 61 63 68 65 73 20 7a  65 72 6f 2e 20 20 41 6c  |eaches zero.  Al|
00000a40  74 65 72 20 74 68 65 0d  72 6f 75 74 69 6e 65 20  |ter the.routine |
00000a50  74 6f 20 2d 0d 20 20 0d  20 20 20 20 20 20 20 20  |to -.  .        |
00000a60  20 2e 63 6f 6d 6d 73 20  20 20 53 54 58 20 26 37  | .comms   STX &7|
00000a70  30 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0.              |
00000a80  20 20 20 20 53 54 59 20  26 37 31 0d 20 20 20 20  |    STY &71.    |
00000a90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 54 41  |              TA|
00000aa0  59 0d 20 20 20 20 20 20  20 20 20 2e 63 6c 6f 6f  |Y.         .cloo|
00000ab0  70 20 20 20 4c 44 41 28  26 37 30 29 2c 59 0d 20  |p   LDA(&70),Y. |
00000ac0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000ad0  20 4a 53 52 20 26 46 46  45 45 0d 20 20 20 20 20  | JSR &FFEE.     |
00000ae0  20 20 20 20 20 20 20 20  20 20 20 20 20 44 45 59  |             DEY|
00000af0  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00000b00  20 20 20 42 4e 45 20 63  6c 6f 6f 70 0d 20 20 20  |   BNE cloop.   |
00000b10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 52  |               R|
00000b20  54 53 0d 0d 54 68 69 73  20 77 69 6c 6c 20 6e 65  |TS..This will ne|
00000b30  65 64 20 74 68 65 20 76  61 6c 75 65 73 20 65 6e  |ed the values en|
00000b40  74 65 72 65 64 20 69 6e  20 72 65 76 65 72 73 65  |tered in reverse|
00000b50  1a 20 6f 72 64 65 72 1a  20 61 73 1a 20 74 68 65  |. order. as. the|
00000b60  20 61 64 64 72 65 73 73  65 73 20 61 72 65 0d 72  | addresses are.r|
00000b70  65 61 64 20 69 6e 20 72  65 76 65 72 73 65 2e 20  |ead in reverse. |
00000b80  20 54 68 69 73 20 72 6f  75 74 69 6e 65 20 69 73  | This routine is|
00000b90  20 75 73 65 64 20 62 79  20 2d 0d 0d 20 20 20 20  | used by -..    |
00000ba0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
00000bb0  41 20 23 6e 75 6d 0d 20  20 20 20 20 20 20 20 20  |A #num.         |
00000bc0  20 20 20 20 20 20 20 20  20 4c 44 58 20 23 64 61  |         LDX #da|
00000bd0  74 61 20 4d 4f 44 32 35  36 0d 20 20 20 20 20 20  |ta MOD256.      |
00000be0  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 59 20  |            LDY |
00000bf0  23 64 61 74 61 20 44 49  56 32 35 36 0d 20 20 20  |#data DIV256.   |
00000c00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4a  |               J|
00000c10  4d 50 20 63 6f 6d 6d 73  0d 0d 54 68 65 20 63 75  |MP comms..The cu|
00000c20  72 73 6f 72 20 63 61 6e  20 62 65 20 73 77 69 74  |rsor can be swit|
00000c30  63 68 65 64 20 62 79 20  75 73 69 6e 67 20 74 68  |ched by using th|
00000c40  65 20 42 41 53 49 43 20  76 61 6c 75 65 73 20 69  |e BASIC values i|
00000c50  6e 20 74 68 69 73 20 72  6f 75 74 69 6e 65 20 2d  |n this routine -|
00000c60  0d 0d 20 20 20 20 43 75  72 73 6f 72 20 6f 66 66  |..    Cursor off|
00000c70  20 2d 20 32 33 2c 31 2c  30 2c 30 2c 30 2c 30 2c  | - 23,1,0,0,0,0,|
00000c80  30 2c 30 2c 30 2c 30 20  20 0d 20 20 20 20 20 20  |0,0,0,0  .      |
00000c90  20 20 20 20 20 6f 6e 20  20 2d 20 32 33 2c 31 2c  |     on  - 23,1,|
00000ca0  31 2c 30 2c 30 2c 30 2c  30 2c 30 2c 30 2c 30 0d  |1,0,0,0,0,0,0,0.|
00000cb0  0d 45 6e 74 65 72 65 64  20 61 73 20 45 51 55 42  |.Entered as EQUB|
00000cc0  30 3a 45 51 55 42 30 3a  65 74 63 2e 2e 2e 2e 28  |0:EQUB0:etc....(|
00000cd0  72 65 76 65 72 73 65 20  6f 72 64 65 72 29 2e 2e  |reverse order)..|
00000ce0  45 51 55 42 31 3a 45 51  55 42 32 33 0d 0d 49 66  |EQUB1:EQUB23..If|
00000cf0  20 74 68 65 20 74 68 65  20 63 75 72 73 6f 72 1a  | the the cursor.|
00000d00  20 69 73 20 74 6f 20 62  65 20 74 75 72 6e 65 64  | is to be turned|
00000d10  20 6f 6e 20 61 6e 64 20  6f 66 66 20 69 6e 20 74  | on and off in t|
00000d20  68 65 20 70 72 6f 67 72  61 6d 2c 20 69 74 20 69  |he program, it i|
00000d30  73 20 62 65 74 74 65 72  0d 74 6f 20 20 75 73 65  |s better.to  use|
00000d40  20 61 20 73 75 62 72 6f  75 74 69 6e 65 20 2d 0d  | a subroutine -.|
00000d50  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 2e 63  |.             .c|
00000d60  75 72 20 20 4c 44 41 23  32 33 0d 20 20 20 20 20  |ur  LDA#23.     |
00000d70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4a 53  |              JS|
00000d80  52 26 46 46 45 45 0d 20  20 20 20 20 20 20 20 20  |R&FFEE.         |
00000d90  20 20 20 20 20 20 20 20  20 20 4c 44 41 23 31 0d  |          LDA#1.|
00000da0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000db0  20 20 20 4a 53 52 26 46  46 45 45 0d 20 20 20 20  |   JSR&FFEE.    |
00000dc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 54  |               T|
00000dd0  58 41 0d 20 20 20 20 20  20 20 20 20 20 20 20 20  |XA.             |
00000de0  20 20 20 20 20 20 4a 53  52 26 46 46 45 45 0d 20  |      JSR&FFEE. |
00000df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e00  20 20 4c 44 58 23 37 0d  20 20 20 20 20 20 20 20  |  LDX#7.        |
00000e10  20 20 20 20 20 20 2e 6c  70 20 20 4c 44 41 23 30  |      .lp  LDA#0|
00000e20  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00000e30  20 20 20 20 4a 53 52 26  46 46 45 45 0d 20 20 20  |    JSR&FFEE.   |
00000e40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e50  44 45 58 0d 20 20 20 20  20 20 20 20 20 20 20 20  |DEX.            |
00000e60  20 20 20 20 20 20 20 42  4e 45 6c 70 0d 20 20 20  |       BNElp.   |
00000e70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e80  52 54 53 0d 0d 54 68 65  6e 20 4c 44 58 23 30 20  |RTS..Then LDX#0 |
00000e90  66 6f 72 20 63 75 72 73  6f 72 20 6f 66 66 1a 20  |for cursor off. |
00000ea0  6f 72 1a 20 4c 44 58 23  31 1a 20 66 6f 72 1a 20  |or. LDX#1. for. |
00000eb0  63 75 72 73 6f 72 1a 20  6f 6e 1a 20 62 65 66 6f  |cursor. on. befo|
00000ec0  72 65 1a 20 63 61 6c 6c  69 6e 67 20 74 68 65 0d  |re. calling the.|
00000ed0  72 6f 75 74 69 6e 65 2e  20 49 66 20 79 6f 75 20  |routine. If you |
00000ee0  61 64 64 20 74 68 65 73  65 20 6c 69 6e 65 73 20  |add these lines |
00000ef0  61 74 20 74 68 65 20 62  65 67 69 6e 6e 69 6e 67  |at the beginning|
00000f00  20 6f 66 20 74 68 69 73  20 72 6f 75 74 69 6e 65  | of this routine|
00000f10  20 2d 0d 0d 20 20 20 20  20 20 20 20 2e 63 75 72  | -..        .cur|
00000f20  6f 66 66 20 4c 44 41 23  31 3a 42 4e 45 63 3a 2e  |off LDA#1:BNEc:.|
00000f30  63 75 72 6f 6e 20 4c 44  41 23 30 3a 54 41 58 3a  |curon LDA#0:TAX:|
00000f40  2e 63 0d 0d 79 6f 75 20  6d 61 79 20 73 69 6d 70  |.c..you may simp|
00000f50  6c 79 20 75 73 65 20 4a  53 52 20 63 75 72 6f 66  |ly use JSR curof|
00000f60  66 20 6f 72 20 4a 53 52  20 63 75 72 6f 6e 2e 0d  |f or JSR curon..|
00000f70  0d 49 20 68 6f 70 65 20  74 68 61 74 20 49 20 68  |.I hope that I h|
00000f80  61 76 65 20 67 69 76 65  6e 20 79 6f 75 20 73 6f  |ave given you so|
00000f90  6d 65 74 68 69 6e 67 20  6d 6f 72 65 20 74 6f 20  |mething more to |
00000fa0  74 68 69 6e 6b 20 61 62  6f 75 74 20 61 6e 64 20  |think about and |
00000fb0  74 6f 20 74 72 79 20 6f  75 74 2e 20 20 0d 49 20  |to try out.  .I |
00000fc0  6c 65 61 72 6e 74 20 74  68 72 6f 75 67 68 20 74  |learnt through t|
00000fd0  72 79 69 6e 67 20 74 68  69 6e 67 73 20 6f 75 74  |rying things out|
00000fe0  20 61 6e 64 20 62 79 20  6d 79 20 6d 69 73 74 61  | and by my mista|
00000ff0  6b 65 73 21 21 0d 0d 4e  65 78 74 20 74 69 6d 65  |kes!!..Next time|
00001000  20 49 20 68 6f 70 65 20  74 6f 20 67 69 76 65 20  | I hope to give |
00001010  72 6f 75 74 69 6e 65 73  20 66 6f 72 20 50 4c 4f  |routines for PLO|
00001020  54 2c 20 44 52 41 57 20  61 6e 64 20 66 6f 72 20  |T, DRAW and for |
00001030  56 44 55 32 33 20 63 68  61 72 61 63 74 65 72 73  |VDU23 characters|
00001040  2e 0d 0d                                          |...|
00001043
F/M\CTUT1.m0
F/M\CTUT1.m1
F/M\CTUT1.m2
F/M\CTUT1.m4
F/M\CTUT1.m5