Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_24.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_24.ADF
Filename: F/M\cTut1
Read OK:
File size: 18DF bytes
Load address: 6D204556
Exec address: 7574632F
File contents
USING THE ASSEMBLER 7
~~~~~~~~~~~~~~~~~~~~~
By Richard Dimond

I hope that my last contribution was reasonably understandable and not too
overwhelming!!  Like most of my programs, it just grew and grew!!  I have
a program that grew too big for 32k and hope to shorten it by M/coding it.

Having said that, before I describe the promised adventure program, I want
to comment on two routines which were used in the programs given last time
as these will be often used in M/code.

In the Miner program, when you move around, the play area is re-drawn each
time from the data starting at a different address.  This address is
calculated by adding or subtracting an amount depending on which way you
move.  

For addition, the carry flag must be cleared first then the low byte
values added followed by the high byte values.  Thus -

          CLC:LDAaddr:ADC#xlow:STAaddr
          LDAaddr+1:ADC#xhigh:STAaddr

adds the two byte value 'x' to the address held at 'addr' and stores it at
this address.

For subtraction, the routine is the same except the carry flag must be set
first.

In the MINsrc1 program line 650, the value to be added is first stored in
&90.  This is then added after loading the value from 'data' and stored
again.  As there is no high byte value to add, the ADC#0 in the line adds
1 to the high byte if the carry flag is set by the addition of the low
byte.  Lines 660 and 670 are similar for changing the address held in
'addr'.

The other routine is for transferring blocks of data from one memory area
to another.  This is done with a loop similar to those I have already
given.  In line 680 of the program referred to, data from the address in
&80 is loaded into A register and stored into the address in'addr' with
the commands - LDA(&80),Y:STA(addr),Y.  As Y register is loaded with 17 at
the start, this is added to the addresses and each time round the loop Y
is decreased until the value goes negative when the value in Y falls below
zero.  In this way 18 bytes are transferred.

Another loop often used is this -

                   LDY#0
                   .loop
                   <transfer commands>
                   INY:BNEloop
                   RTS

This transfers 256 bytes, ie a page of data and can be extended to
transfer several pages by increasing the high bytes of the addresses each
time the loop is completed and either counting the number of pages using X
register as a counter or comparing the high byte of one of the addresses.

Now for the game such as it is!!  It was based on a series of articles in
'Let's Compute' - remember the kid's magazine?  It is far from complete as
the series was unfinished when the magazine stopped publication.  It was
also written in rather peculiar Basic as it was to be adapted for other
machines and I thoght it a challenge to rewrite in M/code.  I thoght also
that there was sufficient to give you some ideas on writing an adventure
program in M/code and also to show some further routines.  If anyone has
ideas on how to complete the game or to write another, I would be glad to
help.  

First I will give a breakdown of the program referring to the lines of the
assembler which produce the code as I did last time.

Lines 120 - 1090    are the subroutines
      2000 - 2240   are the main loop
      5000 -        the buffer for osword (&FFF1) for the input.
      5010 -        title data
      5020 - 5030   data for printing the directions
      5040 - 5240   message data
      5250 - 5280   table of message addresses
      5290 -        flag for the messages
      5300 - 5550   words for COMMANDS
             5310   directions - single letters
             5320   directions - words
             5340   actions
             5400   useful objects to take
             5470   other objects
             5550   inventory
      5570 -        stores the current lacation number
      5580 - 5780   locations
      5790 - 5820   table of location addresses
      5830 - 6030   movement data
      6040 - 6180   object descriptions
      6190 - 6210   table of addresses for these
      6220 -        data for object positions
      6230 -        data for objects held
      6240 -        two bytes for holding the action numbers

I will describe the working of the program from the start (line 2000) and
explain the subroutines as they are used again referring to the lines in
the assembler listing.

At the start you are in location 1 - The Control Room as the value in
'loc' (line 5570) is 1.

Line 2010 selects MODE 6 followed by two OSNEWLs.
     2020 uses routine 'rep' to print 12 spaces <TAB(12)>, and prints the
          title using routine 'prt' and an OSNEWL.
     2030 prints the underline
     
The main loop starts at line 2040.

The messages are printed by loading A register with the number of the
message and then calling the routine 'prtmess'.  The value in A is doubled
by ASL A, 2 subtracted and the value transferred to Y register.  Thus Y is
loaded with 0, 2, 4,... according to which message is to be printed.  This
is then used as an index to the two bytes or the  address of the message. 
These two values are then loaded into X and Y registers before calling the
routine 'prt'.

The routine 'prtloc' works in the same way except that A register is
loaded with the value of the current location held in 'loc' so that you
are told where you are.

This method of referring to an address in a table is often used in M/code.
In this program it is used to set up the printing of the data and what you
can do according to the location you are since the value in 'loc' is used
for the index.

Line 2080 prints message 2 and the routine 'ldobs' is called.  This
routine searches the data 'obsdat' (line 6220) - note that each four bytes
are in reverse order as they are entered using EQUD.

The data is compared with the location number and, if they are equal, the
object number, which is the value in Y register, is printed with the
routine 'prtob' (line 440).  The 'obflag' (&75) is set to -1 (&FF) to show
that an object has be found.

On completion of the search, the program jumps to 'ret' and the obflag is
compared with &FF.  If this is equal the routine ends.  If no object is
found then the obflag is zero and message 15 is printed (line 580).

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 37 0d 7e  7e 7e 7e 7e 7e 7e 7e 7e  |BLER 7.~~~~~~~~~|
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 6d 79 20 6c  |I hope that my l|
00000050  61 73 74 20 63 6f 6e 74  72 69 62 75 74 69 6f 6e  |ast contribution|
00000060  20 77 61 73 20 72 65 61  73 6f 6e 61 62 6c 79 20  | was reasonably |
00000070  75 6e 64 65 72 73 74 61  6e 64 61 62 6c 65 20 61  |understandable a|
00000080  6e 64 20 6e 6f 74 20 74  6f 6f 0d 6f 76 65 72 77  |nd not too.overw|
00000090  68 65 6c 6d 69 6e 67 21  21 1a 20 20 4c 69 6b 65  |helming!!.  Like|
000000a0  20 6d 6f 73 74 20 6f 66  20 6d 79 20 70 72 6f 67  | most of my prog|
000000b0  72 61 6d 73 2c 20 69 74  20 6a 75 73 74 20 67 72  |rams, it just gr|
000000c0  65 77 20 61 6e 64 20 67  72 65 77 21 21 20 20 49  |ew and grew!!  I|
000000d0  20 68 61 76 65 0d 61 20  70 72 6f 67 72 61 6d 20  | have.a program |
000000e0  74 68 61 74 20 67 72 65  77 20 74 6f 6f 20 62 69  |that grew too bi|
000000f0  67 20 66 6f 72 20 33 32  6b 20 61 6e 64 20 68 6f  |g for 32k and ho|
00000100  70 65 20 74 6f 20 73 68  6f 72 74 65 6e 20 69 74  |pe to shorten it|
00000110  20 62 79 20 4d 2f 63 6f  64 69 6e 67 20 69 74 2e  | by M/coding it.|
00000120  0d 0d 48 61 76 69 6e 67  20 73 61 69 64 20 74 68  |..Having said th|
00000130  61 74 2c 20 62 65 66 6f  72 65 20 49 20 64 65 73  |at, before I des|
00000140  63 72 69 62 65 20 74 68  65 20 70 72 6f 6d 69 73  |cribe the promis|
00000150  65 64 20 61 64 76 65 6e  74 75 72 65 20 70 72 6f  |ed adventure pro|
00000160  67 72 61 6d 2c 20 49 20  77 61 6e 74 0d 74 6f 20  |gram, I want.to |
00000170  63 6f 6d 6d 65 6e 74 20  6f 6e 20 74 77 6f 20 72  |comment on two r|
00000180  6f 75 74 69 6e 65 73 20  77 68 69 63 68 20 77 65  |outines which we|
00000190  72 65 20 75 73 65 64 20  69 6e 20 74 68 65 20 70  |re used in the p|
000001a0  72 6f 67 72 61 6d 73 20  67 69 76 65 6e 20 6c 61  |rograms given la|
000001b0  73 74 20 74 69 6d 65 0d  61 73 20 74 68 65 73 65  |st time.as these|
000001c0  20 77 69 6c 6c 20 62 65  20 6f 66 74 65 6e 20 75  | will be often u|
000001d0  73 65 64 20 69 6e 20 4d  2f 63 6f 64 65 2e 0d 0d  |sed in M/code...|
000001e0  49 6e 20 74 68 65 20 4d  69 6e 65 72 20 70 72 6f  |In the Miner pro|
000001f0  67 72 61 6d 2c 20 77 68  65 6e 20 79 6f 75 20 6d  |gram, when you m|
00000200  6f 76 65 20 61 72 6f 75  6e 64 2c 20 74 68 65 20  |ove around, the |
00000210  70 6c 61 79 20 61 72 65  61 20 69 73 20 72 65 2d  |play area is re-|
00000220  64 72 61 77 6e 20 65 61  63 68 0d 74 69 6d 65 20  |drawn each.time |
00000230  66 72 6f 6d 1a 20 74 68  65 1a 20 64 61 74 61 1a  |from. the. data.|
00000240  20 73 74 61 72 74 69 6e  67 1a 20 61 74 1a 20 61  | starting. at. a|
00000250  1a 20 64 69 66 66 65 72  65 6e 74 20 61 64 64 72  |. different addr|
00000260  65 73 73 2e 20 20 54 68  69 73 20 61 64 64 72 65  |ess.  This addre|
00000270  73 73 20 69 73 0d 63 61  6c 63 75 6c 61 74 65 64  |ss is.calculated|
00000280  20 62 79 20 61 64 64 69  6e 67 20 6f 72 20 73 75  | by adding or su|
00000290  62 74 72 61 63 74 69 6e  67 1a 20 61 6e 1a 20 61  |btracting. an. a|
000002a0  6d 6f 75 6e 74 20 64 65  70 65 6e 64 69 6e 67 20  |mount depending |
000002b0  6f 6e 20 77 68 69 63 68  20 77 61 79 20 79 6f 75  |on which way you|
000002c0  0d 6d 6f 76 65 2e 20 20  0d 0d 46 6f 72 1a 20 61  |.move.  ..For. a|
000002d0  64 64 69 74 69 6f 6e 2c  1a 20 74 68 65 1a 20 63  |ddition,. the. c|
000002e0  61 72 72 79 1a 20 66 6c  61 67 1a 20 6d 75 73 74  |arry. flag. must|
000002f0  1a 20 62 65 20 63 6c 65  61 72 65 64 20 66 69 72  |. be cleared fir|
00000300  73 74 20 74 68 65 6e 20  74 68 65 20 6c 6f 77 20  |st then the low |
00000310  62 79 74 65 0d 76 61 6c  75 65 73 20 61 64 64 65  |byte.values adde|
00000320  64 20 66 6f 6c 6c 6f 77  65 64 20 62 79 20 74 68  |d followed by th|
00000330  65 20 68 69 67 68 20 62  79 74 65 20 76 61 6c 75  |e high byte valu|
00000340  65 73 2e 20 20 54 68 75  73 20 2d 0d 0d 20 20 20  |es.  Thus -..   |
00000350  20 20 20 20 20 20 20 43  4c 43 3a 4c 44 41 61 64  |       CLC:LDAad|
00000360  64 72 3a 41 44 43 23 78  6c 6f 77 3a 53 54 41 61  |dr:ADC#xlow:STAa|
00000370  64 64 72 0d 20 20 20 20  20 20 20 20 20 20 4c 44  |ddr.          LD|
00000380  41 61 64 64 72 2b 31 3a  41 44 43 23 78 68 69 67  |Aaddr+1:ADC#xhig|
00000390  68 3a 53 54 41 61 64 64  72 0d 0d 61 64 64 73 20  |h:STAaddr..adds |
000003a0  74 68 65 20 74 77 6f 20  62 79 74 65 20 76 61 6c  |the two byte val|
000003b0  75 65 20 27 78 27 20 74  6f 20 74 68 65 20 61 64  |ue 'x' to the ad|
000003c0  64 72 65 73 73 20 68 65  6c 64 20 61 74 20 27 61  |dress held at 'a|
000003d0  64 64 72 27 20 61 6e 64  20 73 74 6f 72 65 73 20  |ddr' and stores |
000003e0  69 74 20 61 74 0d 74 68  69 73 20 61 64 64 72 65  |it at.this addre|
000003f0  73 73 2e 0d 0d 46 6f 72  20 73 75 62 74 72 61 63  |ss...For subtrac|
00000400  74 69 6f 6e 2c 20 74 68  65 20 72 6f 75 74 69 6e  |tion, the routin|
00000410  65 20 69 73 20 74 68 65  20 73 61 6d 65 20 65 78  |e is the same ex|
00000420  63 65 70 74 20 74 68 65  20 63 61 72 72 79 20 66  |cept the carry f|
00000430  6c 61 67 20 6d 75 73 74  20 62 65 20 73 65 74 0d  |lag must be set.|
00000440  66 69 72 73 74 2e 0d 0d  49 6e 1a 20 74 68 65 20  |first...In. the |
00000450  4d 49 4e 73 72 63 31 20  70 72 6f 67 72 61 6d 20  |MINsrc1 program |
00000460  6c 69 6e 65 20 36 35 30  2c 20 74 68 65 20 76 61  |line 650, the va|
00000470  6c 75 65 20 74 6f 20 62  65 20 61 64 64 65 64 20  |lue to be added |
00000480  69 73 20 66 69 72 73 74  20 73 74 6f 72 65 64 20  |is first stored |
00000490  69 6e 0d 26 39 30 2e 20  20 54 68 69 73 1a 20 69  |in.&90.  This. i|
000004a0  73 1a 20 74 68 65 6e 1a  20 61 64 64 65 64 20 61  |s. then. added a|
000004b0  66 74 65 72 20 6c 6f 61  64 69 6e 67 20 74 68 65  |fter loading the|
000004c0  20 76 61 6c 75 65 20 66  72 6f 6d 20 27 64 61 74  | value from 'dat|
000004d0  61 27 20 61 6e 64 20 73  74 6f 72 65 64 0d 61 67  |a' and stored.ag|
000004e0  61 69 6e 2e 20 20 41 73  20 74 68 65 72 65 20 69  |ain.  As there i|
000004f0  73 20 6e 6f 1a 20 68 69  67 68 20 62 79 74 65 20  |s no. high byte |
00000500  76 61 6c 75 65 20 74 6f  20 61 64 64 2c 20 74 68  |value to add, th|
00000510  65 20 41 44 43 23 30 20  69 6e 20 74 68 65 20 6c  |e ADC#0 in the l|
00000520  69 6e 65 20 61 64 64 73  0d 31 20 74 6f 20 74 68  |ine adds.1 to th|
00000530  65 20 68 69 67 68 20 62  79 74 65 20 69 66 1a 20  |e high byte if. |
00000540  74 68 65 1a 20 63 61 72  72 79 1a 20 66 6c 61 67  |the. carry. flag|
00000550  1a 20 69 73 20 73 65 74  20 62 79 20 74 68 65 20  |. is set by the |
00000560  61 64 64 69 74 69 6f 6e  20 6f 66 20 74 68 65 20  |addition of the |
00000570  6c 6f 77 0d 62 79 74 65  2e 1a 20 20 4c 69 6e 65  |low.byte..  Line|
00000580  73 1a 20 36 36 30 20 61  6e 64 20 36 37 30 20 61  |s. 660 and 670 a|
00000590  72 65 20 73 69 6d 69 6c  61 72 20 66 6f 72 20 63  |re similar for c|
000005a0  68 61 6e 67 69 6e 67 20  74 68 65 1a 20 61 64 64  |hanging the. add|
000005b0  72 65 73 73 1a 20 68 65  6c 64 1a 20 69 6e 0d 27  |ress. held. in.'|
000005c0  61 64 64 72 27 2e 0d 0d  54 68 65 20 6f 74 68 65  |addr'...The othe|
000005d0  72 20 72 6f 75 74 69 6e  65 20 69 73 20 66 6f 72  |r routine is for|
000005e0  20 74 72 61 6e 73 66 65  72 72 69 6e 67 20 62 6c  | transferring bl|
000005f0  6f 63 6b 73 20 6f 66 20  64 61 74 61 20 66 72 6f  |ocks of data fro|
00000600  6d 1a 20 6f 6e 65 20 6d  65 6d 6f 72 79 20 61 72  |m. one memory ar|
00000610  65 61 0d 74 6f 1a 20 61  6e 6f 74 68 65 72 2e 1a  |ea.to. another..|
00000620  20 20 54 68 69 73 20 69  73 20 64 6f 6e 65 20 77  |  This is done w|
00000630  69 74 68 20 61 20 6c 6f  6f 70 20 73 69 6d 69 6c  |ith a loop simil|
00000640  61 72 20 74 6f 20 74 68  6f 73 65 1a 20 49 1a 20  |ar to those. I. |
00000650  68 61 76 65 1a 20 61 6c  72 65 61 64 79 0d 67 69  |have. already.gi|
00000660  76 65 6e 2e 20 20 49 6e  20 6c 69 6e 65 1a 20 36  |ven.  In line. 6|
00000670  38 30 1a 20 6f 66 20 74  68 65 20 70 72 6f 67 72  |80. of the progr|
00000680  61 6d 20 72 65 66 65 72  72 65 64 20 74 6f 2c 20  |am referred to, |
00000690  64 61 74 61 20 66 72 6f  6d 20 74 68 65 20 61 64  |data from the ad|
000006a0  64 72 65 73 73 20 69 6e  0d 26 38 30 20 69 73 20  |dress in.&80 is |
000006b0  6c 6f 61 64 65 64 20 69  6e 74 6f 20 41 1a 20 72  |loaded into A. r|
000006c0  65 67 69 73 74 65 72 1a  20 61 6e 64 1a 20 73 74  |egister. and. st|
000006d0  6f 72 65 64 20 69 6e 74  6f 20 74 68 65 20 61 64  |ored into the ad|
000006e0  64 72 65 73 73 20 69 6e  27 61 64 64 72 27 20 77  |dress in'addr' w|
000006f0  69 74 68 0d 74 68 65 20  63 6f 6d 6d 61 6e 64 73  |ith.the commands|
00000700  20 2d 20 4c 44 41 28 26  38 30 29 2c 59 3a 53 54  | - LDA(&80),Y:ST|
00000710  41 28 61 64 64 72 29 2c  59 2e 20 20 41 73 20 59  |A(addr),Y.  As Y|
00000720  20 72 65 67 69 73 74 65  72 20 69 73 20 6c 6f 61  | register is loa|
00000730  64 65 64 20 77 69 74 68  20 31 37 20 61 74 0d 74  |ded with 17 at.t|
00000740  68 65 20 73 74 61 72 74  2c 20 74 68 69 73 20 69  |he start, this i|
00000750  73 20 61 64 64 65 64 20  74 6f 20 74 68 65 20 61  |s added to the a|
00000760  64 64 72 65 73 73 65 73  1a 20 61 6e 64 1a 20 65  |ddresses. and. e|
00000770  61 63 68 20 74 69 6d 65  20 72 6f 75 6e 64 20 74  |ach time round t|
00000780  68 65 20 6c 6f 6f 70 20  59 0d 69 73 20 64 65 63  |he loop Y.is dec|
00000790  72 65 61 73 65 64 20 75  6e 74 69 6c 20 74 68 65  |reased until the|
000007a0  20 76 61 6c 75 65 20 67  6f 65 73 20 6e 65 67 61  | value goes nega|
000007b0  74 69 76 65 20 77 68 65  6e 20 74 68 65 20 76 61  |tive when the va|
000007c0  6c 75 65 20 69 6e 20 59  20 66 61 6c 6c 73 20 62  |lue in Y falls b|
000007d0  65 6c 6f 77 0d 7a 65 72  6f 2e 20 20 49 6e 20 74  |elow.zero.  In t|
000007e0  68 69 73 20 77 61 79 20  31 38 20 62 79 74 65 73  |his way 18 bytes|
000007f0  20 61 72 65 20 74 72 61  6e 73 66 65 72 72 65 64  | are transferred|
00000800  2e 0d 0d 41 6e 6f 74 68  65 72 20 6c 6f 6f 70 20  |...Another loop |
00000810  6f 66 74 65 6e 20 75 73  65 64 20 69 73 20 74 68  |often used is th|
00000820  69 73 20 2d 0d 0d 20 20  20 20 20 20 20 20 20 20  |is -..          |
00000830  20 20 20 20 20 20 20 20  20 4c 44 59 23 30 0d 20  |         LDY#0. |
00000840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000850  20 20 2e 6c 6f 6f 70 0d  20 20 20 20 20 20 20 20  |  .loop.        |
00000860  20 20 20 20 20 20 20 20  20 20 20 3c 74 72 61 6e  |           <tran|
00000870  73 66 65 72 20 63 6f 6d  6d 61 6e 64 73 3e 0d 20  |sfer commands>. |
00000880  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000890  20 20 49 4e 59 3a 42 4e  45 6c 6f 6f 70 0d 20 20  |  INY:BNEloop.  |
000008a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000008b0  20 52 54 53 0d 0d 54 68  69 73 1a 20 74 72 61 6e  | RTS..This. tran|
000008c0  73 66 65 72 73 1a 20 32  35 36 1a 20 62 79 74 65  |sfers. 256. byte|
000008d0  73 2c 1a 20 69 65 20 61  20 70 61 67 65 20 6f 66  |s,. ie a page of|
000008e0  20 64 61 74 61 20 61 6e  64 1a 20 63 61 6e 1a 20  | data and. can. |
000008f0  62 65 1a 20 65 78 74 65  6e 64 65 64 1a 20 74 6f  |be. extended. to|
00000900  0d 74 72 61 6e 73 66 65  72 20 73 65 76 65 72 61  |.transfer severa|
00000910  6c 20 70 61 67 65 73 20  62 79 20 69 6e 63 72 65  |l pages by incre|
00000920  61 73 69 6e 67 1a 20 74  68 65 20 68 69 67 68 20  |asing. the high |
00000930  62 79 74 65 73 20 6f 66  20 74 68 65 20 61 64 64  |bytes of the add|
00000940  72 65 73 73 65 73 20 65  61 63 68 0d 74 69 6d 65  |resses each.time|
00000950  20 74 68 65 20 6c 6f 6f  70 20 69 73 20 63 6f 6d  | the loop is com|
00000960  70 6c 65 74 65 64 20 61  6e 64 20 65 69 74 68 65  |pleted and eithe|
00000970  72 20 63 6f 75 6e 74 69  6e 67 20 74 68 65 20 6e  |r counting the n|
00000980  75 6d 62 65 72 20 6f 66  20 70 61 67 65 73 20 75  |umber of pages u|
00000990  73 69 6e 67 20 58 0d 72  65 67 69 73 74 65 72 20  |sing X.register |
000009a0  61 73 20 61 20 63 6f 75  6e 74 65 72 20 6f 72 20  |as a counter or |
000009b0  63 6f 6d 70 61 72 69 6e  67 20 74 68 65 20 68 69  |comparing the hi|
000009c0  67 68 20 62 79 74 65 20  6f 66 20 6f 6e 65 20 6f  |gh byte of one o|
000009d0  66 20 74 68 65 20 61 64  64 72 65 73 73 65 73 2e  |f the addresses.|
000009e0  0d 0d 4e 6f 77 1a 20 66  6f 72 20 74 68 65 20 67  |..Now. for the g|
000009f0  61 6d 65 20 73 75 63 68  20 61 73 20 69 74 20 69  |ame such as it i|
00000a00  73 21 21 20 20 49 74 20  77 61 73 20 62 61 73 65  |s!!  It was base|
00000a10  64 20 6f 6e 20 61 20 73  65 72 69 65 73 20 6f 66  |d on a series of|
00000a20  20 61 72 74 69 63 6c 65  73 20 69 6e 0d 27 4c 65  | articles in.'Le|
00000a30  74 27 73 20 43 6f 6d 70  75 74 65 27 20 2d 20 72  |t's Compute' - r|
00000a40  65 6d 65 6d 62 65 72 20  74 68 65 20 6b 69 64 27  |emember the kid'|
00000a50  73 20 6d 61 67 61 7a 69  6e 65 3f 20 20 49 74 20  |s magazine?  It |
00000a60  69 73 20 66 61 72 20 66  72 6f 6d 20 63 6f 6d 70  |is far from comp|
00000a70  6c 65 74 65 20 61 73 0d  74 68 65 20 73 65 72 69  |lete as.the seri|
00000a80  65 73 20 77 61 73 20 75  6e 66 69 6e 69 73 68 65  |es was unfinishe|
00000a90  64 20 77 68 65 6e 1a 20  74 68 65 1a 20 6d 61 67  |d when. the. mag|
00000aa0  61 7a 69 6e 65 20 73 74  6f 70 70 65 64 20 70 75  |azine stopped pu|
00000ab0  62 6c 69 63 61 74 69 6f  6e 2e 20 20 49 74 20 77  |blication.  It w|
00000ac0  61 73 0d 61 6c 73 6f 20  77 72 69 74 74 65 6e 20  |as.also written |
00000ad0  69 6e 20 72 61 74 68 65  72 20 70 65 63 75 6c 69  |in rather peculi|
00000ae0  61 72 20 42 61 73 69 63  20 61 73 1a 20 69 74 1a  |ar Basic as. it.|
00000af0  20 77 61 73 1a 20 74 6f  20 62 65 20 61 64 61 70  | was. to be adap|
00000b00  74 65 64 20 66 6f 72 20  6f 74 68 65 72 0d 6d 61  |ted for other.ma|
00000b10  63 68 69 6e 65 73 20 61  6e 64 20 49 20 74 68 6f  |chines and I tho|
00000b20  67 68 74 20 69 74 20 61  20 63 68 61 6c 6c 65 6e  |ght it a challen|
00000b30  67 65 20 74 6f 20 72 65  77 72 69 74 65 20 69 6e  |ge to rewrite in|
00000b40  1a 20 4d 2f 63 6f 64 65  2e 20 20 49 20 74 68 6f  |. M/code.  I tho|
00000b50  67 68 74 20 61 6c 73 6f  0d 74 68 61 74 20 74 68  |ght also.that th|
00000b60  65 72 65 20 77 61 73 20  73 75 66 66 69 63 69 65  |ere was sufficie|
00000b70  6e 74 20 74 6f 20 67 69  76 65 20 79 6f 75 20 73  |nt to give you s|
00000b80  6f 6d 65 20 69 64 65 61  73 20 6f 6e 20 77 72 69  |ome ideas on wri|
00000b90  74 69 6e 67 1a 20 61 6e  1a 20 61 64 76 65 6e 74  |ting. an. advent|
00000ba0  75 72 65 0d 70 72 6f 67  72 61 6d 1a 20 69 6e 1a  |ure.program. in.|
00000bb0  20 4d 2f 63 6f 64 65 20  61 6e 64 20 61 6c 73 6f  | M/code and also|
00000bc0  20 74 6f 20 73 68 6f 77  20 73 6f 6d 65 20 66 75  | to show some fu|
00000bd0  72 74 68 65 72 20 72 6f  75 74 69 6e 65 73 2e 20  |rther routines. |
00000be0  20 49 66 20 61 6e 79 6f  6e 65 20 68 61 73 0d 69  | If anyone has.i|
00000bf0  64 65 61 73 20 6f 6e 20  68 6f 77 1a 20 74 6f 20  |deas on how. to |
00000c00  63 6f 6d 70 6c 65 74 65  20 74 68 65 20 67 61 6d  |complete the gam|
00000c10  65 20 6f 72 20 74 6f 20  77 72 69 74 65 20 61 6e  |e or to write an|
00000c20  6f 74 68 65 72 2c 20 49  20 77 6f 75 6c 64 20 62  |other, I would b|
00000c30  65 20 67 6c 61 64 20 74  6f 0d 68 65 6c 70 2e 20  |e glad to.help. |
00000c40  20 0d 0d 46 69 72 73 74  20 49 20 77 69 6c 6c 20  | ..First I will |
00000c50  67 69 76 65 20 61 20 62  72 65 61 6b 64 6f 77 6e  |give a breakdown|
00000c60  20 6f 66 20 74 68 65 20  70 72 6f 67 72 61 6d 20  | of the program |
00000c70  72 65 66 65 72 72 69 6e  67 20 74 6f 20 74 68 65  |referring to the|
00000c80  20 6c 69 6e 65 73 20 6f  66 20 74 68 65 0d 61 73  | lines of the.as|
00000c90  73 65 6d 62 6c 65 72 20  77 68 69 63 68 20 70 72  |sembler which pr|
00000ca0  6f 64 75 63 65 20 74 68  65 20 63 6f 64 65 20 61  |oduce the code a|
00000cb0  73 20 49 20 64 69 64 20  6c 61 73 74 20 74 69 6d  |s I did last tim|
00000cc0  65 2e 0d 0d 4c 69 6e 65  73 20 31 32 30 20 2d 20  |e...Lines 120 - |
00000cd0  31 30 39 30 20 20 20 20  61 72 65 20 74 68 65 20  |1090    are the |
00000ce0  73 75 62 72 6f 75 74 69  6e 65 73 0d 20 20 20 20  |subroutines.    |
00000cf0  20 20 32 30 30 30 20 2d  20 32 32 34 30 20 20 20  |  2000 - 2240   |
00000d00  61 72 65 20 74 68 65 20  6d 61 69 6e 20 6c 6f 6f  |are the main loo|
00000d10  70 0d 20 20 20 20 20 20  35 30 30 30 20 2d 20 20  |p.      5000 -  |
00000d20  20 20 20 20 20 20 74 68  65 20 62 75 66 66 65 72  |      the buffer|
00000d30  20 66 6f 72 20 6f 73 77  6f 72 64 20 28 26 46 46  | for osword (&FF|
00000d40  46 31 29 20 66 6f 72 20  74 68 65 20 69 6e 70 75  |F1) for the inpu|
00000d50  74 2e 0d 20 20 20 20 20  20 35 30 31 30 20 2d 20  |t..      5010 - |
00000d60  20 20 20 20 20 20 20 74  69 74 6c 65 20 64 61 74  |       title dat|
00000d70  61 0d 20 20 20 20 20 20  35 30 32 30 20 2d 20 35  |a.      5020 - 5|
00000d80  30 33 30 20 20 20 64 61  74 61 20 66 6f 72 20 70  |030   data for p|
00000d90  72 69 6e 74 69 6e 67 20  74 68 65 20 64 69 72 65  |rinting the dire|
00000da0  63 74 69 6f 6e 73 0d 20  20 20 20 20 20 35 30 34  |ctions.      504|
00000db0  30 20 2d 20 35 32 34 30  20 20 20 6d 65 73 73 61  |0 - 5240   messa|
00000dc0  67 65 20 64 61 74 61 0d  20 20 20 20 20 20 35 32  |ge data.      52|
00000dd0  35 30 20 2d 20 35 32 38  30 20 20 20 74 61 62 6c  |50 - 5280   tabl|
00000de0  65 20 6f 66 20 6d 65 73  73 61 67 65 20 61 64 64  |e of message add|
00000df0  72 65 73 73 65 73 0d 20  20 20 20 20 20 35 32 39  |resses.      529|
00000e00  30 20 2d 20 20 20 20 20  20 20 20 66 6c 61 67 20  |0 -        flag |
00000e10  66 6f 72 20 74 68 65 20  6d 65 73 73 61 67 65 73  |for the messages|
00000e20  0d 20 20 20 20 20 20 35  33 30 30 20 2d 20 35 35  |.      5300 - 55|
00000e30  35 30 20 20 20 77 6f 72  64 73 20 66 6f 72 20 43  |50   words for C|
00000e40  4f 4d 4d 41 4e 44 53 0d  20 20 20 20 20 20 20 20  |OMMANDS.        |
00000e50  20 20 20 20 20 35 33 31  30 20 20 20 64 69 72 65  |     5310   dire|
00000e60  63 74 69 6f 6e 73 20 2d  20 73 69 6e 67 6c 65 20  |ctions - single |
00000e70  6c 65 74 74 65 72 73 0d  20 20 20 20 20 20 20 20  |letters.        |
00000e80  20 20 20 20 20 35 33 32  30 20 20 20 64 69 72 65  |     5320   dire|
00000e90  63 74 69 6f 6e 73 20 2d  20 77 6f 72 64 73 0d 20  |ctions - words. |
00000ea0  20 20 20 20 20 20 20 20  20 20 20 20 35 33 34 30  |            5340|
00000eb0  20 20 20 61 63 74 69 6f  6e 73 0d 20 20 20 20 20  |   actions.     |
00000ec0  20 20 20 20 20 20 20 20  35 34 30 30 20 20 20 75  |        5400   u|
00000ed0  73 65 66 75 6c 20 6f 62  6a 65 63 74 73 20 74 6f  |seful objects to|
00000ee0  20 74 61 6b 65 0d 20 20  20 20 20 20 20 20 20 20  | take.          |
00000ef0  20 20 20 35 34 37 30 20  20 20 6f 74 68 65 72 20  |   5470   other |
00000f00  6f 62 6a 65 63 74 73 0d  20 20 20 20 20 20 20 20  |objects.        |
00000f10  20 20 20 20 20 35 35 35  30 20 20 20 69 6e 76 65  |     5550   inve|
00000f20  6e 74 6f 72 79 0d 20 20  20 20 20 20 35 35 37 30  |ntory.      5570|
00000f30  20 2d 20 20 20 20 20 20  20 20 73 74 6f 72 65 73  | -        stores|
00000f40  20 74 68 65 20 63 75 72  72 65 6e 74 20 6c 61 63  | the current lac|
00000f50  61 74 69 6f 6e 20 6e 75  6d 62 65 72 0d 20 20 20  |ation number.   |
00000f60  20 20 20 35 35 38 30 20  2d 20 35 37 38 30 20 20  |   5580 - 5780  |
00000f70  20 6c 6f 63 61 74 69 6f  6e 73 0d 20 20 20 20 20  | locations.     |
00000f80  20 35 37 39 30 20 2d 20  35 38 32 30 20 20 20 74  | 5790 - 5820   t|
00000f90  61 62 6c 65 20 6f 66 20  6c 6f 63 61 74 69 6f 6e  |able of location|
00000fa0  20 61 64 64 72 65 73 73  65 73 0d 20 20 20 20 20  | addresses.     |
00000fb0  20 35 38 33 30 20 2d 20  36 30 33 30 20 20 20 6d  | 5830 - 6030   m|
00000fc0  6f 76 65 6d 65 6e 74 20  64 61 74 61 0d 20 20 20  |ovement data.   |
00000fd0  20 20 20 36 30 34 30 20  2d 20 36 31 38 30 20 20  |   6040 - 6180  |
00000fe0  20 6f 62 6a 65 63 74 20  64 65 73 63 72 69 70 74  | object descript|
00000ff0  69 6f 6e 73 0d 20 20 20  20 20 20 36 31 39 30 20  |ions.      6190 |
00001000  2d 20 36 32 31 30 20 20  20 74 61 62 6c 65 20 6f  |- 6210   table o|
00001010  66 20 61 64 64 72 65 73  73 65 73 20 66 6f 72 20  |f addresses for |
00001020  74 68 65 73 65 0d 20 20  20 20 20 20 36 32 32 30  |these.      6220|
00001030  20 2d 20 20 20 20 20 20  20 20 64 61 74 61 20 66  | -        data f|
00001040  6f 72 20 6f 62 6a 65 63  74 20 70 6f 73 69 74 69  |or object positi|
00001050  6f 6e 73 0d 20 20 20 20  20 20 36 32 33 30 20 2d  |ons.      6230 -|
00001060  20 20 20 20 20 20 20 20  64 61 74 61 20 66 6f 72  |        data for|
00001070  20 6f 62 6a 65 63 74 73  20 68 65 6c 64 0d 20 20  | objects held.  |
00001080  20 20 20 20 36 32 34 30  20 2d 20 20 20 20 20 20  |    6240 -      |
00001090  20 20 74 77 6f 20 62 79  74 65 73 20 66 6f 72 20  |  two bytes for |
000010a0  68 6f 6c 64 69 6e 67 20  74 68 65 20 61 63 74 69  |holding the acti|
000010b0  6f 6e 20 6e 75 6d 62 65  72 73 0d 0d 49 1a 20 77  |on numbers..I. w|
000010c0  69 6c 6c 20 64 65 73 63  72 69 62 65 20 74 68 65  |ill describe the|
000010d0  20 77 6f 72 6b 69 6e 67  20 6f 66 20 74 68 65 20  | working of the |
000010e0  70 72 6f 67 72 61 6d 20  66 72 6f 6d 20 74 68 65  |program from the|
000010f0  20 73 74 61 72 74 20 28  6c 69 6e 65 20 32 30 30  | start (line 200|
00001100  30 29 20 61 6e 64 0d 65  78 70 6c 61 69 6e 20 74  |0) and.explain t|
00001110  68 65 20 73 75 62 72 6f  75 74 69 6e 65 73 20 61  |he subroutines a|
00001120  73 20 74 68 65 79 1a 20  61 72 65 1a 20 75 73 65  |s they. are. use|
00001130  64 20 61 67 61 69 6e 20  72 65 66 65 72 72 69 6e  |d again referrin|
00001140  67 20 74 6f 20 74 68 65  20 6c 69 6e 65 73 20 69  |g to the lines i|
00001150  6e 0d 74 68 65 20 61 73  73 65 6d 62 6c 65 72 20  |n.the assembler |
00001160  6c 69 73 74 69 6e 67 2e  0d 0d 41 74 20 74 68 65  |listing...At the|
00001170  20 73 74 61 72 74 20 79  6f 75 20 61 72 65 20 69  | start you are i|
00001180  6e 1a 20 6c 6f 63 61 74  69 6f 6e 1a 20 31 1a 20  |n. location. 1. |
00001190  2d 1a 20 54 68 65 1a 20  43 6f 6e 74 72 6f 6c 20  |-. The. Control |
000011a0  52 6f 6f 6d 20 61 73 20  74 68 65 20 76 61 6c 75  |Room as the valu|
000011b0  65 20 69 6e 0d 27 6c 6f  63 27 20 28 6c 69 6e 65  |e in.'loc' (line|
000011c0  20 35 35 37 30 29 20 69  73 20 31 2e 0d 0d 4c 69  | 5570) is 1...Li|
000011d0  6e 65 20 32 30 31 30 20  73 65 6c 65 63 74 73 20  |ne 2010 selects |
000011e0  4d 4f 44 45 20 36 20 66  6f 6c 6c 6f 77 65 64 20  |MODE 6 followed |
000011f0  62 79 20 74 77 6f 20 4f  53 4e 45 57 4c 73 2e 0d  |by two OSNEWLs..|
00001200  20 20 20 20 20 32 30 32  30 20 75 73 65 73 20 72  |     2020 uses r|
00001210  6f 75 74 69 6e 65 20 27  72 65 70 27 20 74 6f 20  |outine 'rep' to |
00001220  70 72 69 6e 74 20 31 32  20 73 70 61 63 65 73 20  |print 12 spaces |
00001230  3c 54 41 42 28 31 32 29  3e 2c 20 61 6e 64 20 70  |<TAB(12)>, and p|
00001240  72 69 6e 74 73 20 74 68  65 0d 20 20 20 20 20 20  |rints the.      |
00001250  20 20 20 20 74 69 74 6c  65 20 75 73 69 6e 67 20  |    title using |
00001260  72 6f 75 74 69 6e 65 20  27 70 72 74 27 20 61 6e  |routine 'prt' an|
00001270  64 20 61 6e 20 4f 53 4e  45 57 4c 2e 0d 20 20 20  |d an OSNEWL..   |
00001280  20 20 32 30 33 30 20 70  72 69 6e 74 73 20 74 68  |  2030 prints th|
00001290  65 20 75 6e 64 65 72 6c  69 6e 65 0d 20 20 20 20  |e underline.    |
000012a0  20 0d 54 68 65 20 6d 61  69 6e 20 6c 6f 6f 70 20  | .The main loop |
000012b0  73 74 61 72 74 73 20 61  74 20 6c 69 6e 65 20 32  |starts at line 2|
000012c0  30 34 30 2e 0d 0d 54 68  65 20 6d 65 73 73 61 67  |040...The messag|
000012d0  65 73 20 61 72 65 20 70  72 69 6e 74 65 64 20 62  |es are printed b|
000012e0  79 20 6c 6f 61 64 69 6e  67 1a 20 41 1a 20 72 65  |y loading. A. re|
000012f0  67 69 73 74 65 72 1a 20  77 69 74 68 1a 20 74 68  |gister. with. th|
00001300  65 1a 20 6e 75 6d 62 65  72 20 6f 66 20 74 68 65  |e. number of the|
00001310  0d 6d 65 73 73 61 67 65  20 61 6e 64 20 74 68 65  |.message and the|
00001320  6e 20 63 61 6c 6c 69 6e  67 20 74 68 65 20 72 6f  |n calling the ro|
00001330  75 74 69 6e 65 20 27 70  72 74 6d 65 73 73 27 2e  |utine 'prtmess'.|
00001340  20 20 54 68 65 20 76 61  6c 75 65 20 69 6e 20 41  |  The value in A|
00001350  20 69 73 20 64 6f 75 62  6c 65 64 0d 62 79 20 41  | is doubled.by A|
00001360  53 4c 20 41 2c 20 32 20  73 75 62 74 72 61 63 74  |SL A, 2 subtract|
00001370  65 64 20 61 6e 64 20 74  68 65 20 76 61 6c 75 65  |ed and the value|
00001380  20 74 72 61 6e 73 66 65  72 72 65 64 20 74 6f 20  | transferred to |
00001390  59 20 72 65 67 69 73 74  65 72 2e 20 20 54 68 75  |Y register.  Thu|
000013a0  73 20 59 20 69 73 0d 6c  6f 61 64 65 64 20 77 69  |s Y is.loaded wi|
000013b0  74 68 20 30 2c 20 32 2c  20 34 2c 2e 2e 2e 20 61  |th 0, 2, 4,... a|
000013c0  63 63 6f 72 64 69 6e 67  20 74 6f 20 77 68 69 63  |ccording to whic|
000013d0  68 20 6d 65 73 73 61 67  65 20 69 73 20 74 6f 20  |h message is to |
000013e0  62 65 20 70 72 69 6e 74  65 64 2e 20 20 54 68 69  |be printed.  Thi|
000013f0  73 0d 69 73 20 74 68 65  6e 20 75 73 65 64 20 61  |s.is then used a|
00001400  73 20 61 6e 1a 20 69 6e  64 65 78 20 74 6f 20 74  |s an. index to t|
00001410  68 65 20 74 77 6f 20 62  79 74 65 73 20 6f 72 20  |he two bytes or |
00001420  74 68 65 20 20 61 64 64  72 65 73 73 20 6f 66 20  |the  address of |
00001430  74 68 65 20 6d 65 73 73  61 67 65 2e 20 0d 54 68  |the message. .Th|
00001440  65 73 65 20 74 77 6f 20  76 61 6c 75 65 73 20 61  |ese two values a|
00001450  72 65 20 74 68 65 6e 20  6c 6f 61 64 65 64 20 69  |re then loaded i|
00001460  6e 74 6f 20 58 20 61 6e  64 20 59 20 72 65 67 69  |nto X and Y regi|
00001470  73 74 65 72 73 20 62 65  66 6f 72 65 20 63 61 6c  |sters before cal|
00001480  6c 69 6e 67 20 74 68 65  0d 72 6f 75 74 69 6e 65  |ling the.routine|
00001490  20 27 70 72 74 27 2e 0d  0d 54 68 65 1a 20 72 6f  | 'prt'...The. ro|
000014a0  75 74 69 6e 65 1a 20 27  70 72 74 6c 6f 63 27 20  |utine. 'prtloc' |
000014b0  77 6f 72 6b 73 20 69 6e  20 74 68 65 20 73 61 6d  |works in the sam|
000014c0  65 20 77 61 79 20 65 78  63 65 70 74 1a 20 74 68  |e way except. th|
000014d0  61 74 1a 20 41 1a 20 72  65 67 69 73 74 65 72 1a  |at. A. register.|
000014e0  20 69 73 0d 6c 6f 61 64  65 64 20 77 69 74 68 20  | is.loaded with |
000014f0  74 68 65 1a 20 76 61 6c  75 65 1a 20 6f 66 1a 20  |the. value. of. |
00001500  74 68 65 20 63 75 72 72  65 6e 74 20 6c 6f 63 61  |the current loca|
00001510  74 69 6f 6e 20 68 65 6c  64 20 69 6e 20 27 6c 6f  |tion held in 'lo|
00001520  63 27 20 73 6f 20 74 68  61 74 20 79 6f 75 0d 61  |c' so that you.a|
00001530  72 65 20 74 6f 6c 64 20  77 68 65 72 65 20 79 6f  |re told where yo|
00001540  75 20 61 72 65 2e 0d 0d  54 68 69 73 20 6d 65 74  |u are...This met|
00001550  68 6f 64 20 6f 66 20 72  65 66 65 72 72 69 6e 67  |hod of referring|
00001560  20 74 6f 20 61 6e 20 61  64 64 72 65 73 73 20 69  | to an address i|
00001570  6e 20 61 20 74 61 62 6c  65 20 69 73 20 6f 66 74  |n a table is oft|
00001580  65 6e 20 75 73 65 64 20  69 6e 20 4d 2f 63 6f 64  |en used in M/cod|
00001590  65 2e 0d 49 6e 20 74 68  69 73 20 70 72 6f 67 72  |e..In this progr|
000015a0  61 6d 20 69 74 20 69 73  20 75 73 65 64 20 74 6f  |am it is used to|
000015b0  20 73 65 74 20 75 70 20  74 68 65 20 70 72 69 6e  | set up the prin|
000015c0  74 69 6e 67 20 6f 66 20  74 68 65 20 64 61 74 61  |ting of the data|
000015d0  20 61 6e 64 20 77 68 61  74 20 79 6f 75 0d 63 61  | and what you.ca|
000015e0  6e 20 64 6f 20 61 63 63  6f 72 64 69 6e 67 20 74  |n do according t|
000015f0  6f 20 74 68 65 1a 20 6c  6f 63 61 74 69 6f 6e 20  |o the. location |
00001600  79 6f 75 20 61 72 65 20  73 69 6e 63 65 20 74 68  |you are since th|
00001610  65 20 76 61 6c 75 65 20  69 6e 20 27 6c 6f 63 27  |e value in 'loc'|
00001620  20 69 73 20 75 73 65 64  0d 66 6f 72 20 74 68 65  | is used.for the|
00001630  20 69 6e 64 65 78 2e 0d  0d 4c 69 6e 65 1a 20 32  | index...Line. 2|
00001640  30 38 30 20 70 72 69 6e  74 73 20 6d 65 73 73 61  |080 prints messa|
00001650  67 65 20 32 20 61 6e 64  1a 20 74 68 65 1a 20 72  |ge 2 and. the. r|
00001660  6f 75 74 69 6e 65 1a 20  27 6c 64 6f 62 73 27 1a  |outine. 'ldobs'.|
00001670  20 69 73 1a 20 63 61 6c  6c 65 64 2e 1a 20 20 54  | is. called..  T|
00001680  68 69 73 0d 72 6f 75 74  69 6e 65 20 73 65 61 72  |his.routine sear|
00001690  63 68 65 73 20 74 68 65  20 64 61 74 61 20 27 6f  |ches the data 'o|
000016a0  62 73 64 61 74 27 20 28  6c 69 6e 65 20 36 32 32  |bsdat' (line 622|
000016b0  30 29 20 2d 20 6e 6f 74  65 20 74 68 61 74 20 65  |0) - note that e|
000016c0  61 63 68 20 66 6f 75 72  20 62 79 74 65 73 0d 61  |ach four bytes.a|
000016d0  72 65 20 69 6e 20 72 65  76 65 72 73 65 20 6f 72  |re in reverse or|
000016e0  64 65 72 20 61 73 20 74  68 65 79 20 61 72 65 20  |der as they are |
000016f0  65 6e 74 65 72 65 64 20  75 73 69 6e 67 20 45 51  |entered using EQ|
00001700  55 44 2e 0d 0d 54 68 65  20 64 61 74 61 1a 20 69  |UD...The data. i|
00001710  73 20 63 6f 6d 70 61 72  65 64 20 77 69 74 68 20  |s compared with |
00001720  74 68 65 20 6c 6f 63 61  74 69 6f 6e 20 6e 75 6d  |the location num|
00001730  62 65 72 20 61 6e 64 2c  20 69 66 20 74 68 65 79  |ber and, if they|
00001740  20 61 72 65 20 65 71 75  61 6c 2c 20 74 68 65 0d  | are equal, the.|
00001750  6f 62 6a 65 63 74 20 6e  75 6d 62 65 72 2c 20 77  |object number, w|
00001760  68 69 63 68 1a 20 69 73  1a 20 74 68 65 1a 20 76  |hich. is. the. v|
00001770  61 6c 75 65 1a 20 69 6e  1a 20 59 1a 20 72 65 67  |alue. in. Y. reg|
00001780  69 73 74 65 72 2c 20 69  73 20 70 72 69 6e 74 65  |ister, is printe|
00001790  64 20 77 69 74 68 20 74  68 65 0d 72 6f 75 74 69  |d with the.routi|
000017a0  6e 65 20 27 70 72 74 6f  62 27 20 28 6c 69 6e 65  |ne 'prtob' (line|
000017b0  20 34 34 30 29 2e 20 20  54 68 65 20 27 6f 62 66  | 440).  The 'obf|
000017c0  6c 61 67 27 20 28 26 37  35 29 20 69 73 20 73 65  |lag' (&75) is se|
000017d0  74 20 74 6f 20 2d 31 20  28 26 46 46 29 20 74 6f  |t to -1 (&FF) to|
000017e0  20 73 68 6f 77 0d 74 68  61 74 20 61 6e 20 6f 62  | show.that an ob|
000017f0  6a 65 63 74 20 68 61 73  20 62 65 20 66 6f 75 6e  |ject has be foun|
00001800  64 2e 0d 0d 4f 6e 20 63  6f 6d 70 6c 65 74 69 6f  |d...On completio|
00001810  6e 20 6f 66 20 74 68 65  20 73 65 61 72 63 68 2c  |n of the search,|
00001820  1a 20 74 68 65 20 70 72  6f 67 72 61 6d 20 6a 75  |. the program ju|
00001830  6d 70 73 20 74 6f 20 27  72 65 74 27 20 61 6e 64  |mps to 'ret' and|
00001840  20 74 68 65 20 6f 62 66  6c 61 67 20 69 73 0d 63  | the obflag is.c|
00001850  6f 6d 70 61 72 65 64 20  77 69 74 68 20 26 46 46  |ompared with &FF|
00001860  2e 20 20 49 66 20 74 68  69 73 20 69 73 1a 20 65  |.  If this is. e|
00001870  71 75 61 6c 1a 20 74 68  65 1a 20 72 6f 75 74 69  |qual. the. routi|
00001880  6e 65 20 65 6e 64 73 2e  20 20 49 66 20 6e 6f 20  |ne ends.  If no |
00001890  6f 62 6a 65 63 74 20 69  73 0d 66 6f 75 6e 64 20  |object is.found |
000018a0  74 68 65 6e 20 74 68 65  20 6f 62 66 6c 61 67 20  |then the obflag |
000018b0  69 73 20 7a 65 72 6f 20  61 6e 64 20 6d 65 73 73  |is zero and mess|
000018c0  61 67 65 20 31 35 20 69  73 20 70 72 69 6e 74 65  |age 15 is printe|
000018d0  64 20 28 6c 69 6e 65 20  35 38 30 29 2e 0d 0d     |d (line 580)...|
000018df
F/M\cTut1.m0
F/M\cTut1.m1
F/M\cTut1.m2
F/M\cTut1.m4
F/M\cTut1.m5