Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_27.ADF » P/+ADEXt1

P/+ADEXt1

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_27.ADF
Filename: P/+ADEXt1
Read OK:
File size: 168D bytes
Load address: 2B204556
Exec address: 58454441
File contents
ADFSEXPO M/CODE VERSION
~~~~~~~~~~~~~~~~~~~~~~~
By Richard Dimond

As promised in my earlier description of the BASIC version, I now submit
the M/code version.

This is not only quicker in operation, it is easier to use as it is run
with a * command.  Also being coded, it can be used with the AutoRom
program or  could be written for storing in SW RAM.

In doing the coding I have made some small improvements.  I have turned
the flashing cursor off as this is not needed and when quitting the
program, the Elk is returned to MODE 6.

The code is assembled at Q% with addresses for P% at &2000.  This is done
using OPTs 4 - 6 as in my Mr Miner program but the DIM Q% &1000 (line90)
reserves the space for the code above TOP.  This allows the code to be set
up whether PAGE is at &E00 or &1D00.

The addresses for the variables are set in lines 140 - 180.  Some
addresses are used for two variables but this doesn't matter as these are
not used at the same time.

I will just describe in detail the parts which have not been covered
before and explain these in the order they occur, referring to the lines
which create the code.

Lines 220 - 270 create the opening screen as described in my tutorial
series.  Lines 270,290 stop the program until RETURN is pressed.  Line 280
allows you to exit the program by pressing ESCAPE as this sets the carry
flag and then the code returns to BASIC.

The routine 'readdisc', lines 600 - 630, first gives the command *MOUNT. 
This uses the OS routine OSCLI (&FFF7) with X and Y registers pointing to
the address of the command data at line 2810.   OSWORD with A register=&72
is used with parameter block (line 2800) set as in the BASIC version. 
This reads the two sectors of the fs map to the address W%.  I have set
this to an address just below the screen memory area.  This can be altered
if it is not convenient simply by altering the value of W% and
re-assembling the code.

Line 300 sets COLUUR 2 to Blue and turns off the cursor.

The routine 'vars' (lines1100 - 1260) is next called.  This first finds
the value in address W%+&1FE (X%+Y) and stores this in 'size'.  This is
the number of used sections of the disc.  The two bytes at W%+&FE are
found and stored in the two bytes of 'sectors'.  They are also stored in
'tracks' and then the bits manipulated (lines 1160 - 1190) to divide the
value by 16 to give the number of tracks.

The BASIC program then divided by 80 to give the number of sides.  This is
not so easy to do in m/code and also, having a disc that would only format
completely as a 40 track disc, I found this then gave sides as 0!!  I then
thought that tracks can only have the values 160, 80 or 40.  So I have
compared tracks with 160 and if equal 2 is printed and, if not equal, to
print 1 (lines 1200 - 1220) - much simpler!!

The value of sectors is also stored at discsize+1 and +2.  This gives the
value of discsize as sectors*256, ie the number of bytes on the disc.

Line 1250 sets up the character number 224 using VDU23.  A comparison is
made of the value of sides and, if equal to 1 the character bytes are 224,
and 192 if not.  This gives a narrower character for a double sided disc.

The routine 'grid' (lines 1300 -1690) is rather complex but consists of
several sections.  Line 1310 uses the data 'd4' (line 2840), first to set
the background colour to red and setting the graphics window.  After the
window is cleared, the screen is returned normal.  The foreground colour
is then set to white and the background to black.

The two sections lines 1320 - 1400 and 1410 - 1490, print the grid using
the routine 'plotpt' to set the plot points.

The first draws the vertical lines.  The number of lines to be drawn are
loaded into 'count' and the four co-ordinate bytes of the variable 'plot'
are set to zero (line 1420).  The loop 'vlp' then draws the lines.  The
two calls to the routine "plotpt' change the Y co-ords to draw a line on
the X co-ord (initially zero).  The X co-ord is increased by adding 16
each time round the loop and 'count' decreased until this is zero and then
the second section draws the horizontal lines in the same way.

The third section (lines 1500 - 1690) prints the track numbers and short
vertical lines underneath.  Line 1510 sets count to 8, the X co-ord, hex
and trkno to zero.  

The number of sides is then checked, if this is two, the variable 'diff'
is equal to 20 otherwise it equal to 10.  The loop 'vlp2' first draws the
short line using 'plotpt' then the value in trkno is compared and if equal
to zero, a zero is printed (lines 1570 - 1590).  The value of 'diff' is
added and 192 added to the X co-ord before looping back to 'vlp2'.  Since
trkno is not zero, the track numbers are now printed using the routine
'decprt' (lines 650 - 1090).  This routine for printing a decimal number
was  a routine given in the Micro User Sep 1990.  This is used complete as
I do not know another routine to do this.  The comparison in line 1640
stops the printing of the final track number and ends the routine.

The routine 'info' prints the tracks heading and the remaining printing as
before using data lines 2850 & 2860 and the 'decprt' routine for printing
the values.                                                               

The routine 'key' prints the key to the colours.  For each of the four
colours, the co-ords X and Y and the two colour numbers C1 and C2 are set
before the routine 'sqr' is called.  This sets the colour C1 for key and
draws a solid square by using PLOT code 85 twice.  The colour is changed
to C2 and the outline drawn.  The program returns to 'info' for the
printing.

00000000  0d 41 44 46 53 45 58 50  4f 20 4d 2f 43 4f 44 45  |.ADFSEXPO M/CODE|
00000010  20 56 45 52 53 49 4f 4e  0d 7e 7e 7e 7e 7e 7e 7e  | VERSION.~~~~~~~|
00000020  7e 7e 7e 7e 7e 7e 7e 7e  7e 7e 7e 7e 7e 7e 7e 7e  |~~~~~~~~~~~~~~~~|
00000030  0d 42 79 20 52 69 63 68  61 72 64 20 44 69 6d 6f  |.By Richard Dimo|
00000040  6e 64 0d 0d 41 73 1a 20  70 72 6f 6d 69 73 65 64  |nd..As. promised|
00000050  1a 20 69 6e 20 6d 79 20  65 61 72 6c 69 65 72 20  |. in my earlier |
00000060  64 65 73 63 72 69 70 74  69 6f 6e 20 6f 66 20 74  |description of t|
00000070  68 65 20 42 41 53 49 43  20 76 65 72 73 69 6f 6e  |he BASIC version|
00000080  2c 20 49 20 6e 6f 77 20  73 75 62 6d 69 74 0d 74  |, I now submit.t|
00000090  68 65 20 4d 2f 63 6f 64  65 20 76 65 72 73 69 6f  |he M/code versio|
000000a0  6e 2e 0d 0d 54 68 69 73  20 69 73 20 6e 6f 74 20  |n...This is not |
000000b0  6f 6e 6c 79 20 71 75 69  63 6b 65 72 1a 20 69 6e  |only quicker. in|
000000c0  1a 20 6f 70 65 72 61 74  69 6f 6e 2c 1a 20 69 74  |. operation,. it|
000000d0  20 69 73 20 65 61 73 69  65 72 20 74 6f 20 75 73  | is easier to us|
000000e0  65 20 61 73 20 69 74 20  69 73 20 72 75 6e 0d 77  |e as it is run.w|
000000f0  69 74 68 20 61 20 2a 20  63 6f 6d 6d 61 6e 64 2e  |ith a * command.|
00000100  20 20 41 6c 73 6f 20 62  65 69 6e 67 20 63 6f 64  |  Also being cod|
00000110  65 64 2c 20 69 74 1a 20  63 61 6e 1a 20 62 65 1a  |ed, it. can. be.|
00000120  20 75 73 65 64 1a 20 77  69 74 68 1a 20 74 68 65  | used. with. the|
00000130  1a 20 41 75 74 6f 52 6f  6d 0d 70 72 6f 67 72 61  |. AutoRom.progra|
00000140  6d 20 6f 72 20 20 63 6f  75 6c 64 20 62 65 20 77  |m or  could be w|
00000150  72 69 74 74 65 6e 20 66  6f 72 20 73 74 6f 72 69  |ritten for stori|
00000160  6e 67 20 69 6e 20 53 57  20 52 41 4d 2e 0d 0d 49  |ng in SW RAM...I|
00000170  6e 20 64 6f 69 6e 67 20  74 68 65 20 63 6f 64 69  |n doing the codi|
00000180  6e 67 20 49 1a 20 68 61  76 65 1a 20 6d 61 64 65  |ng I. have. made|
00000190  1a 20 73 6f 6d 65 20 73  6d 61 6c 6c 20 69 6d 70  |. some small imp|
000001a0  72 6f 76 65 6d 65 6e 74  73 2e 20 20 49 20 68 61  |rovements.  I ha|
000001b0  76 65 20 74 75 72 6e 65  64 0d 74 68 65 1a 20 66  |ve turned.the. f|
000001c0  6c 61 73 68 69 6e 67 1a  20 63 75 72 73 6f 72 20  |lashing. cursor |
000001d0  6f 66 66 20 61 73 20 74  68 69 73 20 69 73 20 6e  |off as this is n|
000001e0  6f 74 1a 20 6e 65 65 64  65 64 1a 20 61 6e 64 1a  |ot. needed. and.|
000001f0  20 77 68 65 6e 1a 20 71  75 69 74 74 69 6e 67 1a  | when. quitting.|
00000200  20 74 68 65 0d 70 72 6f  67 72 61 6d 2c 20 74 68  | the.program, th|
00000210  65 20 45 6c 6b 20 69 73  20 72 65 74 75 72 6e 65  |e Elk is returne|
00000220  64 20 74 6f 20 4d 4f 44  45 20 36 2e 0d 0d 54 68  |d to MODE 6...Th|
00000230  65 20 63 6f 64 65 20 69  73 20 61 73 73 65 6d 62  |e code is assemb|
00000240  6c 65 64 20 61 74 20 51  25 20 77 69 74 68 20 61  |led at Q% with a|
00000250  64 64 72 65 73 73 65 73  20 66 6f 72 20 50 25 20  |ddresses for P% |
00000260  61 74 20 26 32 30 30 30  2e 1a 20 20 54 68 69 73  |at &2000..  This|
00000270  20 69 73 20 64 6f 6e 65  0d 75 73 69 6e 67 20 4f  | is done.using O|
00000280  50 54 73 20 34 20 2d 20  36 1a 20 61 73 1a 20 69  |PTs 4 - 6. as. i|
00000290  6e 20 6d 79 20 4d 72 20  4d 69 6e 65 72 20 70 72  |n my Mr Miner pr|
000002a0  6f 67 72 61 6d 20 62 75  74 20 74 68 65 20 44 49  |ogram but the DI|
000002b0  4d 20 51 25 20 26 31 30  30 30 20 28 6c 69 6e 65  |M Q% &1000 (line|
000002c0  39 30 29 0d 72 65 73 65  72 76 65 73 20 74 68 65  |90).reserves the|
000002d0  20 73 70 61 63 65 20 66  6f 72 20 74 68 65 20 63  | space for the c|
000002e0  6f 64 65 20 61 62 6f 76  65 20 54 4f 50 2e 20 20  |ode above TOP.  |
000002f0  54 68 69 73 20 61 6c 6c  6f 77 73 20 74 68 65 20  |This allows the |
00000300  63 6f 64 65 20 74 6f 20  62 65 20 73 65 74 0d 75  |code to be set.u|
00000310  70 20 77 68 65 74 68 65  72 20 50 41 47 45 20 69  |p whether PAGE i|
00000320  73 20 61 74 20 26 45 30  30 20 6f 72 20 26 31 44  |s at &E00 or &1D|
00000330  30 30 2e 0d 0d 54 68 65  1a 20 61 64 64 72 65 73  |00...The. addres|
00000340  73 65 73 1a 20 66 6f 72  1a 20 74 68 65 1a 20 76  |ses. for. the. v|
00000350  61 72 69 61 62 6c 65 73  1a 20 61 72 65 1a 20 73  |ariables. are. s|
00000360  65 74 1a 20 69 6e 1a 20  6c 69 6e 65 73 1a 20 31  |et. in. lines. 1|
00000370  34 30 20 2d 20 31 38 30  2e 20 20 53 6f 6d 65 0d  |40 - 180.  Some.|
00000380  61 64 64 72 65 73 73 65  73 20 61 72 65 20 75 73  |addresses are us|
00000390  65 64 20 66 6f 72 20 74  77 6f 20 76 61 72 69 61  |ed for two varia|
000003a0  62 6c 65 73 20 62 75 74  20 74 68 69 73 20 64 6f  |bles but this do|
000003b0  65 73 6e 27 74 20 6d 61  74 74 65 72 1a 20 61 73  |esn't matter. as|
000003c0  20 74 68 65 73 65 20 61  72 65 0d 6e 6f 74 20 75  | these are.not u|
000003d0  73 65 64 20 61 74 20 74  68 65 20 73 61 6d 65 20  |sed at the same |
000003e0  74 69 6d 65 2e 0d 0d 49  20 77 69 6c 6c 20 6a 75  |time...I will ju|
000003f0  73 74 20 64 65 73 63 72  69 62 65 20 69 6e 1a 20  |st describe in. |
00000400  64 65 74 61 69 6c 1a 20  74 68 65 1a 20 70 61 72  |detail. the. par|
00000410  74 73 1a 20 77 68 69 63  68 1a 20 68 61 76 65 1a  |ts. which. have.|
00000420  20 6e 6f 74 20 62 65 65  6e 20 63 6f 76 65 72 65  | not been covere|
00000430  64 0d 62 65 66 6f 72 65  20 61 6e 64 20 65 78 70  |d.before and exp|
00000440  6c 61 69 6e 20 74 68 65  73 65 20 69 6e 20 74 68  |lain these in th|
00000450  65 20 6f 72 64 65 72 20  74 68 65 79 20 6f 63 63  |e order they occ|
00000460  75 72 2c 20 72 65 66 65  72 72 69 6e 67 20 74 6f  |ur, referring to|
00000470  1a 20 74 68 65 1a 20 6c  69 6e 65 73 0d 77 68 69  |. the. lines.whi|
00000480  63 68 20 63 72 65 61 74  65 20 74 68 65 20 63 6f  |ch create the co|
00000490  64 65 2e 0d 0d 4c 69 6e  65 73 1a 20 32 32 30 1a  |de...Lines. 220.|
000004a0  20 2d 1a 20 32 37 30 20  63 72 65 61 74 65 20 74  | -. 270 create t|
000004b0  68 65 20 6f 70 65 6e 69  6e 67 20 73 63 72 65 65  |he opening scree|
000004c0  6e 20 61 73 20 64 65 73  63 72 69 62 65 64 20 69  |n as described i|
000004d0  6e 1a 20 6d 79 1a 20 74  75 74 6f 72 69 61 6c 0d  |n. my. tutorial.|
000004e0  73 65 72 69 65 73 2e 20  20 4c 69 6e 65 73 20 32  |series.  Lines 2|
000004f0  37 30 2c 32 39 30 20 73  74 6f 70 20 74 68 65 20  |70,290 stop the |
00000500  70 72 6f 67 72 61 6d 20  75 6e 74 69 6c 20 52 45  |program until RE|
00000510  54 55 52 4e 20 69 73 20  70 72 65 73 73 65 64 2e  |TURN is pressed.|
00000520  20 20 4c 69 6e 65 20 32  38 30 0d 61 6c 6c 6f 77  |  Line 280.allow|
00000530  73 20 79 6f 75 20 74 6f  20 65 78 69 74 1a 20 74  |s you to exit. t|
00000540  68 65 1a 20 70 72 6f 67  72 61 6d 20 62 79 20 70  |he. program by p|
00000550  72 65 73 73 69 6e 67 20  45 53 43 41 50 45 20 61  |ressing ESCAPE a|
00000560  73 20 74 68 69 73 20 73  65 74 73 20 74 68 65 20  |s this sets the |
00000570  63 61 72 72 79 0d 66 6c  61 67 20 61 6e 64 20 74  |carry.flag and t|
00000580  68 65 6e 20 74 68 65 20  63 6f 64 65 20 72 65 74  |hen the code ret|
00000590  75 72 6e 73 20 74 6f 20  42 41 53 49 43 2e 0d 0d  |urns to BASIC...|
000005a0  54 68 65 20 72 6f 75 74  69 6e 65 20 27 72 65 61  |The routine 'rea|
000005b0  64 64 69 73 63 27 2c 20  6c 69 6e 65 73 20 36 30  |ddisc', lines 60|
000005c0  30 20 2d 1a 20 36 33 30  2c 20 66 69 72 73 74 1a  |0 -. 630, first.|
000005d0  20 67 69 76 65 73 20 74  68 65 20 63 6f 6d 6d 61  | gives the comma|
000005e0  6e 64 20 2a 4d 4f 55 4e  54 2e 20 0d 54 68 69 73  |nd *MOUNT. .This|
000005f0  20 75 73 65 73 20 74 68  65 20 4f 53 20 72 6f 75  | uses the OS rou|
00000600  74 69 6e 65 20 4f 53 43  4c 49 20 28 26 46 46 46  |tine OSCLI (&FFF|
00000610  37 29 20 77 69 74 68 1a  20 58 20 61 6e 64 20 59  |7) with. X and Y|
00000620  20 72 65 67 69 73 74 65  72 73 20 70 6f 69 6e 74  | registers point|
00000630  69 6e 67 20 74 6f 0d 74  68 65 20 61 64 64 72 65  |ing to.the addre|
00000640  73 73 20 6f 66 20 74 68  65 20 63 6f 6d 6d 61 6e  |ss of the comman|
00000650  64 20 64 61 74 61 20 61  74 20 6c 69 6e 65 20 32  |d data at line 2|
00000660  38 31 30 2e 20 20 20 4f  53 57 4f 52 44 20 77 69  |810.   OSWORD wi|
00000670  74 68 20 41 20 72 65 67  69 73 74 65 72 3d 26 37  |th A register=&7|
00000680  32 0d 69 73 20 75 73 65  64 20 77 69 74 68 20 70  |2.is used with p|
00000690  61 72 61 6d 65 74 65 72  20 62 6c 6f 63 6b 1a 20  |arameter block. |
000006a0  28 6c 69 6e 65 1a 20 32  38 30 30 29 1a 20 73 65  |(line. 2800). se|
000006b0  74 1a 20 61 73 1a 20 69  6e 20 74 68 65 20 42 41  |t. as. in the BA|
000006c0  53 49 43 20 76 65 72 73  69 6f 6e 2e 20 0d 54 68  |SIC version. .Th|
000006d0  69 73 20 72 65 61 64 73  20 74 68 65 20 74 77 6f  |is reads the two|
000006e0  20 73 65 63 74 6f 72 73  20 6f 66 20 74 68 65 20  | sectors of the |
000006f0  66 73 20 6d 61 70 20 74  6f 1a 20 74 68 65 1a 20  |fs map to. the. |
00000700  61 64 64 72 65 73 73 1a  20 57 25 2e 20 20 49 20  |address. W%.  I |
00000710  68 61 76 65 20 73 65 74  0d 74 68 69 73 20 74 6f  |have set.this to|
00000720  20 61 6e 20 61 64 64 72  65 73 73 20 6a 75 73 74  | an address just|
00000730  20 62 65 6c 6f 77 20 74  68 65 20 73 63 72 65 65  | below the scree|
00000740  6e 20 6d 65 6d 6f 72 79  20 61 72 65 61 2e 20 20  |n memory area.  |
00000750  54 68 69 73 20 63 61 6e  20 62 65 20 61 6c 74 65  |This can be alte|
00000760  72 65 64 0d 69 66 1a 20  69 74 1a 20 69 73 1a 20  |red.if. it. is. |
00000770  6e 6f 74 1a 20 63 6f 6e  76 65 6e 69 65 6e 74 1a  |not. convenient.|
00000780  20 73 69 6d 70 6c 79 1a  20 62 79 1a 20 61 6c 74  | simply. by. alt|
00000790  65 72 69 6e 67 1a 20 74  68 65 1a 20 76 61 6c 75  |ering. the. valu|
000007a0  65 1a 20 6f 66 1a 20 57  25 1a 20 61 6e 64 0d 72  |e. of. W%. and.r|
000007b0  65 2d 61 73 73 65 6d 62  6c 69 6e 67 20 74 68 65  |e-assembling the|
000007c0  20 63 6f 64 65 2e 0d 0d  4c 69 6e 65 20 33 30 30  | code...Line 300|
000007d0  20 73 65 74 73 20 43 4f  4c 55 55 52 20 32 20 74  | sets COLUUR 2 t|
000007e0  6f 20 42 6c 75 65 20 61  6e 64 20 74 75 72 6e 73  |o Blue and turns|
000007f0  20 6f 66 66 20 74 68 65  20 63 75 72 73 6f 72 2e  | off the cursor.|
00000800  0d 0d 54 68 65 20 72 6f  75 74 69 6e 65 20 27 76  |..The routine 'v|
00000810  61 72 73 27 20 28 6c 69  6e 65 73 31 31 30 30 20  |ars' (lines1100 |
00000820  2d 1a 20 31 32 36 30 29  1a 20 69 73 1a 20 6e 65  |-. 1260). is. ne|
00000830  78 74 20 63 61 6c 6c 65  64 2e 20 20 54 68 69 73  |xt called.  This|
00000840  20 66 69 72 73 74 20 66  69 6e 64 73 0d 74 68 65  | first finds.the|
00000850  20 76 61 6c 75 65 20 69  6e 20 61 64 64 72 65 73  | value in addres|
00000860  73 20 57 25 2b 26 31 46  45 20 28 58 25 2b 59 29  |s W%+&1FE (X%+Y)|
00000870  20 61 6e 64 20 73 74 6f  72 65 73 1a 20 74 68 69  | and stores. thi|
00000880  73 1a 20 69 6e 1a 20 27  73 69 7a 65 27 2e 20 20  |s. in. 'size'.  |
00000890  54 68 69 73 20 69 73 0d  74 68 65 1a 20 6e 75 6d  |This is.the. num|
000008a0  62 65 72 1a 20 6f 66 20  75 73 65 64 20 73 65 63  |ber. of used sec|
000008b0  74 69 6f 6e 73 20 6f 66  20 74 68 65 20 64 69 73  |tions of the dis|
000008c0  63 2e 20 20 54 68 65 20  74 77 6f 20 62 79 74 65  |c.  The two byte|
000008d0  73 1a 20 61 74 1a 20 57  25 2b 26 46 45 1a 20 61  |s. at. W%+&FE. a|
000008e0  72 65 0d 66 6f 75 6e 64  20 61 6e 64 20 73 74 6f  |re.found and sto|
000008f0  72 65 64 1a 20 69 6e 1a  20 74 68 65 20 74 77 6f  |red. in. the two|
00000900  20 62 79 74 65 73 20 6f  66 20 27 73 65 63 74 6f  | bytes of 'secto|
00000910  72 73 27 2e 20 20 54 68  65 79 20 61 72 65 20 61  |rs'.  They are a|
00000920  6c 73 6f 20 73 74 6f 72  65 64 20 69 6e 0d 27 74  |lso stored in.'t|
00000930  72 61 63 6b 73 27 20 61  6e 64 20 74 68 65 6e 20  |racks' and then |
00000940  74 68 65 20 62 69 74 73  1a 20 6d 61 6e 69 70 75  |the bits. manipu|
00000950  6c 61 74 65 64 1a 20 28  6c 69 6e 65 73 20 31 31  |lated. (lines 11|
00000960  36 30 20 2d 20 31 31 39  30 29 20 74 6f 20 64 69  |60 - 1190) to di|
00000970  76 69 64 65 20 74 68 65  0d 76 61 6c 75 65 20 62  |vide the.value b|
00000980  79 20 31 36 20 74 6f 20  67 69 76 65 20 74 68 65  |y 16 to give the|
00000990  20 6e 75 6d 62 65 72 20  6f 66 20 74 72 61 63 6b  | number of track|
000009a0  73 2e 0d 0d 54 68 65 20  42 41 53 49 43 20 70 72  |s...The BASIC pr|
000009b0  6f 67 72 61 6d 20 74 68  65 6e 20 64 69 76 69 64  |ogram then divid|
000009c0  65 64 20 62 79 20 38 30  20 74 6f 20 67 69 76 65  |ed by 80 to give|
000009d0  20 74 68 65 20 6e 75 6d  62 65 72 20 6f 66 20 73  | the number of s|
000009e0  69 64 65 73 2e 20 20 54  68 69 73 20 69 73 0d 6e  |ides.  This is.n|
000009f0  6f 74 20 73 6f 20 65 61  73 79 20 74 6f 20 64 6f  |ot so easy to do|
00000a00  20 69 6e 20 6d 2f 63 6f  64 65 20 61 6e 64 20 61  | in m/code and a|
00000a10  6c 73 6f 2c 20 68 61 76  69 6e 67 20 61 20 64 69  |lso, having a di|
00000a20  73 63 20 74 68 61 74 20  77 6f 75 6c 64 20 6f 6e  |sc that would on|
00000a30  6c 79 20 66 6f 72 6d 61  74 0d 63 6f 6d 70 6c 65  |ly format.comple|
00000a40  74 65 6c 79 20 61 73 20  61 20 34 30 20 74 72 61  |tely as a 40 tra|
00000a50  63 6b 20 64 69 73 63 2c  20 49 20 66 6f 75 6e 64  |ck disc, I found|
00000a60  20 74 68 69 73 20 74 68  65 6e 20 67 61 76 65 20  | this then gave |
00000a70  73 69 64 65 73 20 61 73  20 30 21 21 20 20 49 20  |sides as 0!!  I |
00000a80  74 68 65 6e 0d 74 68 6f  75 67 68 74 20 74 68 61  |then.thought tha|
00000a90  74 20 74 72 61 63 6b 73  20 63 61 6e 20 6f 6e 6c  |t tracks can onl|
00000aa0  79 1a 20 68 61 76 65 1a  20 74 68 65 1a 20 76 61  |y. have. the. va|
00000ab0  6c 75 65 73 1a 20 31 36  30 2c 20 38 30 20 6f 72  |lues. 160, 80 or|
00000ac0  20 34 30 2e 20 20 53 6f  20 49 20 68 61 76 65 0d  | 40.  So I have.|
00000ad0  63 6f 6d 70 61 72 65 64  20 74 72 61 63 6b 73 20  |compared tracks |
00000ae0  77 69 74 68 20 31 36 30  20 61 6e 64 20 69 66 20  |with 160 and if |
00000af0  65 71 75 61 6c 20 32 20  69 73 1a 20 70 72 69 6e  |equal 2 is. prin|
00000b00  74 65 64 1a 20 61 6e 64  2c 20 69 66 20 6e 6f 74  |ted. and, if not|
00000b10  20 65 71 75 61 6c 2c 20  74 6f 0d 70 72 69 6e 74  | equal, to.print|
00000b20  20 31 20 28 6c 69 6e 65  73 20 31 32 30 30 20 2d  | 1 (lines 1200 -|
00000b30  20 31 32 32 30 29 20 2d  20 6d 75 63 68 20 73 69  | 1220) - much si|
00000b40  6d 70 6c 65 72 21 21 0d  0d 54 68 65 20 76 61 6c  |mpler!!..The val|
00000b50  75 65 20 6f 66 1a 20 73  65 63 74 6f 72 73 20 69  |ue of. sectors i|
00000b60  73 20 61 6c 73 6f 20 73  74 6f 72 65 64 20 61 74  |s also stored at|
00000b70  20 64 69 73 63 73 69 7a  65 2b 31 20 61 6e 64 20  | discsize+1 and |
00000b80  2b 32 2e 20 20 54 68 69  73 20 67 69 76 65 73 20  |+2.  This gives |
00000b90  74 68 65 0d 76 61 6c 75  65 20 6f 66 20 64 69 73  |the.value of dis|
00000ba0  63 73 69 7a 65 20 61 73  20 73 65 63 74 6f 72 73  |csize as sectors|
00000bb0  2a 32 35 36 2c 20 69 65  20 74 68 65 20 6e 75 6d  |*256, ie the num|
00000bc0  62 65 72 20 6f 66 20 62  79 74 65 73 20 6f 6e 20  |ber of bytes on |
00000bd0  74 68 65 20 64 69 73 63  2e 0d 0d 4c 69 6e 65 20  |the disc...Line |
00000be0  31 32 35 30 20 73 65 74  73 20 75 70 1a 20 74 68  |1250 sets up. th|
00000bf0  65 1a 20 63 68 61 72 61  63 74 65 72 20 6e 75 6d  |e. character num|
00000c00  62 65 72 20 32 32 34 20  75 73 69 6e 67 20 56 44  |ber 224 using VD|
00000c10  55 32 33 2e 20 20 41 20  63 6f 6d 70 61 72 69 73  |U23.  A comparis|
00000c20  6f 6e 20 69 73 0d 6d 61  64 65 20 6f 66 20 74 68  |on is.made of th|
00000c30  65 20 76 61 6c 75 65 20  6f 66 20 73 69 64 65 73  |e value of sides|
00000c40  20 61 6e 64 2c 20 69 66  20 65 71 75 61 6c 20 74  | and, if equal t|
00000c50  6f 20 31 20 74 68 65 20  63 68 61 72 61 63 74 65  |o 1 the characte|
00000c60  72 20 62 79 74 65 73 20  61 72 65 20 32 32 34 2c  |r bytes are 224,|
00000c70  0d 61 6e 64 20 31 39 32  20 69 66 20 6e 6f 74 2e  |.and 192 if not.|
00000c80  20 20 54 68 69 73 20 67  69 76 65 73 20 61 20 6e  |  This gives a n|
00000c90  61 72 72 6f 77 65 72 20  63 68 61 72 61 63 74 65  |arrower characte|
00000ca0  72 20 66 6f 72 20 61 20  64 6f 75 62 6c 65 20 73  |r for a double s|
00000cb0  69 64 65 64 20 64 69 73  63 2e 0d 0d 54 68 65 20  |ided disc...The |
00000cc0  72 6f 75 74 69 6e 65 20  27 67 72 69 64 27 20 28  |routine 'grid' (|
00000cd0  6c 69 6e 65 73 20 31 33  30 30 20 2d 31 36 39 30  |lines 1300 -1690|
00000ce0  29 1a 20 69 73 1a 20 72  61 74 68 65 72 1a 20 63  |). is. rather. c|
00000cf0  6f 6d 70 6c 65 78 20 62  75 74 20 63 6f 6e 73 69  |omplex but consi|
00000d00  73 74 73 20 6f 66 0d 73  65 76 65 72 61 6c 1a 20  |sts of.several. |
00000d10  73 65 63 74 69 6f 6e 73  2e 20 20 4c 69 6e 65 20  |sections.  Line |
00000d20  31 33 31 30 20 75 73 65  73 20 74 68 65 20 64 61  |1310 uses the da|
00000d30  74 61 20 27 64 34 27 20  28 6c 69 6e 65 20 32 38  |ta 'd4' (line 28|
00000d40  34 30 29 2c 20 66 69 72  73 74 20 74 6f 20 73 65  |40), first to se|
00000d50  74 0d 74 68 65 20 62 61  63 6b 67 72 6f 75 6e 64  |t.the background|
00000d60  1a 20 63 6f 6c 6f 75 72  1a 20 74 6f 20 72 65 64  |. colour. to red|
00000d70  20 61 6e 64 20 73 65 74  74 69 6e 67 20 74 68 65  | and setting the|
00000d80  20 67 72 61 70 68 69 63  73 20 77 69 6e 64 6f 77  | graphics window|
00000d90  2e 20 20 41 66 74 65 72  20 74 68 65 0d 77 69 6e  |.  After the.win|
00000da0  64 6f 77 20 69 73 20 63  6c 65 61 72 65 64 2c 20  |dow is cleared, |
00000db0  74 68 65 1a 20 73 63 72  65 65 6e 1a 20 69 73 20  |the. screen. is |
00000dc0  72 65 74 75 72 6e 65 64  20 6e 6f 72 6d 61 6c 2e  |returned normal.|
00000dd0  20 20 54 68 65 20 66 6f  72 65 67 72 6f 75 6e 64  |  The foreground|
00000de0  20 63 6f 6c 6f 75 72 0d  69 73 20 74 68 65 6e 20  | colour.is then |
00000df0  73 65 74 20 74 6f 20 77  68 69 74 65 20 61 6e 64  |set to white and|
00000e00  20 74 68 65 20 62 61 63  6b 67 72 6f 75 6e 64 20  | the background |
00000e10  74 6f 20 62 6c 61 63 6b  2e 0d 0d 54 68 65 20 74  |to black...The t|
00000e20  77 6f 20 73 65 63 74 69  6f 6e 73 20 6c 69 6e 65  |wo sections line|
00000e30  73 20 31 33 32 30 20 2d  1a 20 31 34 30 30 1a 20  |s 1320 -. 1400. |
00000e40  61 6e 64 20 31 34 31 30  20 2d 20 31 34 39 30 2c  |and 1410 - 1490,|
00000e50  20 70 72 69 6e 74 20 74  68 65 20 67 72 69 64 20  | print the grid |
00000e60  75 73 69 6e 67 0d 74 68  65 20 72 6f 75 74 69 6e  |using.the routin|
00000e70  65 20 27 70 6c 6f 74 70  74 27 20 74 6f 20 73 65  |e 'plotpt' to se|
00000e80  74 20 74 68 65 20 70 6c  6f 74 20 70 6f 69 6e 74  |t the plot point|
00000e90  73 2e 0d 0d 54 68 65 20  66 69 72 73 74 20 64 72  |s...The first dr|
00000ea0  61 77 73 20 74 68 65 20  76 65 72 74 69 63 61 6c  |aws the vertical|
00000eb0  20 6c 69 6e 65 73 2e 20  20 54 68 65 20 6e 75 6d  | lines.  The num|
00000ec0  62 65 72 20 6f 66 1a 20  6c 69 6e 65 73 1a 20 74  |ber of. lines. t|
00000ed0  6f 20 62 65 20 64 72 61  77 6e 20 61 72 65 0d 6c  |o be drawn are.l|
00000ee0  6f 61 64 65 64 20 69 6e  74 6f 20 27 63 6f 75 6e  |oaded into 'coun|
00000ef0  74 27 20 61 6e 64 20 74  68 65 1a 20 66 6f 75 72  |t' and the. four|
00000f00  20 63 6f 2d 6f 72 64 69  6e 61 74 65 20 62 79 74  | co-ordinate byt|
00000f10  65 73 20 6f 66 20 74 68  65 20 76 61 72 69 61 62  |es of the variab|
00000f20  6c 65 20 27 70 6c 6f 74  27 0d 61 72 65 20 73 65  |le 'plot'.are se|
00000f30  74 20 74 6f 20 7a 65 72  6f 20 28 6c 69 6e 65 20  |t to zero (line |
00000f40  31 34 32 30 29 2e 1a 20  20 54 68 65 1a 20 6c 6f  |1420)..  The. lo|
00000f50  6f 70 1a 20 27 76 6c 70  27 20 74 68 65 6e 20 64  |op. 'vlp' then d|
00000f60  72 61 77 73 20 74 68 65  20 6c 69 6e 65 73 2e 20  |raws the lines. |
00000f70  20 54 68 65 0d 74 77 6f  20 63 61 6c 6c 73 20 74  | The.two calls t|
00000f80  6f 20 74 68 65 20 72 6f  75 74 69 6e 65 20 22 70  |o the routine "p|
00000f90  6c 6f 74 70 74 27 20 63  68 61 6e 67 65 20 74 68  |lotpt' change th|
00000fa0  65 20 59 1a 20 63 6f 2d  6f 72 64 73 1a 20 74 6f  |e Y. co-ords. to|
00000fb0  20 64 72 61 77 20 61 20  6c 69 6e 65 20 6f 6e 0d  | draw a line on.|
00000fc0  74 68 65 1a 20 58 1a 20  63 6f 2d 6f 72 64 20 28  |the. X. co-ord (|
00000fd0  69 6e 69 74 69 61 6c 6c  79 20 7a 65 72 6f 29 2e  |initially zero).|
00000fe0  20 20 54 68 65 20 58 20  63 6f 2d 6f 72 64 20 69  |  The X co-ord i|
00000ff0  73 20 69 6e 63 72 65 61  73 65 64 20 62 79 1a 20  |s increased by. |
00001000  61 64 64 69 6e 67 1a 20  31 36 0d 65 61 63 68 20  |adding. 16.each |
00001010  74 69 6d 65 20 72 6f 75  6e 64 20 74 68 65 20 6c  |time round the l|
00001020  6f 6f 70 20 61 6e 64 20  27 63 6f 75 6e 74 27 20  |oop and 'count' |
00001030  64 65 63 72 65 61 73 65  64 20 75 6e 74 69 6c 20  |decreased until |
00001040  74 68 69 73 20 69 73 20  7a 65 72 6f 20 61 6e 64  |this is zero and|
00001050  20 74 68 65 6e 0d 74 68  65 20 73 65 63 6f 6e 64  | then.the second|
00001060  20 73 65 63 74 69 6f 6e  20 64 72 61 77 73 20 74  | section draws t|
00001070  68 65 20 68 6f 72 69 7a  6f 6e 74 61 6c 20 6c 69  |he horizontal li|
00001080  6e 65 73 20 69 6e 20 74  68 65 20 73 61 6d 65 20  |nes in the same |
00001090  77 61 79 2e 0d 0d 54 68  65 20 74 68 69 72 64 20  |way...The third |
000010a0  73 65 63 74 69 6f 6e 20  28 6c 69 6e 65 73 20 31  |section (lines 1|
000010b0  35 30 30 1a 20 2d 1a 20  31 36 39 30 29 20 70 72  |500. -. 1690) pr|
000010c0  69 6e 74 73 20 74 68 65  20 74 72 61 63 6b 20 6e  |ints the track n|
000010d0  75 6d 62 65 72 73 20 61  6e 64 20 73 68 6f 72 74  |umbers and short|
000010e0  0d 76 65 72 74 69 63 61  6c 20 6c 69 6e 65 73 20  |.vertical lines |
000010f0  75 6e 64 65 72 6e 65 61  74 68 2e 20 20 4c 69 6e  |underneath.  Lin|
00001100  65 20 31 35 31 30 20 73  65 74 73 20 63 6f 75 6e  |e 1510 sets coun|
00001110  74 20 74 6f 1a 20 38 2c  1a 20 74 68 65 20 58 20  |t to. 8,. the X |
00001120  63 6f 2d 6f 72 64 2c 20  68 65 78 0d 61 6e 64 20  |co-ord, hex.and |
00001130  74 72 6b 6e 6f 20 74 6f  20 7a 65 72 6f 2e 20 20  |trkno to zero.  |
00001140  0d 0d 54 68 65 1a 20 6e  75 6d 62 65 72 1a 20 6f  |..The. number. o|
00001150  66 20 73 69 64 65 73 20  69 73 20 74 68 65 6e 20  |f sides is then |
00001160  63 68 65 63 6b 65 64 2c  20 69 66 20 74 68 69 73  |checked, if this|
00001170  20 69 73 20 74 77 6f 2c  20 74 68 65 20 76 61 72  | is two, the var|
00001180  69 61 62 6c 65 20 27 64  69 66 66 27 0d 69 73 20  |iable 'diff'.is |
00001190  65 71 75 61 6c 20 74 6f  1a 20 32 30 20 6f 74 68  |equal to. 20 oth|
000011a0  65 72 77 69 73 65 20 69  74 20 65 71 75 61 6c 20  |erwise it equal |
000011b0  74 6f 20 31 30 2e 20 20  54 68 65 20 6c 6f 6f 70  |to 10.  The loop|
000011c0  20 27 76 6c 70 32 27 20  66 69 72 73 74 20 64 72  | 'vlp2' first dr|
000011d0  61 77 73 20 74 68 65 0d  73 68 6f 72 74 20 6c 69  |aws the.short li|
000011e0  6e 65 20 75 73 69 6e 67  20 27 70 6c 6f 74 70 74  |ne using 'plotpt|
000011f0  27 20 74 68 65 6e 20 74  68 65 20 76 61 6c 75 65  |' then the value|
00001200  20 69 6e 20 74 72 6b 6e  6f 20 69 73 20 63 6f 6d  | in trkno is com|
00001210  70 61 72 65 64 20 61 6e  64 20 69 66 20 65 71 75  |pared and if equ|
00001220  61 6c 0d 74 6f 20 7a 65  72 6f 2c 20 61 20 7a 65  |al.to zero, a ze|
00001230  72 6f 20 69 73 1a 20 70  72 69 6e 74 65 64 1a 20  |ro is. printed. |
00001240  28 6c 69 6e 65 73 1a 20  31 35 37 30 20 2d 20 31  |(lines. 1570 - 1|
00001250  35 39 30 29 2e 20 20 54  68 65 20 76 61 6c 75 65  |590).  The value|
00001260  20 6f 66 20 27 64 69 66  66 27 20 69 73 0d 61 64  | of 'diff' is.ad|
00001270  64 65 64 20 61 6e 64 20  31 39 32 20 61 64 64 65  |ded and 192 adde|
00001280  64 20 74 6f 20 74 68 65  20 58 20 63 6f 2d 6f 72  |d to the X co-or|
00001290  64 1a 20 62 65 66 6f 72  65 20 6c 6f 6f 70 69 6e  |d. before loopin|
000012a0  67 20 62 61 63 6b 20 74  6f 20 27 76 6c 70 32 27  |g back to 'vlp2'|
000012b0  2e 20 20 53 69 6e 63 65  0d 74 72 6b 6e 6f 20 69  |.  Since.trkno i|
000012c0  73 20 6e 6f 74 20 7a 65  72 6f 2c 20 74 68 65 20  |s not zero, the |
000012d0  74 72 61 63 6b 20 6e 75  6d 62 65 72 73 20 61 72  |track numbers ar|
000012e0  65 20 6e 6f 77 1a 20 70  72 69 6e 74 65 64 1a 20  |e now. printed. |
000012f0  75 73 69 6e 67 1a 20 74  68 65 1a 20 72 6f 75 74  |using. the. rout|
00001300  69 6e 65 0d 27 64 65 63  70 72 74 27 1a 20 28 6c  |ine.'decprt'. (l|
00001310  69 6e 65 73 1a 20 36 35  30 20 2d 20 31 30 39 30  |ines. 650 - 1090|
00001320  29 2e 20 20 54 68 69 73  20 72 6f 75 74 69 6e 65  |).  This routine|
00001330  20 66 6f 72 20 70 72 69  6e 74 69 6e 67 20 61 20  | for printing a |
00001340  64 65 63 69 6d 61 6c 20  6e 75 6d 62 65 72 0d 77  |decimal number.w|
00001350  61 73 20 20 61 20 72 6f  75 74 69 6e 65 20 67 69  |as  a routine gi|
00001360  76 65 6e 20 69 6e 20 74  68 65 20 4d 69 63 72 6f  |ven in the Micro|
00001370  20 55 73 65 72 20 53 65  70 20 31 39 39 30 2e 20  | User Sep 1990. |
00001380  20 54 68 69 73 20 69 73  20 75 73 65 64 20 63 6f  | This is used co|
00001390  6d 70 6c 65 74 65 20 61  73 0d 49 1a 20 64 6f 1a  |mplete as.I. do.|
000013a0  20 6e 6f 74 1a 20 6b 6e  6f 77 1a 20 61 6e 6f 74  | not. know. anot|
000013b0  68 65 72 20 72 6f 75 74  69 6e 65 20 74 6f 20 64  |her routine to d|
000013c0  6f 20 74 68 69 73 2e 20  20 54 68 65 20 63 6f 6d  |o this.  The com|
000013d0  70 61 72 69 73 6f 6e 20  69 6e 20 6c 69 6e 65 20  |parison in line |
000013e0  31 36 34 30 0d 73 74 6f  70 73 20 74 68 65 20 70  |1640.stops the p|
000013f0  72 69 6e 74 69 6e 67 20  6f 66 20 74 68 65 20 66  |rinting of the f|
00001400  69 6e 61 6c 20 74 72 61  63 6b 20 6e 75 6d 62 65  |inal track numbe|
00001410  72 20 61 6e 64 20 65 6e  64 73 20 74 68 65 20 72  |r and ends the r|
00001420  6f 75 74 69 6e 65 2e 0d  0d 54 68 65 20 72 6f 75  |outine...The rou|
00001430  74 69 6e 65 20 27 69 6e  66 6f 27 20 70 72 69 6e  |tine 'info' prin|
00001440  74 73 20 74 68 65 20 74  72 61 63 6b 73 20 68 65  |ts the tracks he|
00001450  61 64 69 6e 67 20 61 6e  64 20 74 68 65 20 72 65  |ading and the re|
00001460  6d 61 69 6e 69 6e 67 20  70 72 69 6e 74 69 6e 67  |maining printing|
00001470  20 61 73 0d 62 65 66 6f  72 65 20 75 73 69 6e 67  | as.before using|
00001480  20 64 61 74 61 20 6c 69  6e 65 73 20 32 38 35 30  | data lines 2850|
00001490  1a 20 26 20 32 38 36 30  20 61 6e 64 20 74 68 65  |. & 2860 and the|
000014a0  20 27 64 65 63 70 72 74  27 20 72 6f 75 74 69 6e  | 'decprt' routin|
000014b0  65 20 66 6f 72 20 70 72  69 6e 74 69 6e 67 0d 74  |e for printing.t|
000014c0  68 65 20 76 61 6c 75 65  73 2e 20 20 20 20 20 20  |he values.      |
000014d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00001500  20 20 20 20 20 20 20 20  20 0d 0d 54 68 65 20 72  |         ..The r|
00001510  6f 75 74 69 6e 65 20 27  6b 65 79 27 20 70 72 69  |outine 'key' pri|
00001520  6e 74 73 20 74 68 65 20  6b 65 79 20 74 6f 20 74  |nts the key to t|
00001530  68 65 20 63 6f 6c 6f 75  72 73 2e 1a 20 20 46 6f  |he colours..  Fo|
00001540  72 20 65 61 63 68 1a 20  6f 66 1a 20 74 68 65 1a  |r each. of. the.|
00001550  20 66 6f 75 72 0d 63 6f  6c 6f 75 72 73 2c 20 74  | four.colours, t|
00001560  68 65 20 63 6f 2d 6f 72  64 73 20 58 20 61 6e 64  |he co-ords X and|
00001570  1a 20 59 20 61 6e 64 20  74 68 65 20 74 77 6f 20  |. Y and the two |
00001580  63 6f 6c 6f 75 72 20 6e  75 6d 62 65 72 73 20 43  |colour numbers C|
00001590  31 20 61 6e 64 20 43 32  20 61 72 65 20 73 65 74  |1 and C2 are set|
000015a0  0d 62 65 66 6f 72 65 1a  20 74 68 65 1a 20 72 6f  |.before. the. ro|
000015b0  75 74 69 6e 65 20 27 73  71 72 27 20 69 73 20 63  |utine 'sqr' is c|
000015c0  61 6c 6c 65 64 2e 20 20  54 68 69 73 20 73 65 74  |alled.  This set|
000015d0  73 20 74 68 65 20 63 6f  6c 6f 75 72 20 43 31 20  |s the colour C1 |
000015e0  66 6f 72 20 6b 65 79 20  61 6e 64 0d 64 72 61 77  |for key and.draw|
000015f0  73 20 61 20 73 6f 6c 69  64 20 73 71 75 61 72 65  |s a solid square|
00001600  20 62 79 1a 20 75 73 69  6e 67 1a 20 50 4c 4f 54  | by. using. PLOT|
00001610  20 63 6f 64 65 20 38 35  20 74 77 69 63 65 2e 20  | code 85 twice. |
00001620  20 54 68 65 20 63 6f 6c  6f 75 72 20 69 73 20 63  | The colour is c|
00001630  68 61 6e 67 65 64 0d 74  6f 1a 20 43 32 20 61 6e  |hanged.to. C2 an|
00001640  64 20 74 68 65 20 6f 75  74 6c 69 6e 65 20 64 72  |d the outline dr|
00001650  61 77 6e 2e 20 20 54 68  65 1a 20 70 72 6f 67 72  |awn.  The. progr|
00001660  61 6d 1a 20 72 65 74 75  72 6e 73 1a 20 74 6f 1a  |am. returns. to.|
00001670  20 27 69 6e 66 6f 27 1a  20 66 6f 72 1a 20 74 68  | 'info'. for. th|
00001680  65 0d 70 72 69 6e 74 69  6e 67 2e 0d 0d           |e.printing...|
0000168d
P/+ADEXt1.m0
P/+ADEXt1.m1
P/+ADEXt1.m2
P/+ADEXt1.m4
P/+ADEXt1.m5