Home » CEEFAX disks » telesoftware3.adl » 27_11_87/T\SWR06
27_11_87/T\SWR06
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » CEEFAX disks » telesoftware3.adl |
Filename: | 27_11_87/T\SWR06 |
Read OK: | ✔ |
File size: | 2F6E bytes |
Load address: | 0000 |
Exec address: | 0000 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- CEEFAX disks » telesoftware3.adl » 27_11_87/T\SWR06
- CEEFAX disks » telesoftware8.adl » 13-08-88/T\SWR06
File contents
Mastering Sideways ROM & RAM - Module 06 - Osbyte ------------------------------------------------- In Module 5 you were shown how to read an argument which follows a * command. The argument is always read as an ASCII string. This is fine if the string is a word such as "ON" or "OFF" but it can be a problem if the argument is a number. The number must be read as an ASCII string but it has to be converted into binary before the computer can use it as a number. The computer can store a number in the range from &00 to &FF in one byte. In order to read just one byte as an argument up to three ASCII characters representing the byte have to be read, converted into binary and stored in a byte of user memory. You have two options if you want to read numerical arguments. 1. Write a routine to read every ASCII character in the argument and convert the ASCII representation of the number into binary. 2. Use the MOS to do the work for you. The first option, not surprisingly, involves more work than the second. If you write your own conversion routine it has to include error handling and a check for validity. It also has to have somewhere in memory to store the result. This will be covered in detail in Module 9. The second option involves defining a new Osbyte or Osword. Osbyte will be covered in this module and Osword in Module 7. Osbyte is an MOS call specified by the contents of the accumulator taking parameters in the X and Y registers. Osbyte calls 22 (&15) to 116 (&74) are not used by MOS 1.20 and can be defined within your SWR programs. Other operating systems use some of these unused Osbyte calls. For example *FX 114 is used to switch shadow screen memory on and off in the B+ and Master computers. You can use TRACE to check if any particular Osbyte call is unused by your operating system. *FX 100 is not used by any operating system (as far as I know) and will be used in the example program for this module. Load the object code generated by TRACE into SWR and press the Break key. Type *FX 100 and press Return. You will see that service call 7 is used for an unrecognised Osbyte. Type *FX 100,1,1 and you will see that the Osbyte X and Y parameters are not made available to the interpreter in the X and Y registers as you might expect. Figure 6.1 shows that, whatever value you type for the Osbyte X and Y parameters, the rom is entered with X storing the rom number and Y storing zero. >*FX 100 A=07 X=0F Y=00 Unrecognised Osbyte >*FX 100,1,1 A=07 X=0F Y=00 Unrecognised Osbyte >*FX 100,100,100 A=07 X=0F Y=00 Unrecognised Osbyte > Figure 6.1 Service trace for unrecognised Osbyte. ------------------------------------------------- Osbyte uses three consecutive bytes in zero page to store the values of the A, X and Y registers. The accumulator value for the most recent Osbyte (or Osword) is stored in &EF. The X register value is stored in &F0 and the Y register value is stored in &F1. Both Osbyte and Osword make the three registers available to the routine through these three zero page locations. After processing an Osbyte call any values that need to be returned to the calling routine should be stored in locations &F0 and &F1. On return the number stored in the X register and &F0 should be the same and the number stored in the Y register and &F1 should be the same. &EF should store the number of your new Osbyte and the accumulator should be reset to zero before returning to the MOS. On return to the MOS the number stored in &EF is copied into the accumulator. You can use the X and Y parameters of an Osbyte call to make two (one byte) numbers or one (two byte) number available to your new routine. If you want to make a two byte number available store the least significant byte in X and the most significant byte in Y. For example, LDA #100 \ New osbyte LDX #(number MOD 256) \ Least significant byte LDY #(number DIV 256) \ Most significant byte JSR &FFF4 \ Call osbyte Your new Osbyte can then read the least significant byte fron &F0 and the most significant byte from &F1. It can also use these memory locations for post-indexed indirect addressing. The interpreter needed to implement a new Osbyte is probably the easiest of all interpreters to write. An outline interpreter is shown in figure 6.2. .service PHA \ push accumulator CMP #7 \ is it an unrecognised Osbyte? BEQ newosbyte \ branch if it is .exit PLA \ pull accumulator RTS \ return and give other roms the call .newosbyte LDA &EF \ load Osbyte number from &EF CMP #100 \ is it 100? BNE exit \ branch if not Osbyte 100 LDX &F0 \ read X from &F0 LDY &F1 \ read Y from &F1 . . \ new routine goes in here . STX &F0 \ store result for X STY &F1 \ store result for Y PLA \ pull A pushed by interpreter LDA #0 \ other roms ignore this call RTS \ return to MOS Figure 6.2 An Osbyte interpreter. --------------------------------- The service entry point of the outline interpreter in figure 6.2 will have a jump to the label ".service". On entering the interpreter the accumulator is pushed on the stack and then compared with 7 to see if the call is an unrecognised Osbyte. If it is not the accumulator is pulled off the stack and control is returned to the MOS. If the call is for an unrecognised Osbyte the number stored in &EF is loaded into the accumulator and compared with the number of the new Osbyte, in this example 100. If the unrecognised Osbyte number stored in &EF is not 100 the accumulator is pulled off the stack and control is returned to the MOS. If it is 100 then the parameters (if used) can be read from &F0 (X register) and &F1 (Y register) and the new routine can be executed. After completing the new routine any results are stored in &F0 (X register) and &F1 (Y register). The index registers and their zero page copies should be identical. Even if you don't want to write any results you should still ensure that the index registers are identical to their zero page copies. The accumulator was pushed on the stack by the interpreter and it is pulled back off to balance the stack. The accumulator is reset to zero to inform other roms that the service call has been recognised and control is passed back to the MOS. The interpreter in figure 6.2 is used in the example program OSBYTE. This program generates the object code for *FX 100,x,y in which the X parameter is the number of a rom to be disabled and the Y parameter is used as a flag which, if set, tells the routine to print a list of the active roms. If the X parameter is outside the range from 0 to 15 it is ignored. To use the program load the object code it generates into SWR and press the Break key. You can use the new Osbyte to disable any rom, except BASIC, until the Break key is pressed to re-enable it. Type *FX 100,100,1 to list the roms in your computer. This command will be recognised as the new Osbyte but the X parameter is out of range and it will not disable any rom. The Y parameter has a value other than zero and the active roms will be listed. Type *FX 100,10 to disable rom &0A without listing the active roms. The Y parameter is not specified and takes the default value of zero. Type *FX 100,8,1 to disable rom &08 and list the active roms. You can re-enable all the roms disabled with this new Osbyte by pressing the Break key. The program uses an Osbyte interpreter (lines 310-410) similar to the one outlined in figure 6.2. After recognising the new Osbyte (lines 390-410) the new routine loads the X register with the X parameter (line 420) and compares it with &10 (line 430) to see if it is in the range from 0 to 15. If X is in range it disables the rom by storing a zero in the rom information table byte that corresponds with that rom (lines 450-460). The Y parameter is then loaded into the Y register (line 480) and checked to see if it has been set (line 490). If it has been set the active roms are listed (line 510). The routine does not write any results to the zero page copies of the index registers but it still ensures that the index registers and their copies are identical (lines 530-540). The accumulator was pushed on the stack by the interpreter (line 320) and it is pulled back off in line 550. It is reset to zero to inform the other roms that the service call has been recognised (line 560) and control is returned to the MOS (line 570). The subroutine romnames (lines 580-940) uses Osrdrm to list the titles of the active roms and is similar to the routine used to print rom titles in the program READROM (used in Module 1). The subroutine decimal (lines 950-1110) prints the ASCII decimal equivalent of any byte storing a number in the range from 0 to 99 (decimal). It is quite a useful routine and can also be used to print a binary coded decimal byte. 10 REM: OSBYTE 20 MODE7 30 HIMEM=&3C00 40 DIM save 50 50 diff=&8000-HIMEM 60 accumulator=&EF 70 xregister=&F0 80 yregister=&F1 90 rompoint=&F6 100 table=&2A1 110 osrdrm=&FFB9 120 osasci=&FFE3 130 osnewl=&FFE7 140 osbyte=&FFF4 150 oscli=&FFF7 160 FOR pass = 0 TO 2 STEP 2 170 P%=HIMEM 180 [ OPT pass 190 BRK 200 BRK 210 BRK 220 JMP service+diff 230 OPT FNequb(&82) 240 OPT FNequb((copyright+diff) MOD 256) 250 BRK 260 OPT FNequs("OSBYTE") 270 .copyright 280 BRK 290 OPT FNequs("(C) Gordon Horsington 1987") 300 BRK 310 .service 320 PHA 330 CMP #7 340 BEQ newosbyte 350 .exit 360 PLA 370 RTS 380 .newosbyte 390 LDA accumulator 400 CMP #100 410 BNE exit 420 LDX xregister 430 CPX #&10 440 BCS checkyreg 450 LDA #0 460 STA table,X 470 .checkyreg 480 LDY yregister 490 BEQ out 500 .romlist 510 JSR romnames+diff 520 .out 530 LDX xregister 540 LDY yregister 550 PLA 560 LDA #0 570 RTS 580 .romnames 590 JSR osnewl 600 LDA #&F 610 PHA 620 .romloop 630 TAY 640 LDA table,Y 650 BEQ nothere 660 TYA 670 JSR decimal+diff 680 LDA #ASC(" ") 690 JSR osasci 700 LDA #&8 710 STA rompoint 720 LDA #&80 730 STA rompoint+1 740 .readloop 750 INC rompoint 760 BEQ newline 770 PLA 780 PHA 790 TAY 800 JSR osrdrm 810 CMP #ASC(" ") 820 BCC newline 830 JSR osasci 840 JMP readloop+diff 850 .newline 860 JSR osnewl 870 .nothere 880 PLA 890 SEC 900 SBC #1 910 PHA 920 BPL romloop 930 PLA 940 JMP osnewl 950 .decimal 960 SED 970 CLC 980 ADC #0 990 CLD 1000 PHA 1010 LSR A 1020 LSR A 1030 LSR A 1040 LSR A 1050 JSR nibble+diff 1060 PLA 1070 AND #&F 1080 .nibble 1090 CLC 1100 ADC #ASC("0") 1110 JMP osasci 1120 .lastbyte 1130 ] 1140 NEXT 1150 INPUT'"Save filename = "filename$ 1160 IF filename$="" END 1170 $save="SAVE "+filename$+" "+STR$~(HIMEM)+" "+STR$~(las tbyte)+" FFFF8000 FFFF8000" 1180 X%=save MOD 256 1190 Y%=save DIV 256 1200 *OPT1,2 1210 CALL oscli 1220 *OPT1,0 1230 END 1240 DEFFNequb(byte) 1250 ?P%=byte 1260 P%=P%+1 1270 =pass 1280 DEFFNequw(word) 1290 ?P%=word MOD 256 1300 P%?1=word DIV 256 1310 P%=P%+2 1320 =pass 1330 DEFFNequd(double) 1340 !P%=double 1350 P%=P%+4 1360 =pass 1370 DEFFNequs(string$) 1380 $P%=string$ 1390 P%=P%+LEN(string$) 1400 =pass
00000000 4d 61 73 74 65 72 69 6e 67 20 53 69 64 65 77 61 |Mastering Sidewa| 00000010 79 73 20 52 4f 4d 20 26 20 52 41 4d 20 2d 20 4d |ys ROM & RAM - M| 00000020 6f 64 75 6c 65 20 30 36 20 2d 20 4f 73 62 79 74 |odule 06 - Osbyt| 00000030 65 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |e.--------------| 00000040 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000060 2d 2d 2d 0d 0d 20 20 49 6e 20 4d 6f 64 75 6c 65 |---.. In Module| 00000070 20 35 20 79 6f 75 20 77 65 72 65 20 73 68 6f 77 | 5 you were show| 00000080 6e 20 68 6f 77 20 74 6f 20 72 65 61 64 20 61 6e |n how to read an| 00000090 20 61 72 67 75 6d 65 6e 74 20 77 68 69 63 68 20 | argument which | 000000a0 66 6f 6c 6c 6f 77 73 20 61 20 2a 0d 63 6f 6d 6d |follows a *.comm| 000000b0 61 6e 64 2e 20 54 68 65 20 61 72 67 75 6d 65 6e |and. The argumen| 000000c0 74 20 69 73 20 61 6c 77 61 79 73 20 72 65 61 64 |t is always read| 000000d0 20 61 73 20 61 6e 20 41 53 43 49 49 20 73 74 72 | as an ASCII str| 000000e0 69 6e 67 2e 20 54 68 69 73 20 69 73 20 66 69 6e |ing. This is fin| 000000f0 65 0d 69 66 20 74 68 65 20 73 74 72 69 6e 67 20 |e.if the string | 00000100 69 73 20 61 20 77 6f 72 64 20 73 75 63 68 20 61 |is a word such a| 00000110 73 20 22 4f 4e 22 20 6f 72 20 22 4f 46 46 22 20 |s "ON" or "OFF" | 00000120 62 75 74 20 69 74 20 63 61 6e 20 62 65 20 61 20 |but it can be a | 00000130 70 72 6f 62 6c 65 6d 0d 69 66 20 74 68 65 20 61 |problem.if the a| 00000140 72 67 75 6d 65 6e 74 20 69 73 20 61 20 6e 75 6d |rgument is a num| 00000150 62 65 72 2e 20 54 68 65 20 6e 75 6d 62 65 72 20 |ber. The number | 00000160 6d 75 73 74 20 62 65 20 72 65 61 64 20 61 73 20 |must be read as | 00000170 61 6e 20 41 53 43 49 49 0d 73 74 72 69 6e 67 20 |an ASCII.string | 00000180 62 75 74 20 69 74 20 68 61 73 20 74 6f 20 62 65 |but it has to be| 00000190 20 63 6f 6e 76 65 72 74 65 64 20 69 6e 74 6f 20 | converted into | 000001a0 62 69 6e 61 72 79 20 62 65 66 6f 72 65 20 74 68 |binary before th| 000001b0 65 20 63 6f 6d 70 75 74 65 72 20 63 61 6e 0d 75 |e computer can.u| 000001c0 73 65 20 69 74 20 61 73 20 61 20 6e 75 6d 62 65 |se it as a numbe| 000001d0 72 2e 20 54 68 65 20 63 6f 6d 70 75 74 65 72 20 |r. The computer | 000001e0 63 61 6e 20 73 74 6f 72 65 20 61 20 6e 75 6d 62 |can store a numb| 000001f0 65 72 20 69 6e 20 74 68 65 20 72 61 6e 67 65 20 |er in the range | 00000200 66 72 6f 6d 0d 26 30 30 20 74 6f 20 26 46 46 20 |from.&00 to &FF | 00000210 69 6e 20 6f 6e 65 20 62 79 74 65 2e 20 49 6e 20 |in one byte. In | 00000220 6f 72 64 65 72 20 74 6f 20 72 65 61 64 20 6a 75 |order to read ju| 00000230 73 74 20 6f 6e 65 20 62 79 74 65 20 61 73 20 61 |st one byte as a| 00000240 6e 20 61 72 67 75 6d 65 6e 74 0d 75 70 20 74 6f |n argument.up to| 00000250 20 74 68 72 65 65 20 41 53 43 49 49 20 63 68 61 | three ASCII cha| 00000260 72 61 63 74 65 72 73 20 72 65 70 72 65 73 65 6e |racters represen| 00000270 74 69 6e 67 20 74 68 65 20 62 79 74 65 20 68 61 |ting the byte ha| 00000280 76 65 20 74 6f 20 62 65 20 72 65 61 64 2c 0d 63 |ve to be read,.c| 00000290 6f 6e 76 65 72 74 65 64 20 69 6e 74 6f 20 62 69 |onverted into bi| 000002a0 6e 61 72 79 20 61 6e 64 20 73 74 6f 72 65 64 20 |nary and stored | 000002b0 69 6e 20 61 20 62 79 74 65 20 6f 66 20 75 73 65 |in a byte of use| 000002c0 72 20 6d 65 6d 6f 72 79 2e 0d 0d 20 20 59 6f 75 |r memory... You| 000002d0 20 68 61 76 65 20 74 77 6f 20 6f 70 74 69 6f 6e | have two option| 000002e0 73 20 69 66 20 79 6f 75 20 77 61 6e 74 20 74 6f |s if you want to| 000002f0 20 72 65 61 64 20 6e 75 6d 65 72 69 63 61 6c 20 | read numerical | 00000300 61 72 67 75 6d 65 6e 74 73 2e 0d 0d 31 2e 20 57 |arguments...1. W| 00000310 72 69 74 65 20 61 20 72 6f 75 74 69 6e 65 20 74 |rite a routine t| 00000320 6f 20 72 65 61 64 20 65 76 65 72 79 20 41 53 43 |o read every ASC| 00000330 49 49 20 63 68 61 72 61 63 74 65 72 20 69 6e 20 |II character in | 00000340 74 68 65 20 61 72 67 75 6d 65 6e 74 20 61 6e 64 |the argument and| 00000350 0d 63 6f 6e 76 65 72 74 20 74 68 65 20 41 53 43 |.convert the ASC| 00000360 49 49 20 72 65 70 72 65 73 65 6e 74 61 74 69 6f |II representatio| 00000370 6e 20 6f 66 20 74 68 65 20 6e 75 6d 62 65 72 20 |n of the number | 00000380 69 6e 74 6f 20 62 69 6e 61 72 79 2e 0d 0d 32 2e |into binary...2.| 00000390 20 55 73 65 20 74 68 65 20 4d 4f 53 20 74 6f 20 | Use the MOS to | 000003a0 64 6f 20 74 68 65 20 77 6f 72 6b 20 66 6f 72 20 |do the work for | 000003b0 79 6f 75 2e 0d 0d 20 20 54 68 65 20 66 69 72 73 |you... The firs| 000003c0 74 20 6f 70 74 69 6f 6e 2c 20 6e 6f 74 20 73 75 |t option, not su| 000003d0 72 70 72 69 73 69 6e 67 6c 79 2c 20 69 6e 76 6f |rprisingly, invo| 000003e0 6c 76 65 73 20 6d 6f 72 65 20 77 6f 72 6b 20 74 |lves more work t| 000003f0 68 61 6e 20 74 68 65 0d 73 65 63 6f 6e 64 2e 20 |han the.second. | 00000400 49 66 20 79 6f 75 20 77 72 69 74 65 20 79 6f 75 |If you write you| 00000410 72 20 6f 77 6e 20 63 6f 6e 76 65 72 73 69 6f 6e |r own conversion| 00000420 20 72 6f 75 74 69 6e 65 20 69 74 20 68 61 73 20 | routine it has | 00000430 74 6f 20 69 6e 63 6c 75 64 65 0d 65 72 72 6f 72 |to include.error| 00000440 20 68 61 6e 64 6c 69 6e 67 20 61 6e 64 20 61 20 | handling and a | 00000450 63 68 65 63 6b 20 66 6f 72 20 76 61 6c 69 64 69 |check for validi| 00000460 74 79 2e 20 49 74 20 61 6c 73 6f 20 68 61 73 20 |ty. It also has | 00000470 74 6f 20 68 61 76 65 20 73 6f 6d 65 77 68 65 72 |to have somewher| 00000480 65 0d 69 6e 20 6d 65 6d 6f 72 79 20 74 6f 20 73 |e.in memory to s| 00000490 74 6f 72 65 20 74 68 65 20 72 65 73 75 6c 74 2e |tore the result.| 000004a0 20 54 68 69 73 20 77 69 6c 6c 20 62 65 20 63 6f | This will be co| 000004b0 76 65 72 65 64 20 69 6e 20 64 65 74 61 69 6c 20 |vered in detail | 000004c0 69 6e 0d 4d 6f 64 75 6c 65 20 39 2e 0d 0d 20 20 |in.Module 9... | 000004d0 54 68 65 20 73 65 63 6f 6e 64 20 6f 70 74 69 6f |The second optio| 000004e0 6e 20 69 6e 76 6f 6c 76 65 73 20 64 65 66 69 6e |n involves defin| 000004f0 69 6e 67 20 61 20 6e 65 77 20 4f 73 62 79 74 65 |ing a new Osbyte| 00000500 20 6f 72 20 4f 73 77 6f 72 64 2e 20 4f 73 62 79 | or Osword. Osby| 00000510 74 65 0d 77 69 6c 6c 20 62 65 20 63 6f 76 65 72 |te.will be cover| 00000520 65 64 20 69 6e 20 74 68 69 73 20 6d 6f 64 75 6c |ed in this modul| 00000530 65 20 61 6e 64 20 4f 73 77 6f 72 64 20 69 6e 20 |e and Osword in | 00000540 4d 6f 64 75 6c 65 20 37 2e 0d 0d 20 20 4f 73 62 |Module 7... Osb| 00000550 79 74 65 20 69 73 20 61 6e 20 4d 4f 53 20 63 61 |yte is an MOS ca| 00000560 6c 6c 20 73 70 65 63 69 66 69 65 64 20 62 79 20 |ll specified by | 00000570 74 68 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 |the contents of | 00000580 74 68 65 20 61 63 63 75 6d 75 6c 61 74 6f 72 0d |the accumulator.| 00000590 74 61 6b 69 6e 67 20 70 61 72 61 6d 65 74 65 72 |taking parameter| 000005a0 73 20 69 6e 20 74 68 65 20 58 20 61 6e 64 20 59 |s in the X and Y| 000005b0 20 72 65 67 69 73 74 65 72 73 2e 20 4f 73 62 79 | registers. Osby| 000005c0 74 65 20 63 61 6c 6c 73 20 32 32 20 28 26 31 35 |te calls 22 (&15| 000005d0 29 20 74 6f 0d 31 31 36 20 28 26 37 34 29 20 61 |) to.116 (&74) a| 000005e0 72 65 20 6e 6f 74 20 75 73 65 64 20 62 79 20 4d |re not used by M| 000005f0 4f 53 20 31 2e 32 30 20 61 6e 64 20 63 61 6e 20 |OS 1.20 and can | 00000600 62 65 20 64 65 66 69 6e 65 64 20 77 69 74 68 69 |be defined withi| 00000610 6e 20 79 6f 75 72 20 53 57 52 0d 70 72 6f 67 72 |n your SWR.progr| 00000620 61 6d 73 2e 20 4f 74 68 65 72 20 6f 70 65 72 61 |ams. Other opera| 00000630 74 69 6e 67 20 73 79 73 74 65 6d 73 20 75 73 65 |ting systems use| 00000640 20 73 6f 6d 65 20 6f 66 20 74 68 65 73 65 20 75 | some of these u| 00000650 6e 75 73 65 64 20 4f 73 62 79 74 65 0d 63 61 6c |nused Osbyte.cal| 00000660 6c 73 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 20 |ls. For example | 00000670 2a 46 58 20 31 31 34 20 69 73 20 75 73 65 64 20 |*FX 114 is used | 00000680 74 6f 20 73 77 69 74 63 68 20 73 68 61 64 6f 77 |to switch shadow| 00000690 20 73 63 72 65 65 6e 20 6d 65 6d 6f 72 79 20 6f | screen memory o| 000006a0 6e 0d 61 6e 64 20 6f 66 66 20 69 6e 20 74 68 65 |n.and off in the| 000006b0 20 42 2b 20 61 6e 64 20 4d 61 73 74 65 72 20 63 | B+ and Master c| 000006c0 6f 6d 70 75 74 65 72 73 2e 20 59 6f 75 20 63 61 |omputers. You ca| 000006d0 6e 20 75 73 65 20 54 52 41 43 45 20 74 6f 20 63 |n use TRACE to c| 000006e0 68 65 63 6b 20 69 66 0d 61 6e 79 20 70 61 72 74 |heck if.any part| 000006f0 69 63 75 6c 61 72 20 4f 73 62 79 74 65 20 63 61 |icular Osbyte ca| 00000700 6c 6c 20 69 73 20 75 6e 75 73 65 64 20 62 79 20 |ll is unused by | 00000710 79 6f 75 72 20 6f 70 65 72 61 74 69 6e 67 20 73 |your operating s| 00000720 79 73 74 65 6d 2e 20 2a 46 58 20 31 30 30 0d 69 |ystem. *FX 100.i| 00000730 73 20 6e 6f 74 20 75 73 65 64 20 62 79 20 61 6e |s not used by an| 00000740 79 20 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 |y operating syst| 00000750 65 6d 20 28 61 73 20 66 61 72 20 61 73 20 49 20 |em (as far as I | 00000760 6b 6e 6f 77 29 20 61 6e 64 20 77 69 6c 6c 20 62 |know) and will b| 00000770 65 0d 75 73 65 64 20 69 6e 20 74 68 65 20 65 78 |e.used in the ex| 00000780 61 6d 70 6c 65 20 70 72 6f 67 72 61 6d 20 66 6f |ample program fo| 00000790 72 20 74 68 69 73 20 6d 6f 64 75 6c 65 2e 0d 0d |r this module...| 000007a0 20 20 4c 6f 61 64 20 74 68 65 20 6f 62 6a 65 63 | Load the objec| 000007b0 74 20 63 6f 64 65 20 67 65 6e 65 72 61 74 65 64 |t code generated| 000007c0 20 62 79 20 54 52 41 43 45 20 69 6e 74 6f 20 53 | by TRACE into S| 000007d0 57 52 20 61 6e 64 20 70 72 65 73 73 20 74 68 65 |WR and press the| 000007e0 20 42 72 65 61 6b 0d 6b 65 79 2e 20 54 79 70 65 | Break.key. Type| 000007f0 20 2a 46 58 20 31 30 30 20 61 6e 64 20 70 72 65 | *FX 100 and pre| 00000800 73 73 20 52 65 74 75 72 6e 2e 20 59 6f 75 20 77 |ss Return. You w| 00000810 69 6c 6c 20 73 65 65 20 74 68 61 74 20 73 65 72 |ill see that ser| 00000820 76 69 63 65 20 63 61 6c 6c 20 37 0d 69 73 20 75 |vice call 7.is u| 00000830 73 65 64 20 66 6f 72 20 61 6e 20 75 6e 72 65 63 |sed for an unrec| 00000840 6f 67 6e 69 73 65 64 20 4f 73 62 79 74 65 2e 20 |ognised Osbyte. | 00000850 54 79 70 65 20 2a 46 58 20 31 30 30 2c 31 2c 31 |Type *FX 100,1,1| 00000860 20 61 6e 64 20 79 6f 75 20 77 69 6c 6c 20 73 65 | and you will se| 00000870 65 0d 74 68 61 74 20 74 68 65 20 4f 73 62 79 74 |e.that the Osbyt| 00000880 65 20 58 20 61 6e 64 20 59 20 70 61 72 61 6d 65 |e X and Y parame| 00000890 74 65 72 73 20 61 72 65 20 6e 6f 74 20 6d 61 64 |ters are not mad| 000008a0 65 20 61 76 61 69 6c 61 62 6c 65 20 74 6f 20 74 |e available to t| 000008b0 68 65 0d 69 6e 74 65 72 70 72 65 74 65 72 20 69 |he.interpreter i| 000008c0 6e 20 74 68 65 20 58 20 61 6e 64 20 59 20 72 65 |n the X and Y re| 000008d0 67 69 73 74 65 72 73 20 61 73 20 79 6f 75 20 6d |gisters as you m| 000008e0 69 67 68 74 20 65 78 70 65 63 74 2e 20 46 69 67 |ight expect. Fig| 000008f0 75 72 65 20 36 2e 31 0d 73 68 6f 77 73 20 74 68 |ure 6.1.shows th| 00000900 61 74 2c 20 77 68 61 74 65 76 65 72 20 76 61 6c |at, whatever val| 00000910 75 65 20 79 6f 75 20 74 79 70 65 20 66 6f 72 20 |ue you type for | 00000920 74 68 65 20 4f 73 62 79 74 65 20 58 20 61 6e 64 |the Osbyte X and| 00000930 20 59 20 70 61 72 61 6d 65 74 65 72 73 2c 0d 74 | Y parameters,.t| 00000940 68 65 20 72 6f 6d 20 69 73 20 65 6e 74 65 72 65 |he rom is entere| 00000950 64 20 77 69 74 68 20 58 20 73 74 6f 72 69 6e 67 |d with X storing| 00000960 20 74 68 65 20 72 6f 6d 20 6e 75 6d 62 65 72 20 | the rom number | 00000970 61 6e 64 20 59 20 73 74 6f 72 69 6e 67 20 7a 65 |and Y storing ze| 00000980 72 6f 2e 0d 0d 0d 0d 3e 2a 46 58 20 31 30 30 0d |ro.....>*FX 100.| 00000990 20 41 3d 30 37 20 58 3d 30 46 20 59 3d 30 30 20 | A=07 X=0F Y=00 | 000009a0 55 6e 72 65 63 6f 67 6e 69 73 65 64 20 4f 73 62 |Unrecognised Osb| 000009b0 79 74 65 0d 3e 2a 46 58 20 31 30 30 2c 31 2c 31 |yte.>*FX 100,1,1| 000009c0 0d 20 41 3d 30 37 20 58 3d 30 46 20 59 3d 30 30 |. A=07 X=0F Y=00| 000009d0 20 55 6e 72 65 63 6f 67 6e 69 73 65 64 20 4f 73 | Unrecognised Os| 000009e0 62 79 74 65 0d 3e 2a 46 58 20 31 30 30 2c 31 30 |byte.>*FX 100,10| 000009f0 30 2c 31 30 30 0d 20 41 3d 30 37 20 58 3d 30 46 |0,100. A=07 X=0F| 00000a00 20 59 3d 30 30 20 55 6e 72 65 63 6f 67 6e 69 73 | Y=00 Unrecognis| 00000a10 65 64 20 4f 73 62 79 74 65 0d 3e 0d 0d 46 69 67 |ed Osbyte.>..Fig| 00000a20 75 72 65 20 36 2e 31 20 53 65 72 76 69 63 65 20 |ure 6.1 Service | 00000a30 74 72 61 63 65 20 66 6f 72 20 75 6e 72 65 63 6f |trace for unreco| 00000a40 67 6e 69 73 65 64 20 4f 73 62 79 74 65 2e 0d 2d |gnised Osbyte..-| 00000a50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000a80 0d 0d 0d 0d 20 20 4f 73 62 79 74 65 20 75 73 65 |.... Osbyte use| 00000a90 73 20 74 68 72 65 65 20 63 6f 6e 73 65 63 75 74 |s three consecut| 00000aa0 69 76 65 20 62 79 74 65 73 20 69 6e 20 7a 65 72 |ive bytes in zer| 00000ab0 6f 20 70 61 67 65 20 74 6f 20 73 74 6f 72 65 20 |o page to store | 00000ac0 74 68 65 20 76 61 6c 75 65 73 0d 6f 66 20 74 68 |the values.of th| 00000ad0 65 20 41 2c 20 58 20 61 6e 64 20 59 20 72 65 67 |e A, X and Y reg| 00000ae0 69 73 74 65 72 73 2e 20 54 68 65 20 61 63 63 75 |isters. The accu| 00000af0 6d 75 6c 61 74 6f 72 20 76 61 6c 75 65 20 66 6f |mulator value fo| 00000b00 72 20 74 68 65 20 6d 6f 73 74 20 72 65 63 65 6e |r the most recen| 00000b10 74 0d 4f 73 62 79 74 65 20 28 6f 72 20 4f 73 77 |t.Osbyte (or Osw| 00000b20 6f 72 64 29 20 69 73 20 73 74 6f 72 65 64 20 69 |ord) is stored i| 00000b30 6e 20 26 45 46 2e 20 54 68 65 20 58 20 72 65 67 |n &EF. The X reg| 00000b40 69 73 74 65 72 20 76 61 6c 75 65 20 69 73 20 73 |ister value is s| 00000b50 74 6f 72 65 64 20 69 6e 0d 26 46 30 20 61 6e 64 |tored in.&F0 and| 00000b60 20 74 68 65 20 59 20 72 65 67 69 73 74 65 72 20 | the Y register | 00000b70 76 61 6c 75 65 20 69 73 20 73 74 6f 72 65 64 20 |value is stored | 00000b80 69 6e 20 26 46 31 2e 20 42 6f 74 68 20 4f 73 62 |in &F1. Both Osb| 00000b90 79 74 65 20 61 6e 64 20 4f 73 77 6f 72 64 0d 6d |yte and Osword.m| 00000ba0 61 6b 65 20 74 68 65 20 74 68 72 65 65 20 72 65 |ake the three re| 00000bb0 67 69 73 74 65 72 73 20 61 76 61 69 6c 61 62 6c |gisters availabl| 00000bc0 65 20 74 6f 20 74 68 65 20 72 6f 75 74 69 6e 65 |e to the routine| 00000bd0 20 74 68 72 6f 75 67 68 20 74 68 65 73 65 20 74 | through these t| 00000be0 68 72 65 65 0d 7a 65 72 6f 20 70 61 67 65 20 6c |hree.zero page l| 00000bf0 6f 63 61 74 69 6f 6e 73 2e 0d 0d 20 20 41 66 74 |ocations... Aft| 00000c00 65 72 20 70 72 6f 63 65 73 73 69 6e 67 20 61 6e |er processing an| 00000c10 20 4f 73 62 79 74 65 20 63 61 6c 6c 20 61 6e 79 | Osbyte call any| 00000c20 20 76 61 6c 75 65 73 20 74 68 61 74 20 6e 65 65 | values that nee| 00000c30 64 20 74 6f 20 62 65 20 72 65 74 75 72 6e 65 64 |d to be returned| 00000c40 0d 74 6f 20 74 68 65 20 63 61 6c 6c 69 6e 67 20 |.to the calling | 00000c50 72 6f 75 74 69 6e 65 20 73 68 6f 75 6c 64 20 62 |routine should b| 00000c60 65 20 73 74 6f 72 65 64 20 69 6e 20 6c 6f 63 61 |e stored in loca| 00000c70 74 69 6f 6e 73 20 26 46 30 20 61 6e 64 20 26 46 |tions &F0 and &F| 00000c80 31 2e 20 4f 6e 0d 72 65 74 75 72 6e 20 74 68 65 |1. On.return the| 00000c90 20 6e 75 6d 62 65 72 20 73 74 6f 72 65 64 20 69 | number stored i| 00000ca0 6e 20 74 68 65 20 58 20 72 65 67 69 73 74 65 72 |n the X register| 00000cb0 20 61 6e 64 20 26 46 30 20 73 68 6f 75 6c 64 20 | and &F0 should | 00000cc0 62 65 20 74 68 65 20 73 61 6d 65 0d 61 6e 64 20 |be the same.and | 00000cd0 74 68 65 20 6e 75 6d 62 65 72 20 73 74 6f 72 65 |the number store| 00000ce0 64 20 69 6e 20 74 68 65 20 59 20 72 65 67 69 73 |d in the Y regis| 00000cf0 74 65 72 20 61 6e 64 20 26 46 31 20 73 68 6f 75 |ter and &F1 shou| 00000d00 6c 64 20 62 65 20 74 68 65 20 73 61 6d 65 2e 0d |ld be the same..| 00000d10 26 45 46 20 73 68 6f 75 6c 64 20 73 74 6f 72 65 |&EF should store| 00000d20 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 79 | the number of y| 00000d30 6f 75 72 20 6e 65 77 20 4f 73 62 79 74 65 20 61 |our new Osbyte a| 00000d40 6e 64 20 74 68 65 20 61 63 63 75 6d 75 6c 61 74 |nd the accumulat| 00000d50 6f 72 0d 73 68 6f 75 6c 64 20 62 65 20 72 65 73 |or.should be res| 00000d60 65 74 20 74 6f 20 7a 65 72 6f 20 62 65 66 6f 72 |et to zero befor| 00000d70 65 20 72 65 74 75 72 6e 69 6e 67 20 74 6f 20 74 |e returning to t| 00000d80 68 65 20 4d 4f 53 2e 20 4f 6e 20 72 65 74 75 72 |he MOS. On retur| 00000d90 6e 20 74 6f 20 74 68 65 0d 4d 4f 53 20 74 68 65 |n to the.MOS the| 00000da0 20 6e 75 6d 62 65 72 20 73 74 6f 72 65 64 20 69 | number stored i| 00000db0 6e 20 26 45 46 20 69 73 20 63 6f 70 69 65 64 20 |n &EF is copied | 00000dc0 69 6e 74 6f 20 74 68 65 20 61 63 63 75 6d 75 6c |into the accumul| 00000dd0 61 74 6f 72 2e 0d 0d 20 20 59 6f 75 20 63 61 6e |ator... You can| 00000de0 20 75 73 65 20 74 68 65 20 58 20 61 6e 64 20 59 | use the X and Y| 00000df0 20 70 61 72 61 6d 65 74 65 72 73 20 6f 66 20 61 | parameters of a| 00000e00 6e 20 4f 73 62 79 74 65 20 63 61 6c 6c 20 74 6f |n Osbyte call to| 00000e10 20 6d 61 6b 65 20 74 77 6f 0d 28 6f 6e 65 20 62 | make two.(one b| 00000e20 79 74 65 29 20 6e 75 6d 62 65 72 73 20 6f 72 20 |yte) numbers or | 00000e30 6f 6e 65 20 28 74 77 6f 20 62 79 74 65 29 20 6e |one (two byte) n| 00000e40 75 6d 62 65 72 20 61 76 61 69 6c 61 62 6c 65 20 |umber available | 00000e50 74 6f 20 79 6f 75 72 20 6e 65 77 0d 72 6f 75 74 |to your new.rout| 00000e60 69 6e 65 2e 20 49 66 20 79 6f 75 20 77 61 6e 74 |ine. If you want| 00000e70 20 74 6f 20 6d 61 6b 65 20 61 20 74 77 6f 20 62 | to make a two b| 00000e80 79 74 65 20 6e 75 6d 62 65 72 20 61 76 61 69 6c |yte number avail| 00000e90 61 62 6c 65 20 73 74 6f 72 65 20 74 68 65 0d 6c |able store the.l| 00000ea0 65 61 73 74 20 73 69 67 6e 69 66 69 63 61 6e 74 |east significant| 00000eb0 20 62 79 74 65 20 69 6e 20 58 20 61 6e 64 20 74 | byte in X and t| 00000ec0 68 65 20 6d 6f 73 74 20 73 69 67 6e 69 66 69 63 |he most signific| 00000ed0 61 6e 74 20 62 79 74 65 20 69 6e 20 59 2e 20 46 |ant byte in Y. F| 00000ee0 6f 72 0d 65 78 61 6d 70 6c 65 2c 0d 0d 20 20 4c |or.example,.. L| 00000ef0 44 41 20 23 31 30 30 20 20 20 20 20 20 20 20 20 |DA #100 | 00000f00 20 20 20 20 20 5c 20 4e 65 77 20 6f 73 62 79 74 | \ New osbyt| 00000f10 65 0d 20 20 4c 44 58 20 23 28 6e 75 6d 62 65 72 |e. LDX #(number| 00000f20 20 4d 4f 44 20 32 35 36 29 20 5c 20 4c 65 61 73 | MOD 256) \ Leas| 00000f30 74 20 73 69 67 6e 69 66 69 63 61 6e 74 20 62 79 |t significant by| 00000f40 74 65 0d 20 20 4c 44 59 20 23 28 6e 75 6d 62 65 |te. LDY #(numbe| 00000f50 72 20 44 49 56 20 32 35 36 29 20 5c 20 4d 6f 73 |r DIV 256) \ Mos| 00000f60 74 20 73 69 67 6e 69 66 69 63 61 6e 74 20 62 79 |t significant by| 00000f70 74 65 0d 20 20 4a 53 52 20 26 46 46 46 34 20 20 |te. JSR &FFF4 | 00000f80 20 20 20 20 20 20 20 20 20 20 20 5c 20 43 61 6c | \ Cal| 00000f90 6c 20 6f 73 62 79 74 65 0d 0d 20 20 59 6f 75 72 |l osbyte.. Your| 00000fa0 20 6e 65 77 20 4f 73 62 79 74 65 20 63 61 6e 20 | new Osbyte can | 00000fb0 74 68 65 6e 20 72 65 61 64 20 74 68 65 20 6c 65 |then read the le| 00000fc0 61 73 74 20 73 69 67 6e 69 66 69 63 61 6e 74 20 |ast significant | 00000fd0 62 79 74 65 20 66 72 6f 6e 20 26 46 30 0d 61 6e |byte fron &F0.an| 00000fe0 64 20 74 68 65 20 6d 6f 73 74 20 73 69 67 6e 69 |d the most signi| 00000ff0 66 69 63 61 6e 74 20 62 79 74 65 20 66 72 6f 6d |ficant byte from| 00001000 20 26 46 31 2e 20 49 74 20 63 61 6e 20 61 6c 73 | &F1. It can als| 00001010 6f 20 75 73 65 20 74 68 65 73 65 20 6d 65 6d 6f |o use these memo| 00001020 72 79 0d 6c 6f 63 61 74 69 6f 6e 73 20 66 6f 72 |ry.locations for| 00001030 20 70 6f 73 74 2d 69 6e 64 65 78 65 64 20 69 6e | post-indexed in| 00001040 64 69 72 65 63 74 20 61 64 64 72 65 73 73 69 6e |direct addressin| 00001050 67 2e 0d 0d 20 20 54 68 65 20 69 6e 74 65 72 70 |g... The interp| 00001060 72 65 74 65 72 20 6e 65 65 64 65 64 20 74 6f 20 |reter needed to | 00001070 69 6d 70 6c 65 6d 65 6e 74 20 61 20 6e 65 77 20 |implement a new | 00001080 4f 73 62 79 74 65 20 69 73 20 70 72 6f 62 61 62 |Osbyte is probab| 00001090 6c 79 20 74 68 65 0d 65 61 73 69 65 73 74 20 6f |ly the.easiest o| 000010a0 66 20 61 6c 6c 20 69 6e 74 65 72 70 72 65 74 65 |f all interprete| 000010b0 72 73 20 74 6f 20 77 72 69 74 65 2e 20 41 6e 20 |rs to write. An | 000010c0 6f 75 74 6c 69 6e 65 20 69 6e 74 65 72 70 72 65 |outline interpre| 000010d0 74 65 72 20 69 73 20 73 68 6f 77 6e 0d 69 6e 20 |ter is shown.in | 000010e0 66 69 67 75 72 65 20 36 2e 32 2e 0d 0d 0d 0d 0d |figure 6.2......| 000010f0 2e 73 65 72 76 69 63 65 0d 20 20 20 20 20 20 20 |.service. | 00001100 20 20 50 48 41 20 20 20 20 20 20 20 20 20 20 20 | PHA | 00001110 5c 20 70 75 73 68 20 61 63 63 75 6d 75 6c 61 74 |\ push accumulat| 00001120 6f 72 0d 20 20 20 20 20 20 20 20 20 43 4d 50 20 |or. CMP | 00001130 23 37 20 20 20 20 20 20 20 20 5c 20 69 73 20 69 |#7 \ is i| 00001140 74 20 61 6e 20 75 6e 72 65 63 6f 67 6e 69 73 65 |t an unrecognise| 00001150 64 20 4f 73 62 79 74 65 3f 0d 20 20 20 20 20 20 |d Osbyte?. | 00001160 20 20 20 42 45 51 20 6e 65 77 6f 73 62 79 74 65 | BEQ newosbyte| 00001170 20 5c 20 62 72 61 6e 63 68 20 69 66 20 69 74 20 | \ branch if it | 00001180 69 73 0d 2e 65 78 69 74 0d 20 20 20 20 20 20 20 |is..exit. | 00001190 20 20 50 4c 41 20 20 20 20 20 20 20 20 20 20 20 | PLA | 000011a0 5c 20 70 75 6c 6c 20 61 63 63 75 6d 75 6c 61 74 |\ pull accumulat| 000011b0 6f 72 0d 20 20 20 20 20 20 20 20 20 52 54 53 20 |or. RTS | 000011c0 20 20 20 20 20 20 20 20 20 20 5c 20 72 65 74 75 | \ retu| 000011d0 72 6e 20 61 6e 64 20 67 69 76 65 20 6f 74 68 65 |rn and give othe| 000011e0 72 20 72 6f 6d 73 20 74 68 65 20 63 61 6c 6c 0d |r roms the call.| 000011f0 2e 6e 65 77 6f 73 62 79 74 65 0d 20 20 20 20 20 |.newosbyte. | 00001200 20 20 20 20 4c 44 41 20 26 45 46 20 20 20 20 20 | LDA &EF | 00001210 20 20 5c 20 6c 6f 61 64 20 4f 73 62 79 74 65 20 | \ load Osbyte | 00001220 6e 75 6d 62 65 72 20 66 72 6f 6d 20 26 45 46 0d |number from &EF.| 00001230 20 20 20 20 20 20 20 20 20 43 4d 50 20 23 31 30 | CMP #10| 00001240 30 20 20 20 20 20 20 5c 20 69 73 20 69 74 20 31 |0 \ is it 1| 00001250 30 30 3f 0d 20 20 20 20 20 20 20 20 20 42 4e 45 |00?. BNE| 00001260 20 65 78 69 74 20 20 20 20 20 20 5c 20 62 72 61 | exit \ bra| 00001270 6e 63 68 20 69 66 20 6e 6f 74 20 4f 73 62 79 74 |nch if not Osbyt| 00001280 65 20 31 30 30 0d 20 20 20 20 20 20 20 20 20 4c |e 100. L| 00001290 44 58 20 26 46 30 20 20 20 20 20 20 20 5c 20 72 |DX &F0 \ r| 000012a0 65 61 64 20 58 20 66 72 6f 6d 20 26 46 30 0d 20 |ead X from &F0. | 000012b0 20 20 20 20 20 20 20 20 4c 44 59 20 26 46 31 20 | LDY &F1 | 000012c0 20 20 20 20 20 20 5c 20 72 65 61 64 20 59 20 66 | \ read Y f| 000012d0 72 6f 6d 20 26 46 31 0d 20 20 20 20 20 20 20 20 |rom &F1. | 000012e0 20 20 2e 0d 20 20 20 20 20 20 20 20 20 20 2e 20 | .. . | 000012f0 20 20 20 20 20 20 20 20 20 20 20 5c 20 6e 65 77 | \ new| 00001300 20 72 6f 75 74 69 6e 65 20 67 6f 65 73 20 69 6e | routine goes in| 00001310 20 68 65 72 65 0d 20 20 20 20 20 20 20 20 20 20 | here. | 00001320 2e 0d 20 20 20 20 20 20 20 20 20 53 54 58 20 26 |.. STX &| 00001330 46 30 20 20 20 20 20 20 20 5c 20 73 74 6f 72 65 |F0 \ store| 00001340 20 72 65 73 75 6c 74 20 66 6f 72 20 58 0d 20 20 | result for X. | 00001350 20 20 20 20 20 20 20 53 54 59 20 26 46 31 20 20 | STY &F1 | 00001360 20 20 20 20 20 5c 20 73 74 6f 72 65 20 72 65 73 | \ store res| 00001370 75 6c 74 20 66 6f 72 20 59 0d 20 20 20 20 20 20 |ult for Y. | 00001380 20 20 20 50 4c 41 20 20 20 20 20 20 20 20 20 20 | PLA | 00001390 20 5c 20 70 75 6c 6c 20 41 20 70 75 73 68 65 64 | \ pull A pushed| 000013a0 20 62 79 20 69 6e 74 65 72 70 72 65 74 65 72 0d | by interpreter.| 000013b0 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 30 20 | LDA #0 | 000013c0 20 20 20 20 20 20 20 5c 20 6f 74 68 65 72 20 72 | \ other r| 000013d0 6f 6d 73 20 69 67 6e 6f 72 65 20 74 68 69 73 20 |oms ignore this | 000013e0 63 61 6c 6c 0d 20 20 20 20 20 20 20 20 20 52 54 |call. RT| 000013f0 53 20 20 20 20 20 20 20 20 20 20 20 5c 20 72 65 |S \ re| 00001400 74 75 72 6e 20 74 6f 20 4d 4f 53 0d 0d 46 69 67 |turn to MOS..Fig| 00001410 75 72 65 20 36 2e 32 20 41 6e 20 4f 73 62 79 74 |ure 6.2 An Osbyt| 00001420 65 20 69 6e 74 65 72 70 72 65 74 65 72 2e 0d 2d |e interpreter..-| 00001430 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001450 0d 0d 0d 0d 0d 20 20 54 68 65 20 73 65 72 76 69 |..... The servi| 00001460 63 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 20 6f |ce entry point o| 00001470 66 20 74 68 65 20 6f 75 74 6c 69 6e 65 20 69 6e |f the outline in| 00001480 74 65 72 70 72 65 74 65 72 20 69 6e 20 66 69 67 |terpreter in fig| 00001490 75 72 65 20 36 2e 32 0d 77 69 6c 6c 20 68 61 76 |ure 6.2.will hav| 000014a0 65 20 61 20 6a 75 6d 70 20 74 6f 20 74 68 65 20 |e a jump to the | 000014b0 6c 61 62 65 6c 20 22 2e 73 65 72 76 69 63 65 22 |label ".service"| 000014c0 2e 20 4f 6e 20 65 6e 74 65 72 69 6e 67 20 74 68 |. On entering th| 000014d0 65 20 69 6e 74 65 72 70 72 65 74 65 72 0d 74 68 |e interpreter.th| 000014e0 65 20 61 63 63 75 6d 75 6c 61 74 6f 72 20 69 73 |e accumulator is| 000014f0 20 70 75 73 68 65 64 20 6f 6e 20 74 68 65 20 73 | pushed on the s| 00001500 74 61 63 6b 20 61 6e 64 20 74 68 65 6e 20 63 6f |tack and then co| 00001510 6d 70 61 72 65 64 20 77 69 74 68 20 37 20 74 6f |mpared with 7 to| 00001520 20 73 65 65 0d 69 66 20 74 68 65 20 63 61 6c 6c | see.if the call| 00001530 20 69 73 20 61 6e 20 75 6e 72 65 63 6f 67 6e 69 | is an unrecogni| 00001540 73 65 64 20 4f 73 62 79 74 65 2e 20 49 66 20 69 |sed Osbyte. If i| 00001550 74 20 69 73 20 6e 6f 74 20 74 68 65 20 61 63 63 |t is not the acc| 00001560 75 6d 75 6c 61 74 6f 72 20 69 73 0d 70 75 6c 6c |umulator is.pull| 00001570 65 64 20 6f 66 66 20 74 68 65 20 73 74 61 63 6b |ed off the stack| 00001580 20 61 6e 64 20 63 6f 6e 74 72 6f 6c 20 69 73 20 | and control is | 00001590 72 65 74 75 72 6e 65 64 20 74 6f 20 74 68 65 20 |returned to the | 000015a0 4d 4f 53 2e 20 49 66 20 74 68 65 20 63 61 6c 6c |MOS. If the call| 000015b0 0d 69 73 20 66 6f 72 20 61 6e 20 75 6e 72 65 63 |.is for an unrec| 000015c0 6f 67 6e 69 73 65 64 20 4f 73 62 79 74 65 20 74 |ognised Osbyte t| 000015d0 68 65 20 6e 75 6d 62 65 72 20 73 74 6f 72 65 64 |he number stored| 000015e0 20 69 6e 20 26 45 46 20 69 73 20 6c 6f 61 64 65 | in &EF is loade| 000015f0 64 20 69 6e 74 6f 0d 74 68 65 20 61 63 63 75 6d |d into.the accum| 00001600 75 6c 61 74 6f 72 20 61 6e 64 20 63 6f 6d 70 61 |ulator and compa| 00001610 72 65 64 20 77 69 74 68 20 74 68 65 20 6e 75 6d |red with the num| 00001620 62 65 72 20 6f 66 20 74 68 65 20 6e 65 77 20 4f |ber of the new O| 00001630 73 62 79 74 65 2c 20 69 6e 0d 74 68 69 73 20 65 |sbyte, in.this e| 00001640 78 61 6d 70 6c 65 20 31 30 30 2e 0d 0d 20 20 49 |xample 100... I| 00001650 66 20 74 68 65 20 75 6e 72 65 63 6f 67 6e 69 73 |f the unrecognis| 00001660 65 64 20 4f 73 62 79 74 65 20 6e 75 6d 62 65 72 |ed Osbyte number| 00001670 20 73 74 6f 72 65 64 20 69 6e 20 26 45 46 20 69 | stored in &EF i| 00001680 73 20 6e 6f 74 20 31 30 30 20 74 68 65 0d 61 63 |s not 100 the.ac| 00001690 63 75 6d 75 6c 61 74 6f 72 20 69 73 20 70 75 6c |cumulator is pul| 000016a0 6c 65 64 20 6f 66 66 20 74 68 65 20 73 74 61 63 |led off the stac| 000016b0 6b 20 61 6e 64 20 63 6f 6e 74 72 6f 6c 20 69 73 |k and control is| 000016c0 20 72 65 74 75 72 6e 65 64 20 74 6f 20 74 68 65 | returned to the| 000016d0 0d 4d 4f 53 2e 20 49 66 20 69 74 20 69 73 20 31 |.MOS. If it is 1| 000016e0 30 30 20 74 68 65 6e 20 74 68 65 20 70 61 72 61 |00 then the para| 000016f0 6d 65 74 65 72 73 20 28 69 66 20 75 73 65 64 29 |meters (if used)| 00001700 20 63 61 6e 20 62 65 20 72 65 61 64 20 66 72 6f | can be read fro| 00001710 6d 20 26 46 30 0d 28 58 20 72 65 67 69 73 74 65 |m &F0.(X registe| 00001720 72 29 20 61 6e 64 20 26 46 31 20 28 59 20 72 65 |r) and &F1 (Y re| 00001730 67 69 73 74 65 72 29 20 61 6e 64 20 74 68 65 20 |gister) and the | 00001740 6e 65 77 20 72 6f 75 74 69 6e 65 20 63 61 6e 20 |new routine can | 00001750 62 65 20 65 78 65 63 75 74 65 64 2e 0d 0d 20 20 |be executed... | 00001760 41 66 74 65 72 20 63 6f 6d 70 6c 65 74 69 6e 67 |After completing| 00001770 20 74 68 65 20 6e 65 77 20 72 6f 75 74 69 6e 65 | the new routine| 00001780 20 61 6e 79 20 72 65 73 75 6c 74 73 20 61 72 65 | any results are| 00001790 20 73 74 6f 72 65 64 20 69 6e 20 26 46 30 20 28 | stored in &F0 (| 000017a0 58 0d 72 65 67 69 73 74 65 72 29 20 61 6e 64 20 |X.register) and | 000017b0 26 46 31 20 28 59 20 72 65 67 69 73 74 65 72 29 |&F1 (Y register)| 000017c0 2e 20 54 68 65 20 69 6e 64 65 78 20 72 65 67 69 |. The index regi| 000017d0 73 74 65 72 73 20 61 6e 64 20 74 68 65 69 72 20 |sters and their | 000017e0 7a 65 72 6f 0d 70 61 67 65 20 63 6f 70 69 65 73 |zero.page copies| 000017f0 20 73 68 6f 75 6c 64 20 62 65 20 69 64 65 6e 74 | should be ident| 00001800 69 63 61 6c 2e 20 45 76 65 6e 20 69 66 20 79 6f |ical. Even if yo| 00001810 75 20 64 6f 6e 27 74 20 77 61 6e 74 20 74 6f 20 |u don't want to | 00001820 77 72 69 74 65 20 61 6e 79 0d 72 65 73 75 6c 74 |write any.result| 00001830 73 20 79 6f 75 20 73 68 6f 75 6c 64 20 73 74 69 |s you should sti| 00001840 6c 6c 20 65 6e 73 75 72 65 20 74 68 61 74 20 74 |ll ensure that t| 00001850 68 65 20 69 6e 64 65 78 20 72 65 67 69 73 74 65 |he index registe| 00001860 72 73 20 61 72 65 20 69 64 65 6e 74 69 63 61 6c |rs are identical| 00001870 0d 74 6f 20 74 68 65 69 72 20 7a 65 72 6f 20 70 |.to their zero p| 00001880 61 67 65 20 63 6f 70 69 65 73 2e 20 54 68 65 20 |age copies. The | 00001890 61 63 63 75 6d 75 6c 61 74 6f 72 20 77 61 73 20 |accumulator was | 000018a0 70 75 73 68 65 64 20 6f 6e 20 74 68 65 20 73 74 |pushed on the st| 000018b0 61 63 6b 20 62 79 0d 74 68 65 20 69 6e 74 65 72 |ack by.the inter| 000018c0 70 72 65 74 65 72 20 61 6e 64 20 69 74 20 69 73 |preter and it is| 000018d0 20 70 75 6c 6c 65 64 20 62 61 63 6b 20 6f 66 66 | pulled back off| 000018e0 20 74 6f 20 62 61 6c 61 6e 63 65 20 74 68 65 20 | to balance the | 000018f0 73 74 61 63 6b 2e 20 54 68 65 0d 61 63 63 75 6d |stack. The.accum| 00001900 75 6c 61 74 6f 72 20 69 73 20 72 65 73 65 74 20 |ulator is reset | 00001910 74 6f 20 7a 65 72 6f 20 74 6f 20 69 6e 66 6f 72 |to zero to infor| 00001920 6d 20 6f 74 68 65 72 20 72 6f 6d 73 20 74 68 61 |m other roms tha| 00001930 74 20 74 68 65 20 73 65 72 76 69 63 65 0d 63 61 |t the service.ca| 00001940 6c 6c 20 68 61 73 20 62 65 65 6e 20 72 65 63 6f |ll has been reco| 00001950 67 6e 69 73 65 64 20 61 6e 64 20 63 6f 6e 74 72 |gnised and contr| 00001960 6f 6c 20 69 73 20 70 61 73 73 65 64 20 62 61 63 |ol is passed bac| 00001970 6b 20 74 6f 20 74 68 65 20 4d 4f 53 2e 0d 0d 20 |k to the MOS... | 00001980 20 54 68 65 20 69 6e 74 65 72 70 72 65 74 65 72 | The interpreter| 00001990 20 69 6e 20 66 69 67 75 72 65 20 36 2e 32 20 69 | in figure 6.2 i| 000019a0 73 20 75 73 65 64 20 69 6e 20 74 68 65 20 65 78 |s used in the ex| 000019b0 61 6d 70 6c 65 20 70 72 6f 67 72 61 6d 20 4f 53 |ample program OS| 000019c0 42 59 54 45 2e 0d 54 68 69 73 20 70 72 6f 67 72 |BYTE..This progr| 000019d0 61 6d 20 67 65 6e 65 72 61 74 65 73 20 74 68 65 |am generates the| 000019e0 20 6f 62 6a 65 63 74 20 63 6f 64 65 20 66 6f 72 | object code for| 000019f0 20 2a 46 58 20 31 30 30 2c 78 2c 79 20 69 6e 20 | *FX 100,x,y in | 00001a00 77 68 69 63 68 20 74 68 65 20 58 0d 70 61 72 61 |which the X.para| 00001a10 6d 65 74 65 72 20 69 73 20 74 68 65 20 6e 75 6d |meter is the num| 00001a20 62 65 72 20 6f 66 20 61 20 72 6f 6d 20 74 6f 20 |ber of a rom to | 00001a30 62 65 20 64 69 73 61 62 6c 65 64 20 61 6e 64 20 |be disabled and | 00001a40 74 68 65 20 59 20 70 61 72 61 6d 65 74 65 72 20 |the Y parameter | 00001a50 69 73 0d 75 73 65 64 20 61 73 20 61 20 66 6c 61 |is.used as a fla| 00001a60 67 20 77 68 69 63 68 2c 20 69 66 20 73 65 74 2c |g which, if set,| 00001a70 20 74 65 6c 6c 73 20 74 68 65 20 72 6f 75 74 69 | tells the routi| 00001a80 6e 65 20 74 6f 20 70 72 69 6e 74 20 61 20 6c 69 |ne to print a li| 00001a90 73 74 20 6f 66 20 74 68 65 0d 61 63 74 69 76 65 |st of the.active| 00001aa0 20 72 6f 6d 73 2e 20 49 66 20 74 68 65 20 58 20 | roms. If the X | 00001ab0 70 61 72 61 6d 65 74 65 72 20 69 73 20 6f 75 74 |parameter is out| 00001ac0 73 69 64 65 20 74 68 65 20 72 61 6e 67 65 20 66 |side the range f| 00001ad0 72 6f 6d 20 30 20 74 6f 20 31 35 20 69 74 0d 69 |rom 0 to 15 it.i| 00001ae0 73 20 69 67 6e 6f 72 65 64 2e 20 54 6f 20 75 73 |s ignored. To us| 00001af0 65 20 74 68 65 20 70 72 6f 67 72 61 6d 20 6c 6f |e the program lo| 00001b00 61 64 20 74 68 65 20 6f 62 6a 65 63 74 20 63 6f |ad the object co| 00001b10 64 65 20 69 74 20 67 65 6e 65 72 61 74 65 73 20 |de it generates | 00001b20 69 6e 74 6f 0d 53 57 52 20 61 6e 64 20 70 72 65 |into.SWR and pre| 00001b30 73 73 20 74 68 65 20 42 72 65 61 6b 20 6b 65 79 |ss the Break key| 00001b40 2e 20 59 6f 75 20 63 61 6e 20 75 73 65 20 74 68 |. You can use th| 00001b50 65 20 6e 65 77 20 4f 73 62 79 74 65 20 74 6f 20 |e new Osbyte to | 00001b60 64 69 73 61 62 6c 65 20 61 6e 79 0d 72 6f 6d 2c |disable any.rom,| 00001b70 20 65 78 63 65 70 74 20 42 41 53 49 43 2c 20 75 | except BASIC, u| 00001b80 6e 74 69 6c 20 74 68 65 20 42 72 65 61 6b 20 6b |ntil the Break k| 00001b90 65 79 20 69 73 20 70 72 65 73 73 65 64 20 74 6f |ey is pressed to| 00001ba0 20 72 65 2d 65 6e 61 62 6c 65 20 69 74 2e 0d 0d | re-enable it...| 00001bb0 20 20 54 79 70 65 20 2a 46 58 20 31 30 30 2c 31 | Type *FX 100,1| 00001bc0 30 30 2c 31 20 74 6f 20 6c 69 73 74 20 74 68 65 |00,1 to list the| 00001bd0 20 72 6f 6d 73 20 69 6e 20 79 6f 75 72 20 63 6f | roms in your co| 00001be0 6d 70 75 74 65 72 2e 20 54 68 69 73 20 63 6f 6d |mputer. This com| 00001bf0 6d 61 6e 64 0d 77 69 6c 6c 20 62 65 20 72 65 63 |mand.will be rec| 00001c00 6f 67 6e 69 73 65 64 20 61 73 20 74 68 65 20 6e |ognised as the n| 00001c10 65 77 20 4f 73 62 79 74 65 20 62 75 74 20 74 68 |ew Osbyte but th| 00001c20 65 20 58 20 70 61 72 61 6d 65 74 65 72 20 69 73 |e X parameter is| 00001c30 20 6f 75 74 20 6f 66 0d 72 61 6e 67 65 20 61 6e | out of.range an| 00001c40 64 20 69 74 20 77 69 6c 6c 20 6e 6f 74 20 64 69 |d it will not di| 00001c50 73 61 62 6c 65 20 61 6e 79 20 72 6f 6d 2e 20 54 |sable any rom. T| 00001c60 68 65 20 59 20 70 61 72 61 6d 65 74 65 72 20 68 |he Y parameter h| 00001c70 61 73 20 61 20 76 61 6c 75 65 0d 6f 74 68 65 72 |as a value.other| 00001c80 20 74 68 61 6e 20 7a 65 72 6f 20 61 6e 64 20 74 | than zero and t| 00001c90 68 65 20 61 63 74 69 76 65 20 72 6f 6d 73 20 77 |he active roms w| 00001ca0 69 6c 6c 20 62 65 20 6c 69 73 74 65 64 2e 0d 0d |ill be listed...| 00001cb0 20 20 54 79 70 65 20 2a 46 58 20 31 30 30 2c 31 | Type *FX 100,1| 00001cc0 30 20 74 6f 20 64 69 73 61 62 6c 65 20 72 6f 6d |0 to disable rom| 00001cd0 20 26 30 41 20 77 69 74 68 6f 75 74 20 6c 69 73 | &0A without lis| 00001ce0 74 69 6e 67 20 74 68 65 20 61 63 74 69 76 65 20 |ting the active | 00001cf0 72 6f 6d 73 2e 0d 54 68 65 20 59 20 70 61 72 61 |roms..The Y para| 00001d00 6d 65 74 65 72 20 69 73 20 6e 6f 74 20 73 70 65 |meter is not spe| 00001d10 63 69 66 69 65 64 20 61 6e 64 20 74 61 6b 65 73 |cified and takes| 00001d20 20 74 68 65 20 64 65 66 61 75 6c 74 20 76 61 6c | the default val| 00001d30 75 65 20 6f 66 20 7a 65 72 6f 2e 0d 0d 20 20 54 |ue of zero... T| 00001d40 79 70 65 20 2a 46 58 20 31 30 30 2c 38 2c 31 20 |ype *FX 100,8,1 | 00001d50 74 6f 20 64 69 73 61 62 6c 65 20 72 6f 6d 20 26 |to disable rom &| 00001d60 30 38 20 61 6e 64 20 6c 69 73 74 20 74 68 65 20 |08 and list the | 00001d70 61 63 74 69 76 65 20 72 6f 6d 73 2e 0d 0d 20 20 |active roms... | 00001d80 59 6f 75 20 63 61 6e 20 72 65 2d 65 6e 61 62 6c |You can re-enabl| 00001d90 65 20 61 6c 6c 20 74 68 65 20 72 6f 6d 73 20 64 |e all the roms d| 00001da0 69 73 61 62 6c 65 64 20 77 69 74 68 20 74 68 69 |isabled with thi| 00001db0 73 20 6e 65 77 20 4f 73 62 79 74 65 20 62 79 0d |s new Osbyte by.| 00001dc0 70 72 65 73 73 69 6e 67 20 74 68 65 20 42 72 65 |pressing the Bre| 00001dd0 61 6b 20 6b 65 79 2e 0d 0d 20 20 54 68 65 20 70 |ak key... The p| 00001de0 72 6f 67 72 61 6d 20 75 73 65 73 20 61 6e 20 4f |rogram uses an O| 00001df0 73 62 79 74 65 20 69 6e 74 65 72 70 72 65 74 65 |sbyte interprete| 00001e00 72 20 28 6c 69 6e 65 73 20 33 31 30 2d 34 31 30 |r (lines 310-410| 00001e10 29 20 73 69 6d 69 6c 61 72 20 74 6f 0d 74 68 65 |) similar to.the| 00001e20 20 6f 6e 65 20 6f 75 74 6c 69 6e 65 64 20 69 6e | one outlined in| 00001e30 20 66 69 67 75 72 65 20 36 2e 32 2e 20 41 66 74 | figure 6.2. Aft| 00001e40 65 72 20 72 65 63 6f 67 6e 69 73 69 6e 67 20 74 |er recognising t| 00001e50 68 65 20 6e 65 77 20 4f 73 62 79 74 65 0d 28 6c |he new Osbyte.(l| 00001e60 69 6e 65 73 20 33 39 30 2d 34 31 30 29 20 74 68 |ines 390-410) th| 00001e70 65 20 6e 65 77 20 72 6f 75 74 69 6e 65 20 6c 6f |e new routine lo| 00001e80 61 64 73 20 74 68 65 20 58 20 72 65 67 69 73 74 |ads the X regist| 00001e90 65 72 20 77 69 74 68 20 74 68 65 20 58 0d 70 61 |er with the X.pa| 00001ea0 72 61 6d 65 74 65 72 20 28 6c 69 6e 65 20 34 32 |rameter (line 42| 00001eb0 30 29 20 61 6e 64 20 63 6f 6d 70 61 72 65 73 20 |0) and compares | 00001ec0 69 74 20 77 69 74 68 20 26 31 30 20 28 6c 69 6e |it with &10 (lin| 00001ed0 65 20 34 33 30 29 20 74 6f 20 73 65 65 20 69 66 |e 430) to see if| 00001ee0 20 69 74 0d 69 73 20 69 6e 20 74 68 65 20 72 61 | it.is in the ra| 00001ef0 6e 67 65 20 66 72 6f 6d 20 30 20 74 6f 20 31 35 |nge from 0 to 15| 00001f00 2e 20 49 66 20 58 20 69 73 20 69 6e 20 72 61 6e |. If X is in ran| 00001f10 67 65 20 69 74 20 64 69 73 61 62 6c 65 73 20 74 |ge it disables t| 00001f20 68 65 20 72 6f 6d 20 62 79 0d 73 74 6f 72 69 6e |he rom by.storin| 00001f30 67 20 61 20 7a 65 72 6f 20 69 6e 20 74 68 65 20 |g a zero in the | 00001f40 72 6f 6d 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 |rom information | 00001f50 74 61 62 6c 65 20 62 79 74 65 20 74 68 61 74 20 |table byte that | 00001f60 63 6f 72 72 65 73 70 6f 6e 64 73 20 77 69 74 68 |corresponds with| 00001f70 0d 74 68 61 74 20 72 6f 6d 20 28 6c 69 6e 65 73 |.that rom (lines| 00001f80 20 34 35 30 2d 34 36 30 29 2e 20 54 68 65 20 59 | 450-460). The Y| 00001f90 20 70 61 72 61 6d 65 74 65 72 20 69 73 20 74 68 | parameter is th| 00001fa0 65 6e 20 6c 6f 61 64 65 64 20 69 6e 74 6f 20 74 |en loaded into t| 00001fb0 68 65 20 59 0d 72 65 67 69 73 74 65 72 20 28 6c |he Y.register (l| 00001fc0 69 6e 65 20 34 38 30 29 20 61 6e 64 20 63 68 65 |ine 480) and che| 00001fd0 63 6b 65 64 20 74 6f 20 73 65 65 20 69 66 20 69 |cked to see if i| 00001fe0 74 20 68 61 73 20 62 65 65 6e 20 73 65 74 20 28 |t has been set (| 00001ff0 6c 69 6e 65 20 34 39 30 29 2e 0d 49 66 20 69 74 |line 490)..If it| 00002000 20 68 61 73 20 62 65 65 6e 20 73 65 74 20 74 68 | has been set th| 00002010 65 20 61 63 74 69 76 65 20 72 6f 6d 73 20 61 72 |e active roms ar| 00002020 65 20 6c 69 73 74 65 64 20 28 6c 69 6e 65 20 35 |e listed (line 5| 00002030 31 30 29 2e 0d 0d 20 20 54 68 65 20 72 6f 75 74 |10)... The rout| 00002040 69 6e 65 20 64 6f 65 73 20 6e 6f 74 20 77 72 69 |ine does not wri| 00002050 74 65 20 61 6e 79 20 72 65 73 75 6c 74 73 20 74 |te any results t| 00002060 6f 20 74 68 65 20 7a 65 72 6f 20 70 61 67 65 20 |o the zero page | 00002070 63 6f 70 69 65 73 20 6f 66 0d 74 68 65 20 69 6e |copies of.the in| 00002080 64 65 78 20 72 65 67 69 73 74 65 72 73 20 62 75 |dex registers bu| 00002090 74 20 69 74 20 73 74 69 6c 6c 20 65 6e 73 75 72 |t it still ensur| 000020a0 65 73 20 74 68 61 74 20 74 68 65 20 69 6e 64 65 |es that the inde| 000020b0 78 20 72 65 67 69 73 74 65 72 73 20 61 6e 64 0d |x registers and.| 000020c0 74 68 65 69 72 20 63 6f 70 69 65 73 20 61 72 65 |their copies are| 000020d0 20 69 64 65 6e 74 69 63 61 6c 20 28 6c 69 6e 65 | identical (line| 000020e0 73 20 35 33 30 2d 35 34 30 29 2e 20 54 68 65 20 |s 530-540). The | 000020f0 61 63 63 75 6d 75 6c 61 74 6f 72 20 77 61 73 20 |accumulator was | 00002100 70 75 73 68 65 64 0d 6f 6e 20 74 68 65 20 73 74 |pushed.on the st| 00002110 61 63 6b 20 62 79 20 74 68 65 20 69 6e 74 65 72 |ack by the inter| 00002120 70 72 65 74 65 72 20 28 6c 69 6e 65 20 33 32 30 |preter (line 320| 00002130 29 20 61 6e 64 20 69 74 20 69 73 20 70 75 6c 6c |) and it is pull| 00002140 65 64 20 62 61 63 6b 20 6f 66 66 0d 69 6e 20 6c |ed back off.in l| 00002150 69 6e 65 20 35 35 30 2e 20 49 74 20 69 73 20 72 |ine 550. It is r| 00002160 65 73 65 74 20 74 6f 20 7a 65 72 6f 20 74 6f 20 |eset to zero to | 00002170 69 6e 66 6f 72 6d 20 74 68 65 20 6f 74 68 65 72 |inform the other| 00002180 20 72 6f 6d 73 20 74 68 61 74 20 74 68 65 0d 73 | roms that the.s| 00002190 65 72 76 69 63 65 20 63 61 6c 6c 20 68 61 73 20 |ervice call has | 000021a0 62 65 65 6e 20 72 65 63 6f 67 6e 69 73 65 64 20 |been recognised | 000021b0 28 6c 69 6e 65 20 35 36 30 29 20 61 6e 64 20 63 |(line 560) and c| 000021c0 6f 6e 74 72 6f 6c 20 69 73 20 72 65 74 75 72 6e |ontrol is return| 000021d0 65 64 20 74 6f 0d 74 68 65 20 4d 4f 53 20 28 6c |ed to.the MOS (l| 000021e0 69 6e 65 20 35 37 30 29 2e 0d 0d 20 20 54 68 65 |ine 570)... The| 000021f0 20 73 75 62 72 6f 75 74 69 6e 65 20 72 6f 6d 6e | subroutine romn| 00002200 61 6d 65 73 20 28 6c 69 6e 65 73 20 35 38 30 2d |ames (lines 580-| 00002210 39 34 30 29 20 75 73 65 73 20 4f 73 72 64 72 6d |940) uses Osrdrm| 00002220 20 74 6f 20 6c 69 73 74 20 74 68 65 0d 74 69 74 | to list the.tit| 00002230 6c 65 73 20 6f 66 20 74 68 65 20 61 63 74 69 76 |les of the activ| 00002240 65 20 72 6f 6d 73 20 61 6e 64 20 69 73 20 73 69 |e roms and is si| 00002250 6d 69 6c 61 72 20 74 6f 20 74 68 65 20 72 6f 75 |milar to the rou| 00002260 74 69 6e 65 20 75 73 65 64 20 74 6f 20 70 72 69 |tine used to pri| 00002270 6e 74 0d 72 6f 6d 20 74 69 74 6c 65 73 20 69 6e |nt.rom titles in| 00002280 20 74 68 65 20 70 72 6f 67 72 61 6d 20 52 45 41 | the program REA| 00002290 44 52 4f 4d 20 28 75 73 65 64 20 69 6e 20 4d 6f |DROM (used in Mo| 000022a0 64 75 6c 65 20 31 29 2e 20 54 68 65 20 73 75 62 |dule 1). The sub| 000022b0 72 6f 75 74 69 6e 65 0d 64 65 63 69 6d 61 6c 20 |routine.decimal | 000022c0 28 6c 69 6e 65 73 20 39 35 30 2d 31 31 31 30 29 |(lines 950-1110)| 000022d0 20 70 72 69 6e 74 73 20 74 68 65 20 41 53 43 49 | prints the ASCI| 000022e0 49 20 64 65 63 69 6d 61 6c 20 65 71 75 69 76 61 |I decimal equiva| 000022f0 6c 65 6e 74 20 6f 66 20 61 6e 79 0d 62 79 74 65 |lent of any.byte| 00002300 20 73 74 6f 72 69 6e 67 20 61 20 6e 75 6d 62 65 | storing a numbe| 00002310 72 20 69 6e 20 74 68 65 20 72 61 6e 67 65 20 66 |r in the range f| 00002320 72 6f 6d 20 30 20 74 6f 20 39 39 20 28 64 65 63 |rom 0 to 99 (dec| 00002330 69 6d 61 6c 29 2e 20 49 74 20 69 73 20 71 75 69 |imal). It is qui| 00002340 74 65 0d 61 20 75 73 65 66 75 6c 20 72 6f 75 74 |te.a useful rout| 00002350 69 6e 65 20 61 6e 64 20 63 61 6e 20 61 6c 73 6f |ine and can also| 00002360 20 62 65 20 75 73 65 64 20 74 6f 20 70 72 69 6e | be used to prin| 00002370 74 20 61 20 62 69 6e 61 72 79 20 63 6f 64 65 64 |t a binary coded| 00002380 20 64 65 63 69 6d 61 6c 0d 62 79 74 65 2e 0d 0d | decimal.byte...| 00002390 0d 0d 0d 0d 20 20 20 31 30 20 52 45 4d 3a 20 4f |.... 10 REM: O| 000023a0 53 42 59 54 45 0d 20 20 20 32 30 20 4d 4f 44 45 |SBYTE. 20 MODE| 000023b0 37 0d 20 20 20 33 30 20 48 49 4d 45 4d 3d 26 33 |7. 30 HIMEM=&3| 000023c0 43 30 30 0d 20 20 20 34 30 20 44 49 4d 20 73 61 |C00. 40 DIM sa| 000023d0 76 65 20 35 30 0d 20 20 20 35 30 20 64 69 66 66 |ve 50. 50 diff| 000023e0 3d 26 38 30 30 30 2d 48 49 4d 45 4d 0d 20 20 20 |=&8000-HIMEM. | 000023f0 36 30 20 61 63 63 75 6d 75 6c 61 74 6f 72 3d 26 |60 accumulator=&| 00002400 45 46 0d 20 20 20 37 30 20 78 72 65 67 69 73 74 |EF. 70 xregist| 00002410 65 72 3d 26 46 30 0d 20 20 20 38 30 20 79 72 65 |er=&F0. 80 yre| 00002420 67 69 73 74 65 72 3d 26 46 31 0d 20 20 20 39 30 |gister=&F1. 90| 00002430 20 72 6f 6d 70 6f 69 6e 74 3d 26 46 36 0d 20 20 | rompoint=&F6. | 00002440 31 30 30 20 74 61 62 6c 65 3d 26 32 41 31 0d 20 |100 table=&2A1. | 00002450 20 31 31 30 20 6f 73 72 64 72 6d 3d 26 46 46 42 | 110 osrdrm=&FFB| 00002460 39 0d 20 20 31 32 30 20 6f 73 61 73 63 69 3d 26 |9. 120 osasci=&| 00002470 46 46 45 33 0d 20 20 31 33 30 20 6f 73 6e 65 77 |FFE3. 130 osnew| 00002480 6c 3d 26 46 46 45 37 0d 20 20 31 34 30 20 6f 73 |l=&FFE7. 140 os| 00002490 62 79 74 65 3d 26 46 46 46 34 0d 20 20 31 35 30 |byte=&FFF4. 150| 000024a0 20 6f 73 63 6c 69 3d 26 46 46 46 37 0d 20 20 31 | oscli=&FFF7. 1| 000024b0 36 30 20 46 4f 52 20 70 61 73 73 20 3d 20 30 20 |60 FOR pass = 0 | 000024c0 54 4f 20 32 20 53 54 45 50 20 32 0d 20 20 31 37 |TO 2 STEP 2. 17| 000024d0 30 20 50 25 3d 48 49 4d 45 4d 0d 20 20 31 38 30 |0 P%=HIMEM. 180| 000024e0 20 5b 20 20 20 20 20 20 20 4f 50 54 20 70 61 73 | [ OPT pas| 000024f0 73 0d 20 20 31 39 30 20 20 20 20 20 20 20 20 20 |s. 190 | 00002500 42 52 4b 0d 20 20 32 30 30 20 20 20 20 20 20 20 |BRK. 200 | 00002510 20 20 42 52 4b 0d 20 20 32 31 30 20 20 20 20 20 | BRK. 210 | 00002520 20 20 20 20 42 52 4b 0d 20 20 32 32 30 20 20 20 | BRK. 220 | 00002530 20 20 20 20 20 20 4a 4d 50 20 73 65 72 76 69 63 | JMP servic| 00002540 65 2b 64 69 66 66 0d 20 20 32 33 30 20 20 20 20 |e+diff. 230 | 00002550 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 62 28 | OPT FNequb(| 00002560 26 38 32 29 0d 20 20 32 34 30 20 20 20 20 20 20 |&82). 240 | 00002570 20 20 20 4f 50 54 20 46 4e 65 71 75 62 28 28 63 | OPT FNequb((c| 00002580 6f 70 79 72 69 67 68 74 2b 64 69 66 66 29 20 4d |opyright+diff) M| 00002590 4f 44 20 32 35 36 29 0d 20 20 32 35 30 20 20 20 |OD 256). 250 | 000025a0 20 20 20 20 20 20 42 52 4b 0d 20 20 32 36 30 20 | BRK. 260 | 000025b0 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 | OPT FNeq| 000025c0 75 73 28 22 4f 53 42 59 54 45 22 29 0d 20 20 32 |us("OSBYTE"). 2| 000025d0 37 30 20 2e 63 6f 70 79 72 69 67 68 74 0d 20 20 |70 .copyright. | 000025e0 32 38 30 20 20 20 20 20 20 20 20 20 42 52 4b 0d |280 BRK.| 000025f0 20 20 32 39 30 20 20 20 20 20 20 20 20 20 4f 50 | 290 OP| 00002600 54 20 46 4e 65 71 75 73 28 22 28 43 29 20 47 6f |T FNequs("(C) Go| 00002610 72 64 6f 6e 20 48 6f 72 73 69 6e 67 74 6f 6e 20 |rdon Horsington | 00002620 31 39 38 37 22 29 0d 20 20 33 30 30 20 20 20 20 |1987"). 300 | 00002630 20 20 20 20 20 42 52 4b 0d 20 20 33 31 30 20 2e | BRK. 310 .| 00002640 73 65 72 76 69 63 65 0d 20 20 33 32 30 20 20 20 |service. 320 | 00002650 20 20 20 20 20 20 50 48 41 0d 20 20 33 33 30 20 | PHA. 330 | 00002660 20 20 20 20 20 20 20 20 43 4d 50 20 23 37 0d 20 | CMP #7. | 00002670 20 33 34 30 20 20 20 20 20 20 20 20 20 42 45 51 | 340 BEQ| 00002680 20 6e 65 77 6f 73 62 79 74 65 0d 20 20 33 35 30 | newosbyte. 350| 00002690 20 2e 65 78 69 74 0d 20 20 33 36 30 20 20 20 20 | .exit. 360 | 000026a0 20 20 20 20 20 50 4c 41 0d 20 20 33 37 30 20 20 | PLA. 370 | 000026b0 20 20 20 20 20 20 20 52 54 53 0d 20 20 33 38 30 | RTS. 380| 000026c0 20 2e 6e 65 77 6f 73 62 79 74 65 0d 20 20 33 39 | .newosbyte. 39| 000026d0 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 61 63 |0 LDA ac| 000026e0 63 75 6d 75 6c 61 74 6f 72 0d 20 20 34 30 30 20 |cumulator. 400 | 000026f0 20 20 20 20 20 20 20 20 43 4d 50 20 23 31 30 30 | CMP #100| 00002700 0d 20 20 34 31 30 20 20 20 20 20 20 20 20 20 42 |. 410 B| 00002710 4e 45 20 65 78 69 74 0d 20 20 34 32 30 20 20 20 |NE exit. 420 | 00002720 20 20 20 20 20 20 4c 44 58 20 78 72 65 67 69 73 | LDX xregis| 00002730 74 65 72 0d 20 20 34 33 30 20 20 20 20 20 20 20 |ter. 430 | 00002740 20 20 43 50 58 20 23 26 31 30 0d 20 20 34 34 30 | CPX #&10. 440| 00002750 20 20 20 20 20 20 20 20 20 42 43 53 20 63 68 65 | BCS che| 00002760 63 6b 79 72 65 67 0d 20 20 34 35 30 20 20 20 20 |ckyreg. 450 | 00002770 20 20 20 20 20 4c 44 41 20 23 30 0d 20 20 34 36 | LDA #0. 46| 00002780 30 20 20 20 20 20 20 20 20 20 53 54 41 20 74 61 |0 STA ta| 00002790 62 6c 65 2c 58 0d 20 20 34 37 30 20 2e 63 68 65 |ble,X. 470 .che| 000027a0 63 6b 79 72 65 67 0d 20 20 34 38 30 20 20 20 20 |ckyreg. 480 | 000027b0 20 20 20 20 20 4c 44 59 20 79 72 65 67 69 73 74 | LDY yregist| 000027c0 65 72 0d 20 20 34 39 30 20 20 20 20 20 20 20 20 |er. 490 | 000027d0 20 42 45 51 20 6f 75 74 0d 20 20 35 30 30 20 2e | BEQ out. 500 .| 000027e0 72 6f 6d 6c 69 73 74 0d 20 20 35 31 30 20 20 20 |romlist. 510 | 000027f0 20 20 20 20 20 20 4a 53 52 20 72 6f 6d 6e 61 6d | JSR romnam| 00002800 65 73 2b 64 69 66 66 0d 20 20 35 32 30 20 2e 6f |es+diff. 520 .o| 00002810 75 74 0d 20 20 35 33 30 20 20 20 20 20 20 20 20 |ut. 530 | 00002820 20 4c 44 58 20 78 72 65 67 69 73 74 65 72 0d 20 | LDX xregister. | 00002830 20 35 34 30 20 20 20 20 20 20 20 20 20 4c 44 59 | 540 LDY| 00002840 20 79 72 65 67 69 73 74 65 72 0d 20 20 35 35 30 | yregister. 550| 00002850 20 20 20 20 20 20 20 20 20 50 4c 41 0d 20 20 35 | PLA. 5| 00002860 36 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 |60 LDA #| 00002870 30 0d 20 20 35 37 30 20 20 20 20 20 20 20 20 20 |0. 570 | 00002880 52 54 53 0d 20 20 35 38 30 20 2e 72 6f 6d 6e 61 |RTS. 580 .romna| 00002890 6d 65 73 0d 20 20 35 39 30 20 20 20 20 20 20 20 |mes. 590 | 000028a0 20 20 4a 53 52 20 6f 73 6e 65 77 6c 0d 20 20 36 | JSR osnewl. 6| 000028b0 30 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 |00 LDA #| 000028c0 26 46 0d 20 20 36 31 30 20 20 20 20 20 20 20 20 |&F. 610 | 000028d0 20 50 48 41 0d 20 20 36 32 30 20 2e 72 6f 6d 6c | PHA. 620 .roml| 000028e0 6f 6f 70 0d 20 20 36 33 30 20 20 20 20 20 20 20 |oop. 630 | 000028f0 20 20 54 41 59 0d 20 20 36 34 30 20 20 20 20 20 | TAY. 640 | 00002900 20 20 20 20 4c 44 41 20 74 61 62 6c 65 2c 59 0d | LDA table,Y.| 00002910 20 20 36 35 30 20 20 20 20 20 20 20 20 20 42 45 | 650 BE| 00002920 51 20 6e 6f 74 68 65 72 65 0d 20 20 36 36 30 20 |Q nothere. 660 | 00002930 20 20 20 20 20 20 20 20 54 59 41 0d 20 20 36 37 | TYA. 67| 00002940 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 64 65 |0 JSR de| 00002950 63 69 6d 61 6c 2b 64 69 66 66 0d 20 20 36 38 30 |cimal+diff. 680| 00002960 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 41 53 | LDA #AS| 00002970 43 28 22 20 22 29 0d 20 20 36 39 30 20 20 20 20 |C(" "). 690 | 00002980 20 20 20 20 20 4a 53 52 20 6f 73 61 73 63 69 0d | JSR osasci.| 00002990 20 20 37 30 30 20 20 20 20 20 20 20 20 20 4c 44 | 700 LD| 000029a0 41 20 23 26 38 0d 20 20 37 31 30 20 20 20 20 20 |A #&8. 710 | 000029b0 20 20 20 20 53 54 41 20 72 6f 6d 70 6f 69 6e 74 | STA rompoint| 000029c0 0d 20 20 37 32 30 20 20 20 20 20 20 20 20 20 4c |. 720 L| 000029d0 44 41 20 23 26 38 30 0d 20 20 37 33 30 20 20 20 |DA #&80. 730 | 000029e0 20 20 20 20 20 20 53 54 41 20 72 6f 6d 70 6f 69 | STA rompoi| 000029f0 6e 74 2b 31 0d 20 20 37 34 30 20 2e 72 65 61 64 |nt+1. 740 .read| 00002a00 6c 6f 6f 70 0d 20 20 37 35 30 20 20 20 20 20 20 |loop. 750 | 00002a10 20 20 20 49 4e 43 20 72 6f 6d 70 6f 69 6e 74 0d | INC rompoint.| 00002a20 20 20 37 36 30 20 20 20 20 20 20 20 20 20 42 45 | 760 BE| 00002a30 51 20 6e 65 77 6c 69 6e 65 0d 20 20 37 37 30 20 |Q newline. 770 | 00002a40 20 20 20 20 20 20 20 20 50 4c 41 0d 20 20 37 38 | PLA. 78| 00002a50 30 20 20 20 20 20 20 20 20 20 50 48 41 0d 20 20 |0 PHA. | 00002a60 37 39 30 20 20 20 20 20 20 20 20 20 54 41 59 0d |790 TAY.| 00002a70 20 20 38 30 30 20 20 20 20 20 20 20 20 20 4a 53 | 800 JS| 00002a80 52 20 6f 73 72 64 72 6d 0d 20 20 38 31 30 20 20 |R osrdrm. 810 | 00002a90 20 20 20 20 20 20 20 43 4d 50 20 23 41 53 43 28 | CMP #ASC(| 00002aa0 22 20 22 29 0d 20 20 38 32 30 20 20 20 20 20 20 |" "). 820 | 00002ab0 20 20 20 42 43 43 20 6e 65 77 6c 69 6e 65 0d 20 | BCC newline. | 00002ac0 20 38 33 30 20 20 20 20 20 20 20 20 20 4a 53 52 | 830 JSR| 00002ad0 20 6f 73 61 73 63 69 0d 20 20 38 34 30 20 20 20 | osasci. 840 | 00002ae0 20 20 20 20 20 20 4a 4d 50 20 72 65 61 64 6c 6f | JMP readlo| 00002af0 6f 70 2b 64 69 66 66 0d 20 20 38 35 30 20 2e 6e |op+diff. 850 .n| 00002b00 65 77 6c 69 6e 65 0d 20 20 38 36 30 20 20 20 20 |ewline. 860 | 00002b10 20 20 20 20 20 4a 53 52 20 6f 73 6e 65 77 6c 0d | JSR osnewl.| 00002b20 20 20 38 37 30 20 2e 6e 6f 74 68 65 72 65 0d 20 | 870 .nothere. | 00002b30 20 38 38 30 20 20 20 20 20 20 20 20 20 50 4c 41 | 880 PLA| 00002b40 0d 20 20 38 39 30 20 20 20 20 20 20 20 20 20 53 |. 890 S| 00002b50 45 43 0d 20 20 39 30 30 20 20 20 20 20 20 20 20 |EC. 900 | 00002b60 20 53 42 43 20 23 31 0d 20 20 39 31 30 20 20 20 | SBC #1. 910 | 00002b70 20 20 20 20 20 20 50 48 41 0d 20 20 39 32 30 20 | PHA. 920 | 00002b80 20 20 20 20 20 20 20 20 42 50 4c 20 72 6f 6d 6c | BPL roml| 00002b90 6f 6f 70 0d 20 20 39 33 30 20 20 20 20 20 20 20 |oop. 930 | 00002ba0 20 20 50 4c 41 0d 20 20 39 34 30 20 20 20 20 20 | PLA. 940 | 00002bb0 20 20 20 20 4a 4d 50 20 6f 73 6e 65 77 6c 0d 20 | JMP osnewl. | 00002bc0 20 39 35 30 20 2e 64 65 63 69 6d 61 6c 0d 20 20 | 950 .decimal. | 00002bd0 39 36 30 20 20 20 20 20 20 20 20 20 53 45 44 0d |960 SED.| 00002be0 20 20 39 37 30 20 20 20 20 20 20 20 20 20 43 4c | 970 CL| 00002bf0 43 0d 20 20 39 38 30 20 20 20 20 20 20 20 20 20 |C. 980 | 00002c00 41 44 43 20 23 30 0d 20 20 39 39 30 20 20 20 20 |ADC #0. 990 | 00002c10 20 20 20 20 20 43 4c 44 0d 20 31 30 30 30 20 20 | CLD. 1000 | 00002c20 20 20 20 20 20 20 20 50 48 41 0d 20 31 30 31 30 | PHA. 1010| 00002c30 20 20 20 20 20 20 20 20 20 4c 53 52 20 41 0d 20 | LSR A. | 00002c40 31 30 32 30 20 20 20 20 20 20 20 20 20 4c 53 52 |1020 LSR| 00002c50 20 41 0d 20 31 30 33 30 20 20 20 20 20 20 20 20 | A. 1030 | 00002c60 20 4c 53 52 20 41 0d 20 31 30 34 30 20 20 20 20 | LSR A. 1040 | 00002c70 20 20 20 20 20 4c 53 52 20 41 0d 20 31 30 35 30 | LSR A. 1050| 00002c80 20 20 20 20 20 20 20 20 20 4a 53 52 20 6e 69 62 | JSR nib| 00002c90 62 6c 65 2b 64 69 66 66 0d 20 31 30 36 30 20 20 |ble+diff. 1060 | 00002ca0 20 20 20 20 20 20 20 50 4c 41 0d 20 31 30 37 30 | PLA. 1070| 00002cb0 20 20 20 20 20 20 20 20 20 41 4e 44 20 23 26 46 | AND #&F| 00002cc0 0d 20 31 30 38 30 20 2e 6e 69 62 62 6c 65 0d 20 |. 1080 .nibble. | 00002cd0 31 30 39 30 20 20 20 20 20 20 20 20 20 43 4c 43 |1090 CLC| 00002ce0 0d 20 31 31 30 30 20 20 20 20 20 20 20 20 20 41 |. 1100 A| 00002cf0 44 43 20 23 41 53 43 28 22 30 22 29 0d 20 31 31 |DC #ASC("0"). 11| 00002d00 31 30 20 20 20 20 20 20 20 20 20 4a 4d 50 20 6f |10 JMP o| 00002d10 73 61 73 63 69 0d 20 31 31 32 30 20 2e 6c 61 73 |sasci. 1120 .las| 00002d20 74 62 79 74 65 0d 20 31 31 33 30 20 5d 0d 20 31 |tbyte. 1130 ]. 1| 00002d30 31 34 30 20 4e 45 58 54 0d 20 31 31 35 30 20 49 |140 NEXT. 1150 I| 00002d40 4e 50 55 54 27 22 53 61 76 65 20 66 69 6c 65 6e |NPUT'"Save filen| 00002d50 61 6d 65 20 3d 20 22 66 69 6c 65 6e 61 6d 65 24 |ame = "filename$| 00002d60 0d 20 31 31 36 30 20 49 46 20 66 69 6c 65 6e 61 |. 1160 IF filena| 00002d70 6d 65 24 3d 22 22 20 45 4e 44 0d 20 31 31 37 30 |me$="" END. 1170| 00002d80 20 24 73 61 76 65 3d 22 53 41 56 45 20 22 2b 66 | $save="SAVE "+f| 00002d90 69 6c 65 6e 61 6d 65 24 2b 22 20 22 2b 53 54 52 |ilename$+" "+STR| 00002da0 24 7e 28 48 49 4d 45 4d 29 2b 22 20 22 2b 53 54 |$~(HIMEM)+" "+ST| 00002db0 52 24 7e 28 6c 61 73 0d 20 20 20 20 20 20 74 62 |R$~(las. tb| 00002dc0 79 74 65 29 2b 22 20 46 46 46 46 38 30 30 30 20 |yte)+" FFFF8000 | 00002dd0 46 46 46 46 38 30 30 30 22 0d 20 31 31 38 30 20 |FFFF8000". 1180 | 00002de0 58 25 3d 73 61 76 65 20 4d 4f 44 20 32 35 36 0d |X%=save MOD 256.| 00002df0 20 31 31 39 30 20 59 25 3d 73 61 76 65 20 44 49 | 1190 Y%=save DI| 00002e00 56 20 32 35 36 0d 20 31 32 30 30 20 2a 4f 50 54 |V 256. 1200 *OPT| 00002e10 31 2c 32 0d 20 31 32 31 30 20 43 41 4c 4c 20 6f |1,2. 1210 CALL o| 00002e20 73 63 6c 69 0d 20 31 32 32 30 20 2a 4f 50 54 31 |scli. 1220 *OPT1| 00002e30 2c 30 0d 20 31 32 33 30 20 45 4e 44 0d 20 31 32 |,0. 1230 END. 12| 00002e40 34 30 20 44 45 46 46 4e 65 71 75 62 28 62 79 74 |40 DEFFNequb(byt| 00002e50 65 29 0d 20 31 32 35 30 20 3f 50 25 3d 62 79 74 |e). 1250 ?P%=byt| 00002e60 65 0d 20 31 32 36 30 20 50 25 3d 50 25 2b 31 0d |e. 1260 P%=P%+1.| 00002e70 20 31 32 37 30 20 3d 70 61 73 73 0d 20 31 32 38 | 1270 =pass. 128| 00002e80 30 20 44 45 46 46 4e 65 71 75 77 28 77 6f 72 64 |0 DEFFNequw(word| 00002e90 29 0d 20 31 32 39 30 20 3f 50 25 3d 77 6f 72 64 |). 1290 ?P%=word| 00002ea0 20 4d 4f 44 20 32 35 36 0d 20 31 33 30 30 20 50 | MOD 256. 1300 P| 00002eb0 25 3f 31 3d 77 6f 72 64 20 44 49 56 20 32 35 36 |%?1=word DIV 256| 00002ec0 0d 20 31 33 31 30 20 50 25 3d 50 25 2b 32 0d 20 |. 1310 P%=P%+2. | 00002ed0 31 33 32 30 20 3d 70 61 73 73 0d 20 31 33 33 30 |1320 =pass. 1330| 00002ee0 20 44 45 46 46 4e 65 71 75 64 28 64 6f 75 62 6c | DEFFNequd(doubl| 00002ef0 65 29 0d 20 31 33 34 30 20 21 50 25 3d 64 6f 75 |e). 1340 !P%=dou| 00002f00 62 6c 65 0d 20 31 33 35 30 20 50 25 3d 50 25 2b |ble. 1350 P%=P%+| 00002f10 34 0d 20 31 33 36 30 20 3d 70 61 73 73 0d 20 31 |4. 1360 =pass. 1| 00002f20 33 37 30 20 44 45 46 46 4e 65 71 75 73 28 73 74 |370 DEFFNequs(st| 00002f30 72 69 6e 67 24 29 0d 20 31 33 38 30 20 24 50 25 |ring$). 1380 $P%| 00002f40 3d 73 74 72 69 6e 67 24 0d 20 31 33 39 30 20 50 |=string$. 1390 P| 00002f50 25 3d 50 25 2b 4c 45 4e 28 73 74 72 69 6e 67 24 |%=P%+LEN(string$| 00002f60 29 0d 20 31 34 30 30 20 3d 70 61 73 73 0d |). 1400 =pass.| 00002f6e