Home » CEEFAX disks » telesoftware5.adl » 17-02-88/T\SWR16
17-02-88/T\SWR16
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 » telesoftware5.adl |
Filename: | 17-02-88/T\SWR16 |
Read OK: | ✔ |
File size: | 3FDF bytes |
Load address: | 0000 |
Exec address: | FFFFFFFF |
Duplicates
There is 1 duplicate copy of this file in the archive:
- CEEFAX disks » telesoftware10.adl » 25-10-88/T\SWR16
- CEEFAX disks » telesoftware5.adl » 17-02-88/T\SWR16
File contents
Mastering Sideways ROM & RAM - Module 16 - *HELP ------------------------------------------------ When you type *HELP the MOS responds by issuing service call 9 to all the active roms. All roms, except BASIC, have the opportunity to respond to service call 9, the *HELP service call. The way in which a rom responds to this call usually depends on whether it is a language or a service rom. There are no hard and fast rules about how an individual rom should respond to a help request but language roms usually print the title string from the rom header and service roms print an identification string followed by the argument to be used to get extended help. The response required from a language rom will be covered in the next module of the course. The interpreter simply needs to intercept service call 9, make sure that no argument has been typed, and then print every byte of the title string. This will be demonstrated by the example program in Module 17. The response required from a service rom is more elaborate than that provided by a language rom. It is illustrated in figures 16.1 and 16.2 in which the help service provided by the example program HELP is shown with the service call trace active in a higher priority rom. >*HELP 6502 TUBE 1.10 A=09 X=0F Y=05 Help COLOURED TEXT COLOURS OS 1.20 > Figure 16.1 Simple *HELP with trace active. ----------- ------------------------------- When you type *HELP each active rom is entered with A=9, X=the rom number, and Y=the offset to the first non-space character after the *HELP command. This indicates that any argument typed after the *HELP command is not initialised quite as you would expect it to be by the Gsinit MOS subroutine. If you intend to write an extended help service in which the argument can be enclosed in quotation marks, the argument will first need to be initialised with Gsinit. If you don't feel it is necessary to include this extra refinement then there is no need to initialise the argument. >*HELP COLOURS 6502 TUBE 1.10 A=09 X=0F Y=06 Help *BLACK *RED *GREEN *YELLOW *BLUE *MAGENTA *CYAN *WHITE *BLAWHIT *REDCYAN *GREEMAG *YELLBLU *BLUYELL *MAGREEN *CYANRED *WHIBLAC OS 1.20 > Figure 16.2 *HELP COLOURS with trace active. ----------- -------------------------------- The trace in figure 16.2 shows that the Y register points to the first character of the argument, as long as the argument is not enclosed in quotation marks. In spite of this, the example program still uses Gsinit to initialise the argument to allow the program to respond to *HELP "COLOURS" as well as to *HELP COLOURS shown in figure 16.2. The program HELP uses the multiple command interpreter first introduced in Module 15. I will not explain again how it works but there is one important feature worth looking at, namely the command table starting in line 1320. It is quite clear that the new commands are included in the table with the longest commands at the head and the shortest commands at the foot of the table. This order must be maintained if you add new commands to the table. The text of the two possible responses to the *HELP command have to be included in the program. The text of the response to *HELP is labeled ".helpmsg" and starts in line 1820. The extended help message starts at the label ".helpinfo" in line 1910. The label ".helptitle" (line 1870) marks the start of the argument used for extended help. The content of the simple help text starting at ".helpmsg" is reproduced in figure 16.3. The structure of this text is important to the proper working of the help interpreter. The string starting at the label ".helptitle" is terminated with &FF. This argument termination byte must be included to mark the end of the argument used to request extended help. Any character with the most significant bit set is ignored by the print subroutine (lines 2250-2350). The extended help argument string is compared with any argument typed after *HELP to see if extended help is required. The zero byte at the end of the simple help text is used to indicate the end of text to the print subroutine. .helpmsg EQUB &0D \ carriage return EQUS "COLOURED TEXT" \ rom contents EQUB &0D \ carriage return EQUS " " \ two spaces .helptitle EQUS "COLOURS" \ expected extended help argument EQUS &FF \ argument termination byte EQUW &0D \ carriage return BRK \ end of message Figure 16.3 The text of the simple help message. ----------- ------------------------------------ The text starting at label ".helpinfo" in line 1910 is printed when extended help is requested. This text can be up to 255 bytes long and must end with a zero byte. Any byte with the most significant bit set is not printed. It is usual to include the syntax of the commands implemented in the rom in the extended help, but you are free to write whatever you like. The example program prints the syntax of sixteen new commands which can be used to change actual colour of the default text colour in modes 0-6. The default text colour is white in all modes but you can change it to red with *RED or flashing red-cyan with *REDCYAN. The program uses the machine code equivalent of the VDU19 command to achieve this effect. The order of the commands in the extended help message does not have to be the same as the order in the command table. In the example program the order reflects the logical order of the sixteen available colours. The interpreter in the program HELP pushes the registers and two zero page bytes on the stack (lines 320-400), intercepts service call 9 (line 430) and initialises the *HELP argument (lines 450-460). The X register is reset to zero (line 470) ready to be used as an index on the expected extended help argument. The first byte of the argument is read (line 480) and, if an argument is present, a branch is made to the label ".tryextended" (line 490 and line 570). If an argument is not found the simple help message is printed (lines 500-520) and the registers and zero page bytes are restored before returning control to the MOS (line 530 and lines 1060-1160). The extended help interpreter (lines 540-700) compares every byte of the typed argument with every byte of the expected argument (lines 540-640) and if a match is found, or a suitable shortened argument is typed, the extended help message is printed (lines 670-690) before returning control to the MOS with the registers and zero page bytes restored (line 700 and lines 1060-1160). 10 REM: HELP 20 MODE7 30 HIMEM=&3C00 40 DIM save 50 50 diff=&8000-HIMEM 60 address=&70 70 comvec=&F2 80 errstack=&100 90 stack=&105 100 gsinit=&FFC2 110 gsread=&FFC5 120 osasci=&FFE3 130 osword=&FFF1 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("COLOURED TEXT") 270 .copyright 280 BRK 290 OPT FNequs("(C) Gordon Horsington 1987") 300 BRK 310 .service 320 PHA 330 TXA 340 PHA 350 TYA 360 PHA 370 LDA address 380 PHA 390 LDA address+1 400 PHA 410 TSX 420 LDA stack,X 430 CMP #9 440 BNE tryfour 450 SEC 460 JSR gsinit 470 LDX #0 480 JSR gsread 490 BCC tryextended 500 LDX #(helpmsg+diff) MOD 256 510 LDY #(helpmsg+diff) DIV 256 520 JSR printer+diff 530 BEQ quit 540 .helploop 550 INX 560 JSR gsread 570 .tryextended 580 CMP #ASC(".") 590 BEQ okextended 600 AND #&DF 610 CMP helptitle+diff,X 620 BEQ helploop 630 LDA #&FF 640 CMP helptitle+diff,X 650 BNE quit 660 .okextended 670 LDX #(helpinfo+diff) MOD 256 680 LDY #(helpinfo+diff) DIV 256 690 JSR printer+diff 700 BEQ quit 710 .tryfour 720 CMP #4 730 BNE quit 740 LDX #&FE 750 TYA 760 PHA 770 .firstchar 780 INX 790 PLA 800 TAY 810 PHA 820 LDA (comvec),Y 830 AND #&DF 840 CMP #ASC("X") 850 BNE interpret 860 INY 870 .interpret 880 INX 890 LDA commtable+diff,X 900 BMI found 910 LDA (comvec),Y 920 INY 930 CMP #ASC(".") 940 BEQ founddot 950 AND #&DF 960 CMP commtable+diff,X 970 BEQ interpret 980 .another 990 INX 1000 LDA commtable+diff,X 1010 BPL another 1020 CMP #&FF 1030 BNE firstchar 1040 .exit 1050 PLA 1060 .quit 1070 PLA 1080 STA address+1 1090 PLA 1100 STA address 1110 PLA 1120 TAY 1130 PLA 1140 TAX 1150 PLA 1160 RTS 1170 .founddot 1180 INX 1190 LDA commtable+diff,X 1200 BPL founddot 1210 .found 1220 CMP #&FF 1230 BEQ exit 1240 STA address+1 1250 INX 1260 LDA commtable+diff,X 1270 STA address 1280 PLA 1290 SEC 1300 JSR gsinit 1310 JMP (address) 1320 .commtable 1330 OPT FNequs("BLAWHIT") 1340 OPT FNequb((blawhit+diff) DIV 256) 1350 OPT FNequb((blawhit+diff) MOD 256) 1360 OPT FNequs("REDCYAN") 1370 OPT FNequb((redcyan+diff) DIV 256) 1380 OPT FNequb((redcyan+diff) MOD 256) 1390 OPT FNequs("GREEMAG") 1400 OPT FNequb((greemag+diff) DIV 256) 1410 OPT FNequb((greemag+diff) MOD 256) 1420 OPT FNequs("YELLBLU") 1430 OPT FNequb((yellblu+diff) DIV 256) 1440 OPT FNequb((yellblu+diff) MOD 256) 1450 OPT FNequs("BLUYELL") 1460 OPT FNequb((bluyell+diff) DIV 256) 1470 OPT FNequb((bluyell+diff) MOD 256) 1480 OPT FNequs("MAGREEN") 1490 OPT FNequb((magreen+diff) DIV 256) 1500 OPT FNequb((magreen+diff) MOD 256) 1510 OPT FNequs("CYANRED") 1520 OPT FNequb((cyanred+diff) DIV 256) 1530 OPT FNequb((cyanred+diff) MOD 256) 1540 OPT FNequs("WHIBLAC") 1550 OPT FNequb((whiblac+diff) DIV 256) 1560 OPT FNequb((whiblac+diff) MOD 256) 1570 OPT FNequs("MAGENTA") 1580 OPT FNequb((magenta+diff) DIV 256) 1590 OPT FNequb((magenta+diff) MOD 256) 1600 OPT FNequs("YELLOW") 1610 OPT FNequb((yellow+diff) DIV 256) 1620 OPT FNequb((yellow+diff) MOD 256) 1630 OPT FNequs("WHITE") 1640 OPT FNequb((white+diff) DIV 256) 1650 OPT FNequb((white+diff) MOD 256) 1660 OPT FNequs("GREEN") 1670 OPT FNequb((green+diff) DIV 256) 1680 OPT FNequb((green+diff) MOD 256) 1690 OPT FNequs("BLACK") 1700 OPT FNequb((black+diff) DIV 256) 1710 OPT FNequb((black+diff) MOD 256) 1720 OPT FNequs("CYAN") 1730 OPT FNequb((cyan+diff) DIV 256) 1740 OPT FNequb((cyan+diff) MOD 256) 1750 OPT FNequs("BLUE") 1760 OPT FNequb((blue+diff) DIV 256) 1770 OPT FNequb((blue+diff) MOD 256) 1780 OPT FNequs("RED") 1790 OPT FNequb((red+diff) DIV 256) 1800 OPT FNequb((red+diff) MOD 256) 1810 OPT FNequb(&FF) 1820 .helpmsg 1830 OPT FNequb(&0D) 1840 OPT FNequs("COLOURED TEXT") 1850 OPT FNequb(&0D) 1860 OPT FNequw(&2020) 1870 .helptitle 1880 OPT FNequs("COLOURS") 1890 OPT FNequw(&0DFF) 1900 BRK 1910 .helpinfo 1920 OPT FNequw(&200D) 1930 OPT FNequs("*BLACK") 1940 OPT FNequw(&200D) 1950 OPT FNequs("*RED") 1960 OPT FNequw(&200D) 1970 OPT FNequs("*GREEN") 1980 OPT FNequw(&200D) 1990 OPT FNequs("*YELLOW") 2000 OPT FNequw(&200D) 2010 OPT FNequs("*BLUE") 2020 OPT FNequw(&200D) 2030 OPT FNequs("*MAGENTA") 2040 OPT FNequw(&200D) 2050 OPT FNequs("*CYAN") 2060 OPT FNequw(&200D) 2070 OPT FNequs("*WHITE") 2080 OPT FNequw(&200D) 2090 OPT FNequs("*BLAWHIT") 2100 OPT FNequw(&200D) 2110 OPT FNequs("*REDCYAN") 2120 OPT FNequw(&200D) 2130 OPT FNequs("*GREEMAG") 2140 OPT FNequw(&200D) 2150 OPT FNequs("*YELLBLU") 2160 OPT FNequw(&200D) 2170 OPT FNequs("*BLUYELL") 2180 OPT FNequw(&200D) 2190 OPT FNequs("*MAGREEN") 2200 OPT FNequw(&200D) 2210 OPT FNequs("*CYANRED") 2220 OPT FNequw(&200D) 2230 OPT FNequs("*WHIBLAC") 2240 OPT FNequw(&000D) 2250 .printer 2260 STX address 2270 STY address+1 2280 LDY #&FF 2290 .printloop 2300 INY 2310 LDA (address),Y 2320 BEQ endprint 2330 BMI printloop 2340 JSR osasci 2350 JMP printloop+diff 2360 .endprint 2370 RTS 2380 .black 2390 LDA #0 2400 BEQ mode 2410 .red 2420 LDA #1 2430 BNE mode 2440 .green 2450 LDA #2 2460 BNE mode 2470 .yellow 2480 LDA #3 2490 BNE mode 2500 .blue 2510 LDA #4 2520 BNE mode 2530 .magenta 2540 LDA #5 2550 BNE mode 2560 .cyan 2570 LDA #6 2580 BNE mode 2590 .white 2600 LDA #7 2610 BNE mode 2620 .blawhit 2630 LDA #8 2640 BNE mode 2650 .redcyan 2660 LDA #9 2670 BNE mode 2680 .greemag 2690 LDA #10 2700 BNE mode 2710 .yellblu 2720 LDA #11 2730 BNE mode 2740 .bluyell 2750 LDA #12 2760 BNE mode 2770 .magreen 2780 LDA #13 2790 BNE mode 2800 .cyanred 2810 LDA #14 2820 BNE mode 2830 .whiblac 2840 LDA #15 2850 .mode 2860 PHA 2870 LDA #&87 2880 JSR osbyte \ Check screen mode 2890 CPY #7 2900 BNE mode0to6 2910 PLA 2920 LDA #(wrongmode+diff) MOD 256 2930 STA address 2940 LDA #(wrongmode+diff) DIV 256 2950 STA address+1 2960 LDY #&FF 2970 .errorloop 2980 INY 2990 LDA (address),Y 3000 STA errstack,Y 3010 BPL errorloop 3020 PLA 3030 STA address+1 3040 PLA 3050 STA address 3060 JMP errstack 3070 .mode0to6 3080 LDA colours+diff,Y 3090 PHA 3100 LDA #19 3110 JSR osasci 3120 PLA 3130 JSR osasci 3140 PLA 3150 JSR osasci 3160 LDA #0 3170 JSR osasci 3180 JSR osasci 3190 JSR osasci 3200 .pullout 3210 PLA 3220 STA address+1 3230 PLA 3240 STA address 3250 PLA 3260 PLA 3270 PLA 3280 LDA #0 3290 RTS 3300 .colours 3310 OPT FNequd(&01070301) 3320 OPT FNequw(&0301) 3330 OPT FNequb(&01) 3340 .wrongmode 3350 BRK 3360 BRK 3370 OPT FNequs("Modes 0-6 only") 3380 BRK 3390 OPT FNequb(&FF) 3400 .lastbyte 3410 ] 3420 NEXT 3430 INPUT'"Save filename = "filename$ 3440 IF filename$="" END 3450 $save="SAVE "+filename$+" "+STR$~(HIMEM)+" "+STR$~(las tbyte)+" FFFF8000 FFFF8000" 3460 X%=save MOD 256 3470 Y%=save DIV 256 3480 *OPT1,2 3490 CALL oscli 3500 *OPT1,0 3510 END 3520 DEFFNequb(byte) 3530 ?P%=byte 3540 P%=P%+1 3550 =pass 3560 DEFFNequw(word) 3570 ?P%=word MOD 256 3580 P%?1=word DIV 256 3590 P%=P%+2 3600 =pass 3610 DEFFNequd(double) 3620 !P%=double 3630 P%=P%+4 3640 =pass 3650 DEFFNequs(string$) 3660 $P%=string$ 3670 P%=P%+LEN(string$) 3680 =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 31 36 20 2d 20 2a 48 45 4c 50 |odule 16 - *HELP| 00000030 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |.---------------| 00000040 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000060 2d 0d 0d 0d 20 20 57 68 65 6e 20 79 6f 75 20 74 |-... When you t| 00000070 79 70 65 20 2a 48 45 4c 50 20 74 68 65 20 4d 4f |ype *HELP the MO| 00000080 53 20 72 65 73 70 6f 6e 64 73 20 62 79 20 69 73 |S responds by is| 00000090 73 75 69 6e 67 20 73 65 72 76 69 63 65 20 63 61 |suing service ca| 000000a0 6c 6c 20 39 20 74 6f 0d 61 6c 6c 20 74 68 65 20 |ll 9 to.all the | 000000b0 61 63 74 69 76 65 20 72 6f 6d 73 2e 20 41 6c 6c |active roms. All| 000000c0 20 72 6f 6d 73 2c 20 65 78 63 65 70 74 20 42 41 | roms, except BA| 000000d0 53 49 43 2c 20 68 61 76 65 20 74 68 65 20 6f 70 |SIC, have the op| 000000e0 70 6f 72 74 75 6e 69 74 79 20 74 6f 0d 72 65 73 |portunity to.res| 000000f0 70 6f 6e 64 20 74 6f 20 73 65 72 76 69 63 65 20 |pond to service | 00000100 63 61 6c 6c 20 39 2c 20 74 68 65 20 2a 48 45 4c |call 9, the *HEL| 00000110 50 20 73 65 72 76 69 63 65 20 63 61 6c 6c 2e 20 |P service call. | 00000120 54 68 65 20 77 61 79 20 69 6e 20 77 68 69 63 68 |The way in which| 00000130 20 61 0d 72 6f 6d 20 72 65 73 70 6f 6e 64 73 20 | a.rom responds | 00000140 74 6f 20 74 68 69 73 20 63 61 6c 6c 20 75 73 75 |to this call usu| 00000150 61 6c 6c 79 20 64 65 70 65 6e 64 73 20 6f 6e 20 |ally depends on | 00000160 77 68 65 74 68 65 72 20 69 74 20 69 73 20 61 20 |whether it is a | 00000170 6c 61 6e 67 75 61 67 65 0d 6f 72 20 61 20 73 65 |language.or a se| 00000180 72 76 69 63 65 20 72 6f 6d 2e 20 54 68 65 72 65 |rvice rom. There| 00000190 20 61 72 65 20 6e 6f 20 68 61 72 64 20 61 6e 64 | are no hard and| 000001a0 20 66 61 73 74 20 72 75 6c 65 73 20 61 62 6f 75 | fast rules abou| 000001b0 74 20 68 6f 77 20 61 6e 0d 69 6e 64 69 76 69 64 |t how an.individ| 000001c0 75 61 6c 20 72 6f 6d 20 73 68 6f 75 6c 64 20 72 |ual rom should r| 000001d0 65 73 70 6f 6e 64 20 74 6f 20 61 20 68 65 6c 70 |espond to a help| 000001e0 20 72 65 71 75 65 73 74 20 62 75 74 20 6c 61 6e | request but lan| 000001f0 67 75 61 67 65 20 72 6f 6d 73 0d 75 73 75 61 6c |guage roms.usual| 00000200 6c 79 20 70 72 69 6e 74 20 74 68 65 20 74 69 74 |ly print the tit| 00000210 6c 65 20 73 74 72 69 6e 67 20 66 72 6f 6d 20 74 |le string from t| 00000220 68 65 20 72 6f 6d 20 68 65 61 64 65 72 20 61 6e |he rom header an| 00000230 64 20 73 65 72 76 69 63 65 20 72 6f 6d 73 0d 70 |d service roms.p| 00000240 72 69 6e 74 20 61 6e 20 69 64 65 6e 74 69 66 69 |rint an identifi| 00000250 63 61 74 69 6f 6e 20 73 74 72 69 6e 67 20 66 6f |cation string fo| 00000260 6c 6c 6f 77 65 64 20 62 79 20 74 68 65 20 61 72 |llowed by the ar| 00000270 67 75 6d 65 6e 74 20 74 6f 20 62 65 20 75 73 65 |gument to be use| 00000280 64 20 74 6f 0d 67 65 74 20 65 78 74 65 6e 64 65 |d to.get extende| 00000290 64 20 68 65 6c 70 2e 0d 0d 20 20 54 68 65 20 72 |d help... The r| 000002a0 65 73 70 6f 6e 73 65 20 72 65 71 75 69 72 65 64 |esponse required| 000002b0 20 66 72 6f 6d 20 61 20 6c 61 6e 67 75 61 67 65 | from a language| 000002c0 20 72 6f 6d 20 77 69 6c 6c 20 62 65 20 63 6f 76 | rom will be cov| 000002d0 65 72 65 64 20 69 6e 20 74 68 65 0d 6e 65 78 74 |ered in the.next| 000002e0 20 6d 6f 64 75 6c 65 20 6f 66 20 74 68 65 20 63 | module of the c| 000002f0 6f 75 72 73 65 2e 20 54 68 65 20 69 6e 74 65 72 |ourse. The inter| 00000300 70 72 65 74 65 72 20 73 69 6d 70 6c 79 20 6e 65 |preter simply ne| 00000310 65 64 73 20 74 6f 20 69 6e 74 65 72 63 65 70 74 |eds to intercept| 00000320 0d 73 65 72 76 69 63 65 20 63 61 6c 6c 20 39 2c |.service call 9,| 00000330 20 6d 61 6b 65 20 73 75 72 65 20 74 68 61 74 20 | make sure that | 00000340 6e 6f 20 61 72 67 75 6d 65 6e 74 20 68 61 73 20 |no argument has | 00000350 62 65 65 6e 20 74 79 70 65 64 2c 20 61 6e 64 20 |been typed, and | 00000360 74 68 65 6e 0d 70 72 69 6e 74 20 65 76 65 72 79 |then.print every| 00000370 20 62 79 74 65 20 6f 66 20 74 68 65 20 74 69 74 | byte of the tit| 00000380 6c 65 20 73 74 72 69 6e 67 2e 20 54 68 69 73 20 |le string. This | 00000390 77 69 6c 6c 20 62 65 20 64 65 6d 6f 6e 73 74 72 |will be demonstr| 000003a0 61 74 65 64 20 62 79 20 74 68 65 0d 65 78 61 6d |ated by the.exam| 000003b0 70 6c 65 20 70 72 6f 67 72 61 6d 20 69 6e 20 4d |ple program in M| 000003c0 6f 64 75 6c 65 20 31 37 2e 0d 0d 20 20 54 68 65 |odule 17... The| 000003d0 20 72 65 73 70 6f 6e 73 65 20 72 65 71 75 69 72 | response requir| 000003e0 65 64 20 66 72 6f 6d 20 61 20 73 65 72 76 69 63 |ed from a servic| 000003f0 65 20 72 6f 6d 20 69 73 20 6d 6f 72 65 20 65 6c |e rom is more el| 00000400 61 62 6f 72 61 74 65 20 74 68 61 6e 20 74 68 61 |aborate than tha| 00000410 74 0d 70 72 6f 76 69 64 65 64 20 62 79 20 61 20 |t.provided by a | 00000420 6c 61 6e 67 75 61 67 65 20 72 6f 6d 2e 20 49 74 |language rom. It| 00000430 20 69 73 20 69 6c 6c 75 73 74 72 61 74 65 64 20 | is illustrated | 00000440 69 6e 20 66 69 67 75 72 65 73 20 31 36 2e 31 20 |in figures 16.1 | 00000450 61 6e 64 20 31 36 2e 32 0d 69 6e 20 77 68 69 63 |and 16.2.in whic| 00000460 68 20 74 68 65 20 68 65 6c 70 20 73 65 72 76 69 |h the help servi| 00000470 63 65 20 70 72 6f 76 69 64 65 64 20 62 79 20 74 |ce provided by t| 00000480 68 65 20 65 78 61 6d 70 6c 65 20 70 72 6f 67 72 |he example progr| 00000490 61 6d 20 48 45 4c 50 20 69 73 0d 73 68 6f 77 6e |am HELP is.shown| 000004a0 20 77 69 74 68 20 74 68 65 20 73 65 72 76 69 63 | with the servic| 000004b0 65 20 63 61 6c 6c 20 74 72 61 63 65 20 61 63 74 |e call trace act| 000004c0 69 76 65 20 69 6e 20 61 20 68 69 67 68 65 72 20 |ive in a higher | 000004d0 70 72 69 6f 72 69 74 79 20 72 6f 6d 2e 0d 0d 0d |priority rom....| 000004e0 0d 0d 3e 2a 48 45 4c 50 0d 0d 36 35 30 32 20 54 |..>*HELP..6502 T| 000004f0 55 42 45 20 31 2e 31 30 0d 20 41 3d 30 39 20 58 |UBE 1.10. A=09 X| 00000500 3d 30 46 20 59 3d 30 35 20 48 65 6c 70 0d 0d 43 |=0F Y=05 Help..C| 00000510 4f 4c 4f 55 52 45 44 20 54 45 58 54 0d 20 20 43 |OLOURED TEXT. C| 00000520 4f 4c 4f 55 52 53 0d 0d 4f 53 20 31 2e 32 30 0d |OLOURS..OS 1.20.| 00000530 3e 0d 0d 46 69 67 75 72 65 20 31 36 2e 31 20 20 |>..Figure 16.1 | 00000540 53 69 6d 70 6c 65 20 2a 48 45 4c 50 20 77 69 74 |Simple *HELP wit| 00000550 68 20 74 72 61 63 65 20 61 63 74 69 76 65 2e 0d |h trace active..| 00000560 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 20 2d 2d 2d |----------- ---| 00000570 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00000580 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0d 0d 0d |------------....| 00000590 0d 20 20 57 68 65 6e 20 79 6f 75 20 74 79 70 65 |. When you type| 000005a0 20 2a 48 45 4c 50 20 65 61 63 68 20 61 63 74 69 | *HELP each acti| 000005b0 76 65 20 72 6f 6d 20 69 73 20 65 6e 74 65 72 65 |ve rom is entere| 000005c0 64 20 77 69 74 68 20 41 3d 39 2c 20 58 3d 74 68 |d with A=9, X=th| 000005d0 65 20 72 6f 6d 0d 6e 75 6d 62 65 72 2c 20 61 6e |e rom.number, an| 000005e0 64 20 59 3d 74 68 65 20 6f 66 66 73 65 74 20 74 |d Y=the offset t| 000005f0 6f 20 74 68 65 20 66 69 72 73 74 20 6e 6f 6e 2d |o the first non-| 00000600 73 70 61 63 65 20 63 68 61 72 61 63 74 65 72 20 |space character | 00000610 61 66 74 65 72 20 74 68 65 0d 2a 48 45 4c 50 20 |after the.*HELP | 00000620 63 6f 6d 6d 61 6e 64 2e 20 54 68 69 73 20 69 6e |command. This in| 00000630 64 69 63 61 74 65 73 20 74 68 61 74 20 61 6e 79 |dicates that any| 00000640 20 61 72 67 75 6d 65 6e 74 20 74 79 70 65 64 20 | argument typed | 00000650 61 66 74 65 72 20 74 68 65 20 2a 48 45 4c 50 0d |after the *HELP.| 00000660 63 6f 6d 6d 61 6e 64 20 69 73 20 6e 6f 74 20 69 |command is not i| 00000670 6e 69 74 69 61 6c 69 73 65 64 20 71 75 69 74 65 |nitialised quite| 00000680 20 61 73 20 79 6f 75 20 77 6f 75 6c 64 20 65 78 | as you would ex| 00000690 70 65 63 74 20 69 74 20 74 6f 20 62 65 20 62 79 |pect it to be by| 000006a0 20 74 68 65 0d 47 73 69 6e 69 74 20 4d 4f 53 20 | the.Gsinit MOS | 000006b0 73 75 62 72 6f 75 74 69 6e 65 2e 20 49 66 20 79 |subroutine. If y| 000006c0 6f 75 20 69 6e 74 65 6e 64 20 74 6f 20 77 72 69 |ou intend to wri| 000006d0 74 65 20 61 6e 20 65 78 74 65 6e 64 65 64 20 68 |te an extended h| 000006e0 65 6c 70 20 73 65 72 76 69 63 65 0d 69 6e 20 77 |elp service.in w| 000006f0 68 69 63 68 20 74 68 65 20 61 72 67 75 6d 65 6e |hich the argumen| 00000700 74 20 63 61 6e 20 62 65 20 65 6e 63 6c 6f 73 65 |t can be enclose| 00000710 64 20 69 6e 20 71 75 6f 74 61 74 69 6f 6e 20 6d |d in quotation m| 00000720 61 72 6b 73 2c 20 74 68 65 20 61 72 67 75 6d 65 |arks, the argume| 00000730 6e 74 0d 77 69 6c 6c 20 66 69 72 73 74 20 6e 65 |nt.will first ne| 00000740 65 64 20 74 6f 20 62 65 20 69 6e 69 74 69 61 6c |ed to be initial| 00000750 69 73 65 64 20 77 69 74 68 20 47 73 69 6e 69 74 |ised with Gsinit| 00000760 2e 20 49 66 20 79 6f 75 20 64 6f 6e 27 74 20 66 |. If you don't f| 00000770 65 65 6c 20 69 74 20 69 73 0d 6e 65 63 65 73 73 |eel it is.necess| 00000780 61 72 79 20 74 6f 20 69 6e 63 6c 75 64 65 20 74 |ary to include t| 00000790 68 69 73 20 65 78 74 72 61 20 72 65 66 69 6e 65 |his extra refine| 000007a0 6d 65 6e 74 20 74 68 65 6e 20 74 68 65 72 65 20 |ment then there | 000007b0 69 73 20 6e 6f 20 6e 65 65 64 20 74 6f 0d 69 6e |is no need to.in| 000007c0 69 74 69 61 6c 69 73 65 20 74 68 65 20 61 72 67 |itialise the arg| 000007d0 75 6d 65 6e 74 2e 0d 0d 0d 0d 0d 0d 3e 2a 48 45 |ument.......>*HE| 000007e0 4c 50 20 43 4f 4c 4f 55 52 53 0d 0d 36 35 30 32 |LP COLOURS..6502| 000007f0 20 54 55 42 45 20 31 2e 31 30 0d 20 41 3d 30 39 | TUBE 1.10. A=09| 00000800 20 58 3d 30 46 20 59 3d 30 36 20 48 65 6c 70 0d | X=0F Y=06 Help.| 00000810 0d 20 2a 42 4c 41 43 4b 0d 20 2a 52 45 44 0d 20 |. *BLACK. *RED. | 00000820 2a 47 52 45 45 4e 0d 20 2a 59 45 4c 4c 4f 57 0d |*GREEN. *YELLOW.| 00000830 20 2a 42 4c 55 45 0d 20 2a 4d 41 47 45 4e 54 41 | *BLUE. *MAGENTA| 00000840 0d 20 2a 43 59 41 4e 0d 20 2a 57 48 49 54 45 0d |. *CYAN. *WHITE.| 00000850 20 2a 42 4c 41 57 48 49 54 0d 20 2a 52 45 44 43 | *BLAWHIT. *REDC| 00000860 59 41 4e 0d 20 2a 47 52 45 45 4d 41 47 0d 20 2a |YAN. *GREEMAG. *| 00000870 59 45 4c 4c 42 4c 55 0d 20 2a 42 4c 55 59 45 4c |YELLBLU. *BLUYEL| 00000880 4c 0d 20 2a 4d 41 47 52 45 45 4e 0d 20 2a 43 59 |L. *MAGREEN. *CY| 00000890 41 4e 52 45 44 0d 20 2a 57 48 49 42 4c 41 43 0d |ANRED. *WHIBLAC.| 000008a0 0d 4f 53 20 31 2e 32 30 0d 3e 0d 0d 46 69 67 75 |.OS 1.20.>..Figu| 000008b0 72 65 20 31 36 2e 32 20 20 2a 48 45 4c 50 20 43 |re 16.2 *HELP C| 000008c0 4f 4c 4f 55 52 53 20 77 69 74 68 20 74 72 61 63 |OLOURS with trac| 000008d0 65 20 61 63 74 69 76 65 2e 0d 2d 2d 2d 2d 2d 2d |e active..------| 000008e0 2d 2d 2d 2d 2d 20 20 2d 2d 2d 2d 2d 2d 2d 2d 2d |----- ---------| 000008f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00000900 2d 2d 2d 2d 2d 2d 2d 0d 0d 0d 0d 0d 20 20 54 68 |-------..... Th| 00000910 65 20 74 72 61 63 65 20 69 6e 20 66 69 67 75 72 |e trace in figur| 00000920 65 20 31 36 2e 32 20 73 68 6f 77 73 20 74 68 61 |e 16.2 shows tha| 00000930 74 20 74 68 65 20 59 20 72 65 67 69 73 74 65 72 |t the Y register| 00000940 20 70 6f 69 6e 74 73 20 74 6f 20 74 68 65 0d 66 | points to the.f| 00000950 69 72 73 74 20 63 68 61 72 61 63 74 65 72 20 6f |irst character o| 00000960 66 20 74 68 65 20 61 72 67 75 6d 65 6e 74 2c 20 |f the argument, | 00000970 61 73 20 6c 6f 6e 67 20 61 73 20 74 68 65 20 61 |as long as the a| 00000980 72 67 75 6d 65 6e 74 20 69 73 20 6e 6f 74 0d 65 |rgument is not.e| 00000990 6e 63 6c 6f 73 65 64 20 69 6e 20 71 75 6f 74 61 |nclosed in quota| 000009a0 74 69 6f 6e 20 6d 61 72 6b 73 2e 20 49 6e 20 73 |tion marks. In s| 000009b0 70 69 74 65 20 6f 66 20 74 68 69 73 2c 20 74 68 |pite of this, th| 000009c0 65 20 65 78 61 6d 70 6c 65 20 70 72 6f 67 72 61 |e example progra| 000009d0 6d 0d 73 74 69 6c 6c 20 75 73 65 73 20 47 73 69 |m.still uses Gsi| 000009e0 6e 69 74 20 74 6f 20 69 6e 69 74 69 61 6c 69 73 |nit to initialis| 000009f0 65 20 74 68 65 20 61 72 67 75 6d 65 6e 74 20 74 |e the argument t| 00000a00 6f 20 61 6c 6c 6f 77 20 74 68 65 20 70 72 6f 67 |o allow the prog| 00000a10 72 61 6d 20 74 6f 0d 72 65 73 70 6f 6e 64 20 74 |ram to.respond t| 00000a20 6f 20 2a 48 45 4c 50 20 22 43 4f 4c 4f 55 52 53 |o *HELP "COLOURS| 00000a30 22 20 61 73 20 77 65 6c 6c 20 61 73 20 74 6f 20 |" as well as to | 00000a40 2a 48 45 4c 50 20 43 4f 4c 4f 55 52 53 20 73 68 |*HELP COLOURS sh| 00000a50 6f 77 6e 20 69 6e 20 66 69 67 75 72 65 0d 31 36 |own in figure.16| 00000a60 2e 32 2e 0d 0d 20 20 54 68 65 20 70 72 6f 67 72 |.2... The progr| 00000a70 61 6d 20 48 45 4c 50 20 75 73 65 73 20 74 68 65 |am HELP uses the| 00000a80 20 6d 75 6c 74 69 70 6c 65 20 63 6f 6d 6d 61 6e | multiple comman| 00000a90 64 20 69 6e 74 65 72 70 72 65 74 65 72 20 66 69 |d interpreter fi| 00000aa0 72 73 74 0d 69 6e 74 72 6f 64 75 63 65 64 20 69 |rst.introduced i| 00000ab0 6e 20 4d 6f 64 75 6c 65 20 31 35 2e 20 49 20 77 |n Module 15. I w| 00000ac0 69 6c 6c 20 6e 6f 74 20 65 78 70 6c 61 69 6e 20 |ill not explain | 00000ad0 61 67 61 69 6e 20 68 6f 77 20 69 74 20 77 6f 72 |again how it wor| 00000ae0 6b 73 20 62 75 74 0d 74 68 65 72 65 20 69 73 20 |ks but.there is | 00000af0 6f 6e 65 20 69 6d 70 6f 72 74 61 6e 74 20 66 65 |one important fe| 00000b00 61 74 75 72 65 20 77 6f 72 74 68 20 6c 6f 6f 6b |ature worth look| 00000b10 69 6e 67 20 61 74 2c 20 6e 61 6d 65 6c 79 20 74 |ing at, namely t| 00000b20 68 65 20 63 6f 6d 6d 61 6e 64 0d 74 61 62 6c 65 |he command.table| 00000b30 20 73 74 61 72 74 69 6e 67 20 69 6e 20 6c 69 6e | starting in lin| 00000b40 65 20 31 33 32 30 2e 20 49 74 20 69 73 20 71 75 |e 1320. It is qu| 00000b50 69 74 65 20 63 6c 65 61 72 20 74 68 61 74 20 74 |ite clear that t| 00000b60 68 65 20 6e 65 77 20 63 6f 6d 6d 61 6e 64 73 0d |he new commands.| 00000b70 61 72 65 20 69 6e 63 6c 75 64 65 64 20 69 6e 20 |are included in | 00000b80 74 68 65 20 74 61 62 6c 65 20 77 69 74 68 20 74 |the table with t| 00000b90 68 65 20 6c 6f 6e 67 65 73 74 20 63 6f 6d 6d 61 |he longest comma| 00000ba0 6e 64 73 20 61 74 20 74 68 65 20 68 65 61 64 20 |nds at the head | 00000bb0 61 6e 64 0d 74 68 65 20 73 68 6f 72 74 65 73 74 |and.the shortest| 00000bc0 20 63 6f 6d 6d 61 6e 64 73 20 61 74 20 74 68 65 | commands at the| 00000bd0 20 66 6f 6f 74 20 6f 66 20 74 68 65 20 74 61 62 | foot of the tab| 00000be0 6c 65 2e 20 54 68 69 73 20 6f 72 64 65 72 20 6d |le. This order m| 00000bf0 75 73 74 20 62 65 0d 6d 61 69 6e 74 61 69 6e 65 |ust be.maintaine| 00000c00 64 20 69 66 20 79 6f 75 20 61 64 64 20 6e 65 77 |d if you add new| 00000c10 20 63 6f 6d 6d 61 6e 64 73 20 74 6f 20 74 68 65 | commands to the| 00000c20 20 74 61 62 6c 65 2e 0d 0d 20 20 54 68 65 20 74 | table... The t| 00000c30 65 78 74 20 6f 66 20 74 68 65 20 74 77 6f 20 70 |ext of the two p| 00000c40 6f 73 73 69 62 6c 65 20 72 65 73 70 6f 6e 73 65 |ossible response| 00000c50 73 20 74 6f 20 74 68 65 20 2a 48 45 4c 50 20 63 |s to the *HELP c| 00000c60 6f 6d 6d 61 6e 64 20 68 61 76 65 20 74 6f 0d 62 |ommand have to.b| 00000c70 65 20 69 6e 63 6c 75 64 65 64 20 69 6e 20 74 68 |e included in th| 00000c80 65 20 70 72 6f 67 72 61 6d 2e 20 54 68 65 20 74 |e program. The t| 00000c90 65 78 74 20 6f 66 20 74 68 65 20 72 65 73 70 6f |ext of the respo| 00000ca0 6e 73 65 20 74 6f 20 2a 48 45 4c 50 20 69 73 0d |nse to *HELP is.| 00000cb0 6c 61 62 65 6c 65 64 20 22 2e 68 65 6c 70 6d 73 |labeled ".helpms| 00000cc0 67 22 20 61 6e 64 20 73 74 61 72 74 73 20 69 6e |g" and starts in| 00000cd0 20 6c 69 6e 65 20 31 38 32 30 2e 20 54 68 65 20 | line 1820. The | 00000ce0 65 78 74 65 6e 64 65 64 20 68 65 6c 70 20 6d 65 |extended help me| 00000cf0 73 73 61 67 65 0d 73 74 61 72 74 73 20 61 74 20 |ssage.starts at | 00000d00 74 68 65 20 6c 61 62 65 6c 20 22 2e 68 65 6c 70 |the label ".help| 00000d10 69 6e 66 6f 22 20 69 6e 20 6c 69 6e 65 20 31 39 |info" in line 19| 00000d20 31 30 2e 20 54 68 65 20 6c 61 62 65 6c 20 22 2e |10. The label ".| 00000d30 68 65 6c 70 74 69 74 6c 65 22 0d 28 6c 69 6e 65 |helptitle".(line| 00000d40 20 31 38 37 30 29 20 6d 61 72 6b 73 20 74 68 65 | 1870) marks the| 00000d50 20 73 74 61 72 74 20 6f 66 20 74 68 65 20 61 72 | start of the ar| 00000d60 67 75 6d 65 6e 74 20 75 73 65 64 20 66 6f 72 20 |gument used for | 00000d70 65 78 74 65 6e 64 65 64 20 68 65 6c 70 2e 0d 0d |extended help...| 00000d80 20 20 54 68 65 20 63 6f 6e 74 65 6e 74 20 6f 66 | The content of| 00000d90 20 74 68 65 20 73 69 6d 70 6c 65 20 68 65 6c 70 | the simple help| 00000da0 20 74 65 78 74 20 73 74 61 72 74 69 6e 67 20 61 | text starting a| 00000db0 74 20 22 2e 68 65 6c 70 6d 73 67 22 20 69 73 0d |t ".helpmsg" is.| 00000dc0 72 65 70 72 6f 64 75 63 65 64 20 69 6e 20 66 69 |reproduced in fi| 00000dd0 67 75 72 65 20 31 36 2e 33 2e 20 54 68 65 20 73 |gure 16.3. The s| 00000de0 74 72 75 63 74 75 72 65 20 6f 66 20 74 68 69 73 |tructure of this| 00000df0 20 74 65 78 74 20 69 73 20 69 6d 70 6f 72 74 61 | text is importa| 00000e00 6e 74 20 74 6f 0d 74 68 65 20 70 72 6f 70 65 72 |nt to.the proper| 00000e10 20 77 6f 72 6b 69 6e 67 20 6f 66 20 74 68 65 20 | working of the | 00000e20 68 65 6c 70 20 69 6e 74 65 72 70 72 65 74 65 72 |help interpreter| 00000e30 2e 20 54 68 65 20 73 74 72 69 6e 67 20 73 74 61 |. The string sta| 00000e40 72 74 69 6e 67 20 61 74 20 74 68 65 0d 6c 61 62 |rting at the.lab| 00000e50 65 6c 20 22 2e 68 65 6c 70 74 69 74 6c 65 22 20 |el ".helptitle" | 00000e60 69 73 20 74 65 72 6d 69 6e 61 74 65 64 20 77 69 |is terminated wi| 00000e70 74 68 20 26 46 46 2e 20 54 68 69 73 20 61 72 67 |th &FF. This arg| 00000e80 75 6d 65 6e 74 20 74 65 72 6d 69 6e 61 74 69 6f |ument terminatio| 00000e90 6e 0d 62 79 74 65 20 6d 75 73 74 20 62 65 20 69 |n.byte must be i| 00000ea0 6e 63 6c 75 64 65 64 20 74 6f 20 6d 61 72 6b 20 |ncluded to mark | 00000eb0 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 61 |the end of the a| 00000ec0 72 67 75 6d 65 6e 74 20 75 73 65 64 20 74 6f 20 |rgument used to | 00000ed0 72 65 71 75 65 73 74 0d 65 78 74 65 6e 64 65 64 |request.extended| 00000ee0 20 68 65 6c 70 2e 20 41 6e 79 20 63 68 61 72 61 | help. Any chara| 00000ef0 63 74 65 72 20 77 69 74 68 20 74 68 65 20 6d 6f |cter with the mo| 00000f00 73 74 20 73 69 67 6e 69 66 69 63 61 6e 74 20 62 |st significant b| 00000f10 69 74 20 73 65 74 20 69 73 0d 69 67 6e 6f 72 65 |it set is.ignore| 00000f20 64 20 62 79 20 74 68 65 20 70 72 69 6e 74 20 73 |d by the print s| 00000f30 75 62 72 6f 75 74 69 6e 65 20 28 6c 69 6e 65 73 |ubroutine (lines| 00000f40 20 32 32 35 30 2d 32 33 35 30 29 2e 20 54 68 65 | 2250-2350). The| 00000f50 20 65 78 74 65 6e 64 65 64 20 68 65 6c 70 0d 61 | extended help.a| 00000f60 72 67 75 6d 65 6e 74 20 73 74 72 69 6e 67 20 69 |rgument string i| 00000f70 73 20 63 6f 6d 70 61 72 65 64 20 77 69 74 68 20 |s compared with | 00000f80 61 6e 79 20 61 72 67 75 6d 65 6e 74 20 74 79 70 |any argument typ| 00000f90 65 64 20 61 66 74 65 72 20 2a 48 45 4c 50 20 74 |ed after *HELP t| 00000fa0 6f 20 73 65 65 0d 69 66 20 65 78 74 65 6e 64 65 |o see.if extende| 00000fb0 64 20 68 65 6c 70 20 69 73 20 72 65 71 75 69 72 |d help is requir| 00000fc0 65 64 2e 20 54 68 65 20 7a 65 72 6f 20 62 79 74 |ed. The zero byt| 00000fd0 65 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66 20 |e at the end of | 00000fe0 74 68 65 20 73 69 6d 70 6c 65 0d 68 65 6c 70 20 |the simple.help | 00000ff0 74 65 78 74 20 69 73 20 75 73 65 64 20 74 6f 20 |text is used to | 00001000 69 6e 64 69 63 61 74 65 20 74 68 65 20 65 6e 64 |indicate the end| 00001010 20 6f 66 20 74 65 78 74 20 74 6f 20 74 68 65 20 | of text to the | 00001020 70 72 69 6e 74 20 73 75 62 72 6f 75 74 69 6e 65 |print subroutine| 00001030 2e 0d 0d 0d 0d 0d 2e 68 65 6c 70 6d 73 67 0d 20 |.......helpmsg. | 00001040 20 20 20 20 20 20 20 45 51 55 42 20 26 30 44 20 | EQUB &0D | 00001050 20 20 20 20 20 20 20 20 20 20 20 20 5c 20 63 61 | \ ca| 00001060 72 72 69 61 67 65 20 72 65 74 75 72 6e 0d 20 20 |rriage return. | 00001070 20 20 20 20 20 20 45 51 55 53 20 22 43 4f 4c 4f | EQUS "COLO| 00001080 55 52 45 44 20 54 45 58 54 22 20 5c 20 72 6f 6d |URED TEXT" \ rom| 00001090 20 63 6f 6e 74 65 6e 74 73 0d 20 20 20 20 20 20 | contents. | 000010a0 20 20 45 51 55 42 20 26 30 44 20 20 20 20 20 20 | EQUB &0D | 000010b0 20 20 20 20 20 20 20 5c 20 63 61 72 72 69 61 67 | \ carriag| 000010c0 65 20 72 65 74 75 72 6e 0d 20 20 20 20 20 20 20 |e return. | 000010d0 20 45 51 55 53 20 22 20 20 22 20 20 20 20 20 20 | EQUS " " | 000010e0 20 20 20 20 20 20 5c 20 74 77 6f 20 73 70 61 63 | \ two spac| 000010f0 65 73 0d 2e 68 65 6c 70 74 69 74 6c 65 0d 20 20 |es..helptitle. | 00001100 20 20 20 20 20 20 45 51 55 53 20 22 43 4f 4c 4f | EQUS "COLO| 00001110 55 52 53 22 20 20 20 20 20 20 20 5c 20 65 78 70 |URS" \ exp| 00001120 65 63 74 65 64 20 65 78 74 65 6e 64 65 64 20 68 |ected extended h| 00001130 65 6c 70 20 61 72 67 75 6d 65 6e 74 0d 20 20 20 |elp argument. | 00001140 20 20 20 20 20 45 51 55 53 20 26 46 46 20 20 20 | EQUS &FF | 00001150 20 20 20 20 20 20 20 20 20 20 5c 20 61 72 67 75 | \ argu| 00001160 6d 65 6e 74 20 74 65 72 6d 69 6e 61 74 69 6f 6e |ment termination| 00001170 20 62 79 74 65 0d 20 20 20 20 20 20 20 20 45 51 | byte. EQ| 00001180 55 57 20 26 30 44 20 20 20 20 20 20 20 20 20 20 |UW &0D | 00001190 20 20 20 5c 20 63 61 72 72 69 61 67 65 20 72 65 | \ carriage re| 000011a0 74 75 72 6e 0d 20 20 20 20 20 20 20 20 42 52 4b |turn. BRK| 000011b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000011c0 20 20 5c 20 65 6e 64 20 6f 66 20 6d 65 73 73 61 | \ end of messa| 000011d0 67 65 0d 0d 46 69 67 75 72 65 20 31 36 2e 33 20 |ge..Figure 16.3 | 000011e0 20 54 68 65 20 74 65 78 74 20 6f 66 20 74 68 65 | The text of the| 000011f0 20 73 69 6d 70 6c 65 20 68 65 6c 70 20 6d 65 73 | simple help mes| 00001200 73 61 67 65 2e 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |sage..----------| 00001210 2d 20 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |- -------------| 00001220 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001230 2d 2d 2d 2d 2d 2d 2d 0d 0d 0d 0d 0d 20 20 54 68 |-------..... Th| 00001240 65 20 74 65 78 74 20 73 74 61 72 74 69 6e 67 20 |e text starting | 00001250 61 74 20 6c 61 62 65 6c 20 22 2e 68 65 6c 70 69 |at label ".helpi| 00001260 6e 66 6f 22 20 69 6e 20 6c 69 6e 65 20 31 39 31 |nfo" in line 191| 00001270 30 20 69 73 20 70 72 69 6e 74 65 64 20 77 68 65 |0 is printed whe| 00001280 6e 0d 65 78 74 65 6e 64 65 64 20 68 65 6c 70 20 |n.extended help | 00001290 69 73 20 72 65 71 75 65 73 74 65 64 2e 20 54 68 |is requested. Th| 000012a0 69 73 20 74 65 78 74 20 63 61 6e 20 62 65 20 75 |is text can be u| 000012b0 70 20 74 6f 20 32 35 35 20 62 79 74 65 73 20 6c |p to 255 bytes l| 000012c0 6f 6e 67 20 61 6e 64 0d 6d 75 73 74 20 65 6e 64 |ong and.must end| 000012d0 20 77 69 74 68 20 61 20 7a 65 72 6f 20 62 79 74 | with a zero byt| 000012e0 65 2e 20 41 6e 79 20 62 79 74 65 20 77 69 74 68 |e. Any byte with| 000012f0 20 74 68 65 20 6d 6f 73 74 20 73 69 67 6e 69 66 | the most signif| 00001300 69 63 61 6e 74 20 62 69 74 20 73 65 74 0d 69 73 |icant bit set.is| 00001310 20 6e 6f 74 20 70 72 69 6e 74 65 64 2e 20 49 74 | not printed. It| 00001320 20 69 73 20 75 73 75 61 6c 20 74 6f 20 69 6e 63 | is usual to inc| 00001330 6c 75 64 65 20 74 68 65 20 73 79 6e 74 61 78 20 |lude the syntax | 00001340 6f 66 20 74 68 65 20 63 6f 6d 6d 61 6e 64 73 0d |of the commands.| 00001350 69 6d 70 6c 65 6d 65 6e 74 65 64 20 69 6e 20 74 |implemented in t| 00001360 68 65 20 72 6f 6d 20 69 6e 20 74 68 65 20 65 78 |he rom in the ex| 00001370 74 65 6e 64 65 64 20 68 65 6c 70 2c 20 62 75 74 |tended help, but| 00001380 20 79 6f 75 20 61 72 65 20 66 72 65 65 20 74 6f | you are free to| 00001390 20 77 72 69 74 65 0d 77 68 61 74 65 76 65 72 20 | write.whatever | 000013a0 79 6f 75 20 6c 69 6b 65 2e 20 54 68 65 20 65 78 |you like. The ex| 000013b0 61 6d 70 6c 65 20 70 72 6f 67 72 61 6d 20 70 72 |ample program pr| 000013c0 69 6e 74 73 20 74 68 65 20 73 79 6e 74 61 78 20 |ints the syntax | 000013d0 6f 66 20 73 69 78 74 65 65 6e 0d 6e 65 77 20 63 |of sixteen.new c| 000013e0 6f 6d 6d 61 6e 64 73 20 77 68 69 63 68 20 63 61 |ommands which ca| 000013f0 6e 20 62 65 20 75 73 65 64 20 74 6f 20 63 68 61 |n be used to cha| 00001400 6e 67 65 20 61 63 74 75 61 6c 20 63 6f 6c 6f 75 |nge actual colou| 00001410 72 20 6f 66 20 74 68 65 20 64 65 66 61 75 6c 74 |r of the default| 00001420 0d 74 65 78 74 20 63 6f 6c 6f 75 72 20 69 6e 20 |.text colour in | 00001430 6d 6f 64 65 73 20 30 2d 36 2e 20 54 68 65 20 64 |modes 0-6. The d| 00001440 65 66 61 75 6c 74 20 74 65 78 74 20 63 6f 6c 6f |efault text colo| 00001450 75 72 20 69 73 20 77 68 69 74 65 20 69 6e 20 61 |ur is white in a| 00001460 6c 6c 0d 6d 6f 64 65 73 20 62 75 74 20 79 6f 75 |ll.modes but you| 00001470 20 63 61 6e 20 63 68 61 6e 67 65 20 69 74 20 74 | can change it t| 00001480 6f 20 72 65 64 20 77 69 74 68 20 2a 52 45 44 20 |o red with *RED | 00001490 6f 72 20 66 6c 61 73 68 69 6e 67 20 72 65 64 2d |or flashing red-| 000014a0 63 79 61 6e 20 77 69 74 68 0d 2a 52 45 44 43 59 |cyan with.*REDCY| 000014b0 41 4e 2e 20 54 68 65 20 70 72 6f 67 72 61 6d 20 |AN. The program | 000014c0 75 73 65 73 20 74 68 65 20 6d 61 63 68 69 6e 65 |uses the machine| 000014d0 20 63 6f 64 65 20 65 71 75 69 76 61 6c 65 6e 74 | code equivalent| 000014e0 20 6f 66 20 74 68 65 20 56 44 55 31 39 0d 63 6f | of the VDU19.co| 000014f0 6d 6d 61 6e 64 20 74 6f 20 61 63 68 69 65 76 65 |mmand to achieve| 00001500 20 74 68 69 73 20 65 66 66 65 63 74 2e 0d 0d 20 | this effect... | 00001510 20 54 68 65 20 6f 72 64 65 72 20 6f 66 20 74 68 | The order of th| 00001520 65 20 63 6f 6d 6d 61 6e 64 73 20 69 6e 20 74 68 |e commands in th| 00001530 65 20 65 78 74 65 6e 64 65 64 20 68 65 6c 70 20 |e extended help | 00001540 6d 65 73 73 61 67 65 20 64 6f 65 73 20 6e 6f 74 |message does not| 00001550 20 68 61 76 65 0d 74 6f 20 62 65 20 74 68 65 20 | have.to be the | 00001560 73 61 6d 65 20 61 73 20 74 68 65 20 6f 72 64 65 |same as the orde| 00001570 72 20 69 6e 20 74 68 65 20 63 6f 6d 6d 61 6e 64 |r in the command| 00001580 20 74 61 62 6c 65 2e 20 49 6e 20 74 68 65 20 65 | table. In the e| 00001590 78 61 6d 70 6c 65 0d 70 72 6f 67 72 61 6d 20 74 |xample.program t| 000015a0 68 65 20 6f 72 64 65 72 20 72 65 66 6c 65 63 74 |he order reflect| 000015b0 73 20 74 68 65 20 6c 6f 67 69 63 61 6c 20 6f 72 |s the logical or| 000015c0 64 65 72 20 6f 66 20 74 68 65 20 73 69 78 74 65 |der of the sixte| 000015d0 65 6e 20 61 76 61 69 6c 61 62 6c 65 0d 63 6f 6c |en available.col| 000015e0 6f 75 72 73 2e 0d 0d 20 20 54 68 65 20 69 6e 74 |ours... The int| 000015f0 65 72 70 72 65 74 65 72 20 69 6e 20 74 68 65 20 |erpreter in the | 00001600 70 72 6f 67 72 61 6d 20 48 45 4c 50 20 70 75 73 |program HELP pus| 00001610 68 65 73 20 74 68 65 20 72 65 67 69 73 74 65 72 |hes the register| 00001620 73 20 61 6e 64 20 74 77 6f 0d 7a 65 72 6f 20 70 |s and two.zero p| 00001630 61 67 65 20 62 79 74 65 73 20 6f 6e 20 74 68 65 |age bytes on the| 00001640 20 73 74 61 63 6b 20 28 6c 69 6e 65 73 20 33 32 | stack (lines 32| 00001650 30 2d 34 30 30 29 2c 20 69 6e 74 65 72 63 65 70 |0-400), intercep| 00001660 74 73 20 73 65 72 76 69 63 65 20 63 61 6c 6c 0d |ts service call.| 00001670 39 20 28 6c 69 6e 65 20 34 33 30 29 20 61 6e 64 |9 (line 430) and| 00001680 20 69 6e 69 74 69 61 6c 69 73 65 73 20 74 68 65 | initialises the| 00001690 20 2a 48 45 4c 50 20 61 72 67 75 6d 65 6e 74 20 | *HELP argument | 000016a0 28 6c 69 6e 65 73 20 34 35 30 2d 34 36 30 29 2e |(lines 450-460).| 000016b0 20 54 68 65 20 58 0d 72 65 67 69 73 74 65 72 20 | The X.register | 000016c0 69 73 20 72 65 73 65 74 20 74 6f 20 7a 65 72 6f |is reset to zero| 000016d0 20 28 6c 69 6e 65 20 34 37 30 29 20 72 65 61 64 | (line 470) read| 000016e0 79 20 74 6f 20 62 65 20 75 73 65 64 20 61 73 20 |y to be used as | 000016f0 61 6e 20 69 6e 64 65 78 20 6f 6e 0d 74 68 65 20 |an index on.the | 00001700 65 78 70 65 63 74 65 64 20 65 78 74 65 6e 64 65 |expected extende| 00001710 64 20 68 65 6c 70 20 61 72 67 75 6d 65 6e 74 2e |d help argument.| 00001720 20 54 68 65 20 66 69 72 73 74 20 62 79 74 65 20 | The first byte | 00001730 6f 66 20 74 68 65 20 61 72 67 75 6d 65 6e 74 20 |of the argument | 00001740 69 73 0d 72 65 61 64 20 28 6c 69 6e 65 20 34 38 |is.read (line 48| 00001750 30 29 20 61 6e 64 2c 20 69 66 20 61 6e 20 61 72 |0) and, if an ar| 00001760 67 75 6d 65 6e 74 20 69 73 20 70 72 65 73 65 6e |gument is presen| 00001770 74 2c 20 61 20 62 72 61 6e 63 68 20 69 73 20 6d |t, a branch is m| 00001780 61 64 65 20 74 6f 0d 74 68 65 20 6c 61 62 65 6c |ade to.the label| 00001790 20 22 2e 74 72 79 65 78 74 65 6e 64 65 64 22 20 | ".tryextended" | 000017a0 28 6c 69 6e 65 20 34 39 30 20 61 6e 64 20 6c 69 |(line 490 and li| 000017b0 6e 65 20 35 37 30 29 2e 20 49 66 20 61 6e 20 61 |ne 570). If an a| 000017c0 72 67 75 6d 65 6e 74 20 69 73 0d 6e 6f 74 20 66 |rgument is.not f| 000017d0 6f 75 6e 64 20 74 68 65 20 73 69 6d 70 6c 65 20 |ound the simple | 000017e0 68 65 6c 70 20 6d 65 73 73 61 67 65 20 69 73 20 |help message is | 000017f0 70 72 69 6e 74 65 64 20 28 6c 69 6e 65 73 20 35 |printed (lines 5| 00001800 30 30 2d 35 32 30 29 20 61 6e 64 20 74 68 65 0d |00-520) and the.| 00001810 72 65 67 69 73 74 65 72 73 20 61 6e 64 20 7a 65 |registers and ze| 00001820 72 6f 20 70 61 67 65 20 62 79 74 65 73 20 61 72 |ro page bytes ar| 00001830 65 20 72 65 73 74 6f 72 65 64 20 62 65 66 6f 72 |e restored befor| 00001840 65 20 72 65 74 75 72 6e 69 6e 67 20 63 6f 6e 74 |e returning cont| 00001850 72 6f 6c 20 74 6f 0d 74 68 65 20 4d 4f 53 20 28 |rol to.the MOS (| 00001860 6c 69 6e 65 20 35 33 30 20 61 6e 64 20 6c 69 6e |line 530 and lin| 00001870 65 73 20 31 30 36 30 2d 31 31 36 30 29 2e 0d 0d |es 1060-1160)...| 00001880 20 20 54 68 65 20 65 78 74 65 6e 64 65 64 20 68 | The extended h| 00001890 65 6c 70 20 69 6e 74 65 72 70 72 65 74 65 72 20 |elp interpreter | 000018a0 28 6c 69 6e 65 73 20 35 34 30 2d 37 30 30 29 20 |(lines 540-700) | 000018b0 63 6f 6d 70 61 72 65 73 20 65 76 65 72 79 20 62 |compares every b| 000018c0 79 74 65 20 6f 66 0d 74 68 65 20 74 79 70 65 64 |yte of.the typed| 000018d0 20 61 72 67 75 6d 65 6e 74 20 77 69 74 68 20 65 | argument with e| 000018e0 76 65 72 79 20 62 79 74 65 20 6f 66 20 74 68 65 |very byte of the| 000018f0 20 65 78 70 65 63 74 65 64 20 61 72 67 75 6d 65 | expected argume| 00001900 6e 74 20 28 6c 69 6e 65 73 0d 35 34 30 2d 36 34 |nt (lines.540-64| 00001910 30 29 20 61 6e 64 20 69 66 20 61 20 6d 61 74 63 |0) and if a matc| 00001920 68 20 69 73 20 66 6f 75 6e 64 2c 20 6f 72 20 61 |h is found, or a| 00001930 20 73 75 69 74 61 62 6c 65 20 73 68 6f 72 74 65 | suitable shorte| 00001940 6e 65 64 20 61 72 67 75 6d 65 6e 74 20 69 73 0d |ned argument is.| 00001950 74 79 70 65 64 2c 20 74 68 65 20 65 78 74 65 6e |typed, the exten| 00001960 64 65 64 20 68 65 6c 70 20 6d 65 73 73 61 67 65 |ded help message| 00001970 20 69 73 20 70 72 69 6e 74 65 64 20 28 6c 69 6e | is printed (lin| 00001980 65 73 20 36 37 30 2d 36 39 30 29 20 62 65 66 6f |es 670-690) befo| 00001990 72 65 0d 72 65 74 75 72 6e 69 6e 67 20 63 6f 6e |re.returning con| 000019a0 74 72 6f 6c 20 74 6f 20 74 68 65 20 4d 4f 53 20 |trol to the MOS | 000019b0 77 69 74 68 20 74 68 65 20 72 65 67 69 73 74 65 |with the registe| 000019c0 72 73 20 61 6e 64 20 7a 65 72 6f 20 70 61 67 65 |rs and zero page| 000019d0 20 62 79 74 65 73 0d 72 65 73 74 6f 72 65 64 20 | bytes.restored | 000019e0 28 6c 69 6e 65 20 37 30 30 20 61 6e 64 20 6c 69 |(line 700 and li| 000019f0 6e 65 73 20 31 30 36 30 2d 31 31 36 30 29 2e 0d |nes 1060-1160)..| 00001a00 0d 0d 0d 0d 20 20 20 31 30 20 52 45 4d 3a 20 48 |.... 10 REM: H| 00001a10 45 4c 50 0d 20 20 20 32 30 20 4d 4f 44 45 37 0d |ELP. 20 MODE7.| 00001a20 20 20 20 33 30 20 48 49 4d 45 4d 3d 26 33 43 30 | 30 HIMEM=&3C0| 00001a30 30 0d 20 20 20 34 30 20 44 49 4d 20 73 61 76 65 |0. 40 DIM save| 00001a40 20 35 30 0d 20 20 20 35 30 20 64 69 66 66 3d 26 | 50. 50 diff=&| 00001a50 38 30 30 30 2d 48 49 4d 45 4d 0d 20 20 20 36 30 |8000-HIMEM. 60| 00001a60 20 61 64 64 72 65 73 73 3d 26 37 30 0d 20 20 20 | address=&70. | 00001a70 37 30 20 63 6f 6d 76 65 63 3d 26 46 32 0d 20 20 |70 comvec=&F2. | 00001a80 20 38 30 20 65 72 72 73 74 61 63 6b 3d 26 31 30 | 80 errstack=&10| 00001a90 30 0d 20 20 20 39 30 20 73 74 61 63 6b 3d 26 31 |0. 90 stack=&1| 00001aa0 30 35 0d 20 20 31 30 30 20 67 73 69 6e 69 74 3d |05. 100 gsinit=| 00001ab0 26 46 46 43 32 0d 20 20 31 31 30 20 67 73 72 65 |&FFC2. 110 gsre| 00001ac0 61 64 3d 26 46 46 43 35 0d 20 20 31 32 30 20 6f |ad=&FFC5. 120 o| 00001ad0 73 61 73 63 69 3d 26 46 46 45 33 0d 20 20 31 33 |sasci=&FFE3. 13| 00001ae0 30 20 6f 73 77 6f 72 64 3d 26 46 46 46 31 0d 20 |0 osword=&FFF1. | 00001af0 20 31 34 30 20 6f 73 62 79 74 65 3d 26 46 46 46 | 140 osbyte=&FFF| 00001b00 34 0d 20 20 31 35 30 20 6f 73 63 6c 69 3d 26 46 |4. 150 oscli=&F| 00001b10 46 46 37 0d 20 20 31 36 30 20 46 4f 52 20 70 61 |FF7. 160 FOR pa| 00001b20 73 73 20 3d 20 30 20 54 4f 20 32 20 53 54 45 50 |ss = 0 TO 2 STEP| 00001b30 20 32 0d 20 20 31 37 30 20 50 25 3d 48 49 4d 45 | 2. 170 P%=HIME| 00001b40 4d 0d 20 20 31 38 30 20 5b 20 20 20 20 20 20 20 |M. 180 [ | 00001b50 4f 50 54 20 70 61 73 73 0d 20 20 31 39 30 20 20 |OPT pass. 190 | 00001b60 20 20 20 20 20 20 20 42 52 4b 0d 20 20 32 30 30 | BRK. 200| 00001b70 20 20 20 20 20 20 20 20 20 42 52 4b 0d 20 20 32 | BRK. 2| 00001b80 31 30 20 20 20 20 20 20 20 20 20 42 52 4b 0d 20 |10 BRK. | 00001b90 20 32 32 30 20 20 20 20 20 20 20 20 20 4a 4d 50 | 220 JMP| 00001ba0 20 73 65 72 76 69 63 65 2b 64 69 66 66 0d 20 20 | service+diff. | 00001bb0 32 33 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 |230 OPT | 00001bc0 46 4e 65 71 75 62 28 26 38 32 29 0d 20 20 32 34 |FNequb(&82). 24| 00001bd0 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e |0 OPT FN| 00001be0 65 71 75 62 28 28 63 6f 70 79 72 69 67 68 74 2b |equb((copyright+| 00001bf0 64 69 66 66 29 20 4d 4f 44 20 32 35 36 29 0d 20 |diff) MOD 256). | 00001c00 20 32 35 30 20 20 20 20 20 20 20 20 20 42 52 4b | 250 BRK| 00001c10 0d 20 20 32 36 30 20 20 20 20 20 20 20 20 20 4f |. 260 O| 00001c20 50 54 20 46 4e 65 71 75 73 28 22 43 4f 4c 4f 55 |PT FNequs("COLOU| 00001c30 52 45 44 20 54 45 58 54 22 29 0d 20 20 32 37 30 |RED TEXT"). 270| 00001c40 20 2e 63 6f 70 79 72 69 67 68 74 0d 20 20 32 38 | .copyright. 28| 00001c50 30 20 20 20 20 20 20 20 20 20 42 52 4b 0d 20 20 |0 BRK. | 00001c60 32 39 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 |290 OPT | 00001c70 46 4e 65 71 75 73 28 22 28 43 29 20 47 6f 72 64 |FNequs("(C) Gord| 00001c80 6f 6e 20 48 6f 72 73 69 6e 67 74 6f 6e 20 31 39 |on Horsington 19| 00001c90 38 37 22 29 0d 20 20 33 30 30 20 20 20 20 20 20 |87"). 300 | 00001ca0 20 20 20 42 52 4b 0d 20 20 33 31 30 20 2e 73 65 | BRK. 310 .se| 00001cb0 72 76 69 63 65 0d 20 20 33 32 30 20 20 20 20 20 |rvice. 320 | 00001cc0 20 20 20 20 50 48 41 0d 20 20 33 33 30 20 20 20 | PHA. 330 | 00001cd0 20 20 20 20 20 20 54 58 41 0d 20 20 33 34 30 20 | TXA. 340 | 00001ce0 20 20 20 20 20 20 20 20 50 48 41 0d 20 20 33 35 | PHA. 35| 00001cf0 30 20 20 20 20 20 20 20 20 20 54 59 41 0d 20 20 |0 TYA. | 00001d00 33 36 30 20 20 20 20 20 20 20 20 20 50 48 41 0d |360 PHA.| 00001d10 20 20 33 37 30 20 20 20 20 20 20 20 20 20 4c 44 | 370 LD| 00001d20 41 20 61 64 64 72 65 73 73 0d 20 20 33 38 30 20 |A address. 380 | 00001d30 20 20 20 20 20 20 20 20 50 48 41 0d 20 20 33 39 | PHA. 39| 00001d40 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 61 64 |0 LDA ad| 00001d50 64 72 65 73 73 2b 31 0d 20 20 34 30 30 20 20 20 |dress+1. 400 | 00001d60 20 20 20 20 20 20 50 48 41 0d 20 20 34 31 30 20 | PHA. 410 | 00001d70 20 20 20 20 20 20 20 20 54 53 58 0d 20 20 34 32 | TSX. 42| 00001d80 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 73 74 |0 LDA st| 00001d90 61 63 6b 2c 58 0d 20 20 34 33 30 20 20 20 20 20 |ack,X. 430 | 00001da0 20 20 20 20 43 4d 50 20 23 39 0d 20 20 34 34 30 | CMP #9. 440| 00001db0 20 20 20 20 20 20 20 20 20 42 4e 45 20 74 72 79 | BNE try| 00001dc0 66 6f 75 72 0d 20 20 34 35 30 20 20 20 20 20 20 |four. 450 | 00001dd0 20 20 20 53 45 43 0d 20 20 34 36 30 20 20 20 20 | SEC. 460 | 00001de0 20 20 20 20 20 4a 53 52 20 67 73 69 6e 69 74 0d | JSR gsinit.| 00001df0 20 20 34 37 30 20 20 20 20 20 20 20 20 20 4c 44 | 470 LD| 00001e00 58 20 23 30 0d 20 20 34 38 30 20 20 20 20 20 20 |X #0. 480 | 00001e10 20 20 20 4a 53 52 20 67 73 72 65 61 64 0d 20 20 | JSR gsread. | 00001e20 34 39 30 20 20 20 20 20 20 20 20 20 42 43 43 20 |490 BCC | 00001e30 74 72 79 65 78 74 65 6e 64 65 64 0d 20 20 35 30 |tryextended. 50| 00001e40 30 20 20 20 20 20 20 20 20 20 4c 44 58 20 23 28 |0 LDX #(| 00001e50 68 65 6c 70 6d 73 67 2b 64 69 66 66 29 20 4d 4f |helpmsg+diff) MO| 00001e60 44 20 32 35 36 0d 20 20 35 31 30 20 20 20 20 20 |D 256. 510 | 00001e70 20 20 20 20 4c 44 59 20 23 28 68 65 6c 70 6d 73 | LDY #(helpms| 00001e80 67 2b 64 69 66 66 29 20 44 49 56 20 32 35 36 0d |g+diff) DIV 256.| 00001e90 20 20 35 32 30 20 20 20 20 20 20 20 20 20 4a 53 | 520 JS| 00001ea0 52 20 70 72 69 6e 74 65 72 2b 64 69 66 66 0d 20 |R printer+diff. | 00001eb0 20 35 33 30 20 20 20 20 20 20 20 20 20 42 45 51 | 530 BEQ| 00001ec0 20 71 75 69 74 0d 20 20 35 34 30 20 2e 68 65 6c | quit. 540 .hel| 00001ed0 70 6c 6f 6f 70 0d 20 20 35 35 30 20 20 20 20 20 |ploop. 550 | 00001ee0 20 20 20 20 49 4e 58 0d 20 20 35 36 30 20 20 20 | INX. 560 | 00001ef0 20 20 20 20 20 20 4a 53 52 20 67 73 72 65 61 64 | JSR gsread| 00001f00 0d 20 20 35 37 30 20 2e 74 72 79 65 78 74 65 6e |. 570 .tryexten| 00001f10 64 65 64 0d 20 20 35 38 30 20 20 20 20 20 20 20 |ded. 580 | 00001f20 20 20 43 4d 50 20 23 41 53 43 28 22 2e 22 29 0d | CMP #ASC(".").| 00001f30 20 20 35 39 30 20 20 20 20 20 20 20 20 20 42 45 | 590 BE| 00001f40 51 20 6f 6b 65 78 74 65 6e 64 65 64 0d 20 20 36 |Q okextended. 6| 00001f50 30 30 20 20 20 20 20 20 20 20 20 41 4e 44 20 23 |00 AND #| 00001f60 26 44 46 0d 20 20 36 31 30 20 20 20 20 20 20 20 |&DF. 610 | 00001f70 20 20 43 4d 50 20 68 65 6c 70 74 69 74 6c 65 2b | CMP helptitle+| 00001f80 64 69 66 66 2c 58 0d 20 20 36 32 30 20 20 20 20 |diff,X. 620 | 00001f90 20 20 20 20 20 42 45 51 20 68 65 6c 70 6c 6f 6f | BEQ helploo| 00001fa0 70 0d 20 20 36 33 30 20 20 20 20 20 20 20 20 20 |p. 630 | 00001fb0 4c 44 41 20 23 26 46 46 0d 20 20 36 34 30 20 20 |LDA #&FF. 640 | 00001fc0 20 20 20 20 20 20 20 43 4d 50 20 68 65 6c 70 74 | CMP helpt| 00001fd0 69 74 6c 65 2b 64 69 66 66 2c 58 0d 20 20 36 35 |itle+diff,X. 65| 00001fe0 30 20 20 20 20 20 20 20 20 20 42 4e 45 20 71 75 |0 BNE qu| 00001ff0 69 74 0d 20 20 36 36 30 20 2e 6f 6b 65 78 74 65 |it. 660 .okexte| 00002000 6e 64 65 64 0d 20 20 36 37 30 20 20 20 20 20 20 |nded. 670 | 00002010 20 20 20 4c 44 58 20 23 28 68 65 6c 70 69 6e 66 | LDX #(helpinf| 00002020 6f 2b 64 69 66 66 29 20 4d 4f 44 20 32 35 36 0d |o+diff) MOD 256.| 00002030 20 20 36 38 30 20 20 20 20 20 20 20 20 20 4c 44 | 680 LD| 00002040 59 20 23 28 68 65 6c 70 69 6e 66 6f 2b 64 69 66 |Y #(helpinfo+dif| 00002050 66 29 20 44 49 56 20 32 35 36 0d 20 20 36 39 30 |f) DIV 256. 690| 00002060 20 20 20 20 20 20 20 20 20 4a 53 52 20 70 72 69 | JSR pri| 00002070 6e 74 65 72 2b 64 69 66 66 0d 20 20 37 30 30 20 |nter+diff. 700 | 00002080 20 20 20 20 20 20 20 20 42 45 51 20 71 75 69 74 | BEQ quit| 00002090 0d 20 20 37 31 30 20 2e 74 72 79 66 6f 75 72 0d |. 710 .tryfour.| 000020a0 20 20 37 32 30 20 20 20 20 20 20 20 20 20 43 4d | 720 CM| 000020b0 50 20 23 34 0d 20 20 37 33 30 20 20 20 20 20 20 |P #4. 730 | 000020c0 20 20 20 42 4e 45 20 71 75 69 74 0d 20 20 37 34 | BNE quit. 74| 000020d0 30 20 20 20 20 20 20 20 20 20 4c 44 58 20 23 26 |0 LDX #&| 000020e0 46 45 0d 20 20 37 35 30 20 20 20 20 20 20 20 20 |FE. 750 | 000020f0 20 54 59 41 0d 20 20 37 36 30 20 20 20 20 20 20 | TYA. 760 | 00002100 20 20 20 50 48 41 0d 20 20 37 37 30 20 2e 66 69 | PHA. 770 .fi| 00002110 72 73 74 63 68 61 72 0d 20 20 37 38 30 20 20 20 |rstchar. 780 | 00002120 20 20 20 20 20 20 49 4e 58 0d 20 20 37 39 30 20 | INX. 790 | 00002130 20 20 20 20 20 20 20 20 50 4c 41 0d 20 20 38 30 | PLA. 80| 00002140 30 20 20 20 20 20 20 20 20 20 54 41 59 0d 20 20 |0 TAY. | 00002150 38 31 30 20 20 20 20 20 20 20 20 20 50 48 41 0d |810 PHA.| 00002160 20 20 38 32 30 20 20 20 20 20 20 20 20 20 4c 44 | 820 LD| 00002170 41 20 28 63 6f 6d 76 65 63 29 2c 59 0d 20 20 38 |A (comvec),Y. 8| 00002180 33 30 20 20 20 20 20 20 20 20 20 41 4e 44 20 23 |30 AND #| 00002190 26 44 46 0d 20 20 38 34 30 20 20 20 20 20 20 20 |&DF. 840 | 000021a0 20 20 43 4d 50 20 23 41 53 43 28 22 58 22 29 0d | CMP #ASC("X").| 000021b0 20 20 38 35 30 20 20 20 20 20 20 20 20 20 42 4e | 850 BN| 000021c0 45 20 69 6e 74 65 72 70 72 65 74 0d 20 20 38 36 |E interpret. 86| 000021d0 30 20 20 20 20 20 20 20 20 20 49 4e 59 0d 20 20 |0 INY. | 000021e0 38 37 30 20 2e 69 6e 74 65 72 70 72 65 74 0d 20 |870 .interpret. | 000021f0 20 38 38 30 20 20 20 20 20 20 20 20 20 49 4e 58 | 880 INX| 00002200 0d 20 20 38 39 30 20 20 20 20 20 20 20 20 20 4c |. 890 L| 00002210 44 41 20 63 6f 6d 6d 74 61 62 6c 65 2b 64 69 66 |DA commtable+dif| 00002220 66 2c 58 0d 20 20 39 30 30 20 20 20 20 20 20 20 |f,X. 900 | 00002230 20 20 42 4d 49 20 66 6f 75 6e 64 0d 20 20 39 31 | BMI found. 91| 00002240 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 28 63 |0 LDA (c| 00002250 6f 6d 76 65 63 29 2c 59 0d 20 20 39 32 30 20 20 |omvec),Y. 920 | 00002260 20 20 20 20 20 20 20 49 4e 59 0d 20 20 39 33 30 | INY. 930| 00002270 20 20 20 20 20 20 20 20 20 43 4d 50 20 23 41 53 | CMP #AS| 00002280 43 28 22 2e 22 29 0d 20 20 39 34 30 20 20 20 20 |C("."). 940 | 00002290 20 20 20 20 20 42 45 51 20 66 6f 75 6e 64 64 6f | BEQ founddo| 000022a0 74 0d 20 20 39 35 30 20 20 20 20 20 20 20 20 20 |t. 950 | 000022b0 41 4e 44 20 23 26 44 46 0d 20 20 39 36 30 20 20 |AND #&DF. 960 | 000022c0 20 20 20 20 20 20 20 43 4d 50 20 63 6f 6d 6d 74 | CMP commt| 000022d0 61 62 6c 65 2b 64 69 66 66 2c 58 0d 20 20 39 37 |able+diff,X. 97| 000022e0 30 20 20 20 20 20 20 20 20 20 42 45 51 20 69 6e |0 BEQ in| 000022f0 74 65 72 70 72 65 74 0d 20 20 39 38 30 20 2e 61 |terpret. 980 .a| 00002300 6e 6f 74 68 65 72 0d 20 20 39 39 30 20 20 20 20 |nother. 990 | 00002310 20 20 20 20 20 49 4e 58 0d 20 31 30 30 30 20 20 | INX. 1000 | 00002320 20 20 20 20 20 20 20 4c 44 41 20 63 6f 6d 6d 74 | LDA commt| 00002330 61 62 6c 65 2b 64 69 66 66 2c 58 0d 20 31 30 31 |able+diff,X. 101| 00002340 30 20 20 20 20 20 20 20 20 20 42 50 4c 20 61 6e |0 BPL an| 00002350 6f 74 68 65 72 0d 20 31 30 32 30 20 20 20 20 20 |other. 1020 | 00002360 20 20 20 20 43 4d 50 20 23 26 46 46 0d 20 31 30 | CMP #&FF. 10| 00002370 33 30 20 20 20 20 20 20 20 20 20 42 4e 45 20 66 |30 BNE f| 00002380 69 72 73 74 63 68 61 72 0d 20 31 30 34 30 20 2e |irstchar. 1040 .| 00002390 65 78 69 74 0d 20 31 30 35 30 20 20 20 20 20 20 |exit. 1050 | 000023a0 20 20 20 50 4c 41 0d 20 31 30 36 30 20 2e 71 75 | PLA. 1060 .qu| 000023b0 69 74 0d 20 31 30 37 30 20 20 20 20 20 20 20 20 |it. 1070 | 000023c0 20 50 4c 41 0d 20 31 30 38 30 20 20 20 20 20 20 | PLA. 1080 | 000023d0 20 20 20 53 54 41 20 61 64 64 72 65 73 73 2b 31 | STA address+1| 000023e0 0d 20 31 30 39 30 20 20 20 20 20 20 20 20 20 50 |. 1090 P| 000023f0 4c 41 0d 20 31 31 30 30 20 20 20 20 20 20 20 20 |LA. 1100 | 00002400 20 53 54 41 20 61 64 64 72 65 73 73 0d 20 31 31 | STA address. 11| 00002410 31 30 20 20 20 20 20 20 20 20 20 50 4c 41 0d 20 |10 PLA. | 00002420 31 31 32 30 20 20 20 20 20 20 20 20 20 54 41 59 |1120 TAY| 00002430 0d 20 31 31 33 30 20 20 20 20 20 20 20 20 20 50 |. 1130 P| 00002440 4c 41 0d 20 31 31 34 30 20 20 20 20 20 20 20 20 |LA. 1140 | 00002450 20 54 41 58 0d 20 31 31 35 30 20 20 20 20 20 20 | TAX. 1150 | 00002460 20 20 20 50 4c 41 0d 20 31 31 36 30 20 20 20 20 | PLA. 1160 | 00002470 20 20 20 20 20 52 54 53 0d 20 31 31 37 30 20 2e | RTS. 1170 .| 00002480 66 6f 75 6e 64 64 6f 74 0d 20 31 31 38 30 20 20 |founddot. 1180 | 00002490 20 20 20 20 20 20 20 49 4e 58 0d 20 31 31 39 30 | INX. 1190| 000024a0 20 20 20 20 20 20 20 20 20 4c 44 41 20 63 6f 6d | LDA com| 000024b0 6d 74 61 62 6c 65 2b 64 69 66 66 2c 58 0d 20 31 |mtable+diff,X. 1| 000024c0 32 30 30 20 20 20 20 20 20 20 20 20 42 50 4c 20 |200 BPL | 000024d0 66 6f 75 6e 64 64 6f 74 0d 20 31 32 31 30 20 2e |founddot. 1210 .| 000024e0 66 6f 75 6e 64 0d 20 31 32 32 30 20 20 20 20 20 |found. 1220 | 000024f0 20 20 20 20 43 4d 50 20 23 26 46 46 0d 20 31 32 | CMP #&FF. 12| 00002500 33 30 20 20 20 20 20 20 20 20 20 42 45 51 20 65 |30 BEQ e| 00002510 78 69 74 0d 20 31 32 34 30 20 20 20 20 20 20 20 |xit. 1240 | 00002520 20 20 53 54 41 20 61 64 64 72 65 73 73 2b 31 0d | STA address+1.| 00002530 20 31 32 35 30 20 20 20 20 20 20 20 20 20 49 4e | 1250 IN| 00002540 58 0d 20 31 32 36 30 20 20 20 20 20 20 20 20 20 |X. 1260 | 00002550 4c 44 41 20 63 6f 6d 6d 74 61 62 6c 65 2b 64 69 |LDA commtable+di| 00002560 66 66 2c 58 0d 20 31 32 37 30 20 20 20 20 20 20 |ff,X. 1270 | 00002570 20 20 20 53 54 41 20 61 64 64 72 65 73 73 0d 20 | STA address. | 00002580 31 32 38 30 20 20 20 20 20 20 20 20 20 50 4c 41 |1280 PLA| 00002590 0d 20 31 32 39 30 20 20 20 20 20 20 20 20 20 53 |. 1290 S| 000025a0 45 43 0d 20 31 33 30 30 20 20 20 20 20 20 20 20 |EC. 1300 | 000025b0 20 4a 53 52 20 67 73 69 6e 69 74 0d 20 31 33 31 | JSR gsinit. 131| 000025c0 30 20 20 20 20 20 20 20 20 20 4a 4d 50 20 28 61 |0 JMP (a| 000025d0 64 64 72 65 73 73 29 0d 20 31 33 32 30 20 2e 63 |ddress). 1320 .c| 000025e0 6f 6d 6d 74 61 62 6c 65 0d 20 31 33 33 30 20 20 |ommtable. 1330 | 000025f0 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 | OPT FNequ| 00002600 73 28 22 42 4c 41 57 48 49 54 22 29 0d 20 31 33 |s("BLAWHIT"). 13| 00002610 34 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 |40 OPT F| 00002620 4e 65 71 75 62 28 28 62 6c 61 77 68 69 74 2b 64 |Nequb((blawhit+d| 00002630 69 66 66 29 20 44 49 56 20 32 35 36 29 0d 20 31 |iff) DIV 256). 1| 00002640 33 35 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 |350 OPT | 00002650 46 4e 65 71 75 62 28 28 62 6c 61 77 68 69 74 2b |FNequb((blawhit+| 00002660 64 69 66 66 29 20 4d 4f 44 20 32 35 36 29 0d 20 |diff) MOD 256). | 00002670 31 33 36 30 20 20 20 20 20 20 20 20 20 4f 50 54 |1360 OPT| 00002680 20 46 4e 65 71 75 73 28 22 52 45 44 43 59 41 4e | FNequs("REDCYAN| 00002690 22 29 0d 20 31 33 37 30 20 20 20 20 20 20 20 20 |"). 1370 | 000026a0 20 4f 50 54 20 46 4e 65 71 75 62 28 28 72 65 64 | OPT FNequb((red| 000026b0 63 79 61 6e 2b 64 69 66 66 29 20 44 49 56 20 32 |cyan+diff) DIV 2| 000026c0 35 36 29 0d 20 31 33 38 30 20 20 20 20 20 20 20 |56). 1380 | 000026d0 20 20 4f 50 54 20 46 4e 65 71 75 62 28 28 72 65 | OPT FNequb((re| 000026e0 64 63 79 61 6e 2b 64 69 66 66 29 20 4d 4f 44 20 |dcyan+diff) MOD | 000026f0 32 35 36 29 0d 20 31 33 39 30 20 20 20 20 20 20 |256). 1390 | 00002700 20 20 20 4f 50 54 20 46 4e 65 71 75 73 28 22 47 | OPT FNequs("G| 00002710 52 45 45 4d 41 47 22 29 0d 20 31 34 30 30 20 20 |REEMAG"). 1400 | 00002720 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 | OPT FNequ| 00002730 62 28 28 67 72 65 65 6d 61 67 2b 64 69 66 66 29 |b((greemag+diff)| 00002740 20 44 49 56 20 32 35 36 29 0d 20 31 34 31 30 20 | DIV 256). 1410 | 00002750 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 | OPT FNeq| 00002760 75 62 28 28 67 72 65 65 6d 61 67 2b 64 69 66 66 |ub((greemag+diff| 00002770 29 20 4d 4f 44 20 32 35 36 29 0d 20 31 34 32 30 |) MOD 256). 1420| 00002780 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 | OPT FNe| 00002790 71 75 73 28 22 59 45 4c 4c 42 4c 55 22 29 0d 20 |qus("YELLBLU"). | 000027a0 31 34 33 30 20 20 20 20 20 20 20 20 20 4f 50 54 |1430 OPT| 000027b0 20 46 4e 65 71 75 62 28 28 79 65 6c 6c 62 6c 75 | FNequb((yellblu| 000027c0 2b 64 69 66 66 29 20 44 49 56 20 32 35 36 29 0d |+diff) DIV 256).| 000027d0 20 31 34 34 30 20 20 20 20 20 20 20 20 20 4f 50 | 1440 OP| 000027e0 54 20 46 4e 65 71 75 62 28 28 79 65 6c 6c 62 6c |T FNequb((yellbl| 000027f0 75 2b 64 69 66 66 29 20 4d 4f 44 20 32 35 36 29 |u+diff) MOD 256)| 00002800 0d 20 31 34 35 30 20 20 20 20 20 20 20 20 20 4f |. 1450 O| 00002810 50 54 20 46 4e 65 71 75 73 28 22 42 4c 55 59 45 |PT FNequs("BLUYE| 00002820 4c 4c 22 29 0d 20 31 34 36 30 20 20 20 20 20 20 |LL"). 1460 | 00002830 20 20 20 4f 50 54 20 46 4e 65 71 75 62 28 28 62 | OPT FNequb((b| 00002840 6c 75 79 65 6c 6c 2b 64 69 66 66 29 20 44 49 56 |luyell+diff) DIV| 00002850 20 32 35 36 29 0d 20 31 34 37 30 20 20 20 20 20 | 256). 1470 | 00002860 20 20 20 20 4f 50 54 20 46 4e 65 71 75 62 28 28 | OPT FNequb((| 00002870 62 6c 75 79 65 6c 6c 2b 64 69 66 66 29 20 4d 4f |bluyell+diff) MO| 00002880 44 20 32 35 36 29 0d 20 31 34 38 30 20 20 20 20 |D 256). 1480 | 00002890 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 73 28 | OPT FNequs(| 000028a0 22 4d 41 47 52 45 45 4e 22 29 0d 20 31 34 39 30 |"MAGREEN"). 1490| 000028b0 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 | OPT FNe| 000028c0 71 75 62 28 28 6d 61 67 72 65 65 6e 2b 64 69 66 |qub((magreen+dif| 000028d0 66 29 20 44 49 56 20 32 35 36 29 0d 20 31 35 30 |f) DIV 256). 150| 000028e0 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e |0 OPT FN| 000028f0 65 71 75 62 28 28 6d 61 67 72 65 65 6e 2b 64 69 |equb((magreen+di| 00002900 66 66 29 20 4d 4f 44 20 32 35 36 29 0d 20 31 35 |ff) MOD 256). 15| 00002910 31 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 |10 OPT F| 00002920 4e 65 71 75 73 28 22 43 59 41 4e 52 45 44 22 29 |Nequs("CYANRED")| 00002930 0d 20 31 35 32 30 20 20 20 20 20 20 20 20 20 4f |. 1520 O| 00002940 50 54 20 46 4e 65 71 75 62 28 28 63 79 61 6e 72 |PT FNequb((cyanr| 00002950 65 64 2b 64 69 66 66 29 20 44 49 56 20 32 35 36 |ed+diff) DIV 256| 00002960 29 0d 20 31 35 33 30 20 20 20 20 20 20 20 20 20 |). 1530 | 00002970 4f 50 54 20 46 4e 65 71 75 62 28 28 63 79 61 6e |OPT FNequb((cyan| 00002980 72 65 64 2b 64 69 66 66 29 20 4d 4f 44 20 32 35 |red+diff) MOD 25| 00002990 36 29 0d 20 31 35 34 30 20 20 20 20 20 20 20 20 |6). 1540 | 000029a0 20 4f 50 54 20 46 4e 65 71 75 73 28 22 57 48 49 | OPT FNequs("WHI| 000029b0 42 4c 41 43 22 29 0d 20 31 35 35 30 20 20 20 20 |BLAC"). 1550 | 000029c0 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 62 28 | OPT FNequb(| 000029d0 28 77 68 69 62 6c 61 63 2b 64 69 66 66 29 20 44 |(whiblac+diff) D| 000029e0 49 56 20 32 35 36 29 0d 20 31 35 36 30 20 20 20 |IV 256). 1560 | 000029f0 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 62 | OPT FNequb| 00002a00 28 28 77 68 69 62 6c 61 63 2b 64 69 66 66 29 20 |((whiblac+diff) | 00002a10 4d 4f 44 20 32 35 36 29 0d 20 31 35 37 30 20 20 |MOD 256). 1570 | 00002a20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 | OPT FNequ| 00002a30 73 28 22 4d 41 47 45 4e 54 41 22 29 0d 20 31 35 |s("MAGENTA"). 15| 00002a40 38 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 |80 OPT F| 00002a50 4e 65 71 75 62 28 28 6d 61 67 65 6e 74 61 2b 64 |Nequb((magenta+d| 00002a60 69 66 66 29 20 44 49 56 20 32 35 36 29 0d 20 31 |iff) DIV 256). 1| 00002a70 35 39 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 |590 OPT | 00002a80 46 4e 65 71 75 62 28 28 6d 61 67 65 6e 74 61 2b |FNequb((magenta+| 00002a90 64 69 66 66 29 20 4d 4f 44 20 32 35 36 29 0d 20 |diff) MOD 256). | 00002aa0 31 36 30 30 20 20 20 20 20 20 20 20 20 4f 50 54 |1600 OPT| 00002ab0 20 46 4e 65 71 75 73 28 22 59 45 4c 4c 4f 57 22 | FNequs("YELLOW"| 00002ac0 29 0d 20 31 36 31 30 20 20 20 20 20 20 20 20 20 |). 1610 | 00002ad0 4f 50 54 20 46 4e 65 71 75 62 28 28 79 65 6c 6c |OPT FNequb((yell| 00002ae0 6f 77 2b 64 69 66 66 29 20 44 49 56 20 32 35 36 |ow+diff) DIV 256| 00002af0 29 0d 20 31 36 32 30 20 20 20 20 20 20 20 20 20 |). 1620 | 00002b00 4f 50 54 20 46 4e 65 71 75 62 28 28 79 65 6c 6c |OPT FNequb((yell| 00002b10 6f 77 2b 64 69 66 66 29 20 4d 4f 44 20 32 35 36 |ow+diff) MOD 256| 00002b20 29 0d 20 31 36 33 30 20 20 20 20 20 20 20 20 20 |). 1630 | 00002b30 4f 50 54 20 46 4e 65 71 75 73 28 22 57 48 49 54 |OPT FNequs("WHIT| 00002b40 45 22 29 0d 20 31 36 34 30 20 20 20 20 20 20 20 |E"). 1640 | 00002b50 20 20 4f 50 54 20 46 4e 65 71 75 62 28 28 77 68 | OPT FNequb((wh| 00002b60 69 74 65 2b 64 69 66 66 29 20 44 49 56 20 32 35 |ite+diff) DIV 25| 00002b70 36 29 0d 20 31 36 35 30 20 20 20 20 20 20 20 20 |6). 1650 | 00002b80 20 4f 50 54 20 46 4e 65 71 75 62 28 28 77 68 69 | OPT FNequb((whi| 00002b90 74 65 2b 64 69 66 66 29 20 4d 4f 44 20 32 35 36 |te+diff) MOD 256| 00002ba0 29 0d 20 31 36 36 30 20 20 20 20 20 20 20 20 20 |). 1660 | 00002bb0 4f 50 54 20 46 4e 65 71 75 73 28 22 47 52 45 45 |OPT FNequs("GREE| 00002bc0 4e 22 29 0d 20 31 36 37 30 20 20 20 20 20 20 20 |N"). 1670 | 00002bd0 20 20 4f 50 54 20 46 4e 65 71 75 62 28 28 67 72 | OPT FNequb((gr| 00002be0 65 65 6e 2b 64 69 66 66 29 20 44 49 56 20 32 35 |een+diff) DIV 25| 00002bf0 36 29 0d 20 31 36 38 30 20 20 20 20 20 20 20 20 |6). 1680 | 00002c00 20 4f 50 54 20 46 4e 65 71 75 62 28 28 67 72 65 | OPT FNequb((gre| 00002c10 65 6e 2b 64 69 66 66 29 20 4d 4f 44 20 32 35 36 |en+diff) MOD 256| 00002c20 29 0d 20 31 36 39 30 20 20 20 20 20 20 20 20 20 |). 1690 | 00002c30 4f 50 54 20 46 4e 65 71 75 73 28 22 42 4c 41 43 |OPT FNequs("BLAC| 00002c40 4b 22 29 0d 20 31 37 30 30 20 20 20 20 20 20 20 |K"). 1700 | 00002c50 20 20 4f 50 54 20 46 4e 65 71 75 62 28 28 62 6c | OPT FNequb((bl| 00002c60 61 63 6b 2b 64 69 66 66 29 20 44 49 56 20 32 35 |ack+diff) DIV 25| 00002c70 36 29 0d 20 31 37 31 30 20 20 20 20 20 20 20 20 |6). 1710 | 00002c80 20 4f 50 54 20 46 4e 65 71 75 62 28 28 62 6c 61 | OPT FNequb((bla| 00002c90 63 6b 2b 64 69 66 66 29 20 4d 4f 44 20 32 35 36 |ck+diff) MOD 256| 00002ca0 29 0d 20 31 37 32 30 20 20 20 20 20 20 20 20 20 |). 1720 | 00002cb0 4f 50 54 20 46 4e 65 71 75 73 28 22 43 59 41 4e |OPT FNequs("CYAN| 00002cc0 22 29 0d 20 31 37 33 30 20 20 20 20 20 20 20 20 |"). 1730 | 00002cd0 20 4f 50 54 20 46 4e 65 71 75 62 28 28 63 79 61 | OPT FNequb((cya| 00002ce0 6e 2b 64 69 66 66 29 20 44 49 56 20 32 35 36 29 |n+diff) DIV 256)| 00002cf0 0d 20 31 37 34 30 20 20 20 20 20 20 20 20 20 4f |. 1740 O| 00002d00 50 54 20 46 4e 65 71 75 62 28 28 63 79 61 6e 2b |PT FNequb((cyan+| 00002d10 64 69 66 66 29 20 4d 4f 44 20 32 35 36 29 0d 20 |diff) MOD 256). | 00002d20 31 37 35 30 20 20 20 20 20 20 20 20 20 4f 50 54 |1750 OPT| 00002d30 20 46 4e 65 71 75 73 28 22 42 4c 55 45 22 29 0d | FNequs("BLUE").| 00002d40 20 31 37 36 30 20 20 20 20 20 20 20 20 20 4f 50 | 1760 OP| 00002d50 54 20 46 4e 65 71 75 62 28 28 62 6c 75 65 2b 64 |T FNequb((blue+d| 00002d60 69 66 66 29 20 44 49 56 20 32 35 36 29 0d 20 31 |iff) DIV 256). 1| 00002d70 37 37 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 |770 OPT | 00002d80 46 4e 65 71 75 62 28 28 62 6c 75 65 2b 64 69 66 |FNequb((blue+dif| 00002d90 66 29 20 4d 4f 44 20 32 35 36 29 0d 20 31 37 38 |f) MOD 256). 178| 00002da0 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e |0 OPT FN| 00002db0 65 71 75 73 28 22 52 45 44 22 29 0d 20 31 37 39 |equs("RED"). 179| 00002dc0 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e |0 OPT FN| 00002dd0 65 71 75 62 28 28 72 65 64 2b 64 69 66 66 29 20 |equb((red+diff) | 00002de0 44 49 56 20 32 35 36 29 0d 20 31 38 30 30 20 20 |DIV 256). 1800 | 00002df0 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 | OPT FNequ| 00002e00 62 28 28 72 65 64 2b 64 69 66 66 29 20 4d 4f 44 |b((red+diff) MOD| 00002e10 20 32 35 36 29 0d 20 31 38 31 30 20 20 20 20 20 | 256). 1810 | 00002e20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 62 28 26 | OPT FNequb(&| 00002e30 46 46 29 0d 20 31 38 32 30 20 2e 68 65 6c 70 6d |FF). 1820 .helpm| 00002e40 73 67 0d 20 31 38 33 30 20 20 20 20 20 20 20 20 |sg. 1830 | 00002e50 20 4f 50 54 20 46 4e 65 71 75 62 28 26 30 44 29 | OPT FNequb(&0D)| 00002e60 0d 20 31 38 34 30 20 20 20 20 20 20 20 20 20 4f |. 1840 O| 00002e70 50 54 20 46 4e 65 71 75 73 28 22 43 4f 4c 4f 55 |PT FNequs("COLOU| 00002e80 52 45 44 20 54 45 58 54 22 29 0d 20 31 38 35 30 |RED TEXT"). 1850| 00002e90 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 | OPT FNe| 00002ea0 71 75 62 28 26 30 44 29 0d 20 31 38 36 30 20 20 |qub(&0D). 1860 | 00002eb0 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 | OPT FNequ| 00002ec0 77 28 26 32 30 32 30 29 0d 20 31 38 37 30 20 2e |w(&2020). 1870 .| 00002ed0 68 65 6c 70 74 69 74 6c 65 0d 20 31 38 38 30 20 |helptitle. 1880 | 00002ee0 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 | OPT FNeq| 00002ef0 75 73 28 22 43 4f 4c 4f 55 52 53 22 29 0d 20 31 |us("COLOURS"). 1| 00002f00 38 39 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 |890 OPT | 00002f10 46 4e 65 71 75 77 28 26 30 44 46 46 29 0d 20 31 |FNequw(&0DFF). 1| 00002f20 39 30 30 20 20 20 20 20 20 20 20 20 42 52 4b 0d |900 BRK.| 00002f30 20 31 39 31 30 20 2e 68 65 6c 70 69 6e 66 6f 0d | 1910 .helpinfo.| 00002f40 20 31 39 32 30 20 20 20 20 20 20 20 20 20 4f 50 | 1920 OP| 00002f50 54 20 46 4e 65 71 75 77 28 26 32 30 30 44 29 0d |T FNequw(&200D).| 00002f60 20 31 39 33 30 20 20 20 20 20 20 20 20 20 4f 50 | 1930 OP| 00002f70 54 20 46 4e 65 71 75 73 28 22 2a 42 4c 41 43 4b |T FNequs("*BLACK| 00002f80 22 29 0d 20 31 39 34 30 20 20 20 20 20 20 20 20 |"). 1940 | 00002f90 20 4f 50 54 20 46 4e 65 71 75 77 28 26 32 30 30 | OPT FNequw(&200| 00002fa0 44 29 0d 20 31 39 35 30 20 20 20 20 20 20 20 20 |D). 1950 | 00002fb0 20 4f 50 54 20 46 4e 65 71 75 73 28 22 2a 52 45 | OPT FNequs("*RE| 00002fc0 44 22 29 0d 20 31 39 36 30 20 20 20 20 20 20 20 |D"). 1960 | 00002fd0 20 20 4f 50 54 20 46 4e 65 71 75 77 28 26 32 30 | OPT FNequw(&20| 00002fe0 30 44 29 0d 20 31 39 37 30 20 20 20 20 20 20 20 |0D). 1970 | 00002ff0 20 20 4f 50 54 20 46 4e 65 71 75 73 28 22 2a 47 | OPT FNequs("*G| 00003000 52 45 45 4e 22 29 0d 20 31 39 38 30 20 20 20 20 |REEN"). 1980 | 00003010 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 77 28 | OPT FNequw(| 00003020 26 32 30 30 44 29 0d 20 31 39 39 30 20 20 20 20 |&200D). 1990 | 00003030 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 73 28 | OPT FNequs(| 00003040 22 2a 59 45 4c 4c 4f 57 22 29 0d 20 32 30 30 30 |"*YELLOW"). 2000| 00003050 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 | OPT FNe| 00003060 71 75 77 28 26 32 30 30 44 29 0d 20 32 30 31 30 |quw(&200D). 2010| 00003070 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 | OPT FNe| 00003080 71 75 73 28 22 2a 42 4c 55 45 22 29 0d 20 32 30 |qus("*BLUE"). 20| 00003090 32 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 |20 OPT F| 000030a0 4e 65 71 75 77 28 26 32 30 30 44 29 0d 20 32 30 |Nequw(&200D). 20| 000030b0 33 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 |30 OPT F| 000030c0 4e 65 71 75 73 28 22 2a 4d 41 47 45 4e 54 41 22 |Nequs("*MAGENTA"| 000030d0 29 0d 20 32 30 34 30 20 20 20 20 20 20 20 20 20 |). 2040 | 000030e0 4f 50 54 20 46 4e 65 71 75 77 28 26 32 30 30 44 |OPT FNequw(&200D| 000030f0 29 0d 20 32 30 35 30 20 20 20 20 20 20 20 20 20 |). 2050 | 00003100 4f 50 54 20 46 4e 65 71 75 73 28 22 2a 43 59 41 |OPT FNequs("*CYA| 00003110 4e 22 29 0d 20 32 30 36 30 20 20 20 20 20 20 20 |N"). 2060 | 00003120 20 20 4f 50 54 20 46 4e 65 71 75 77 28 26 32 30 | OPT FNequw(&20| 00003130 30 44 29 0d 20 32 30 37 30 20 20 20 20 20 20 20 |0D). 2070 | 00003140 20 20 4f 50 54 20 46 4e 65 71 75 73 28 22 2a 57 | OPT FNequs("*W| 00003150 48 49 54 45 22 29 0d 20 32 30 38 30 20 20 20 20 |HITE"). 2080 | 00003160 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 77 28 | OPT FNequw(| 00003170 26 32 30 30 44 29 0d 20 32 30 39 30 20 20 20 20 |&200D). 2090 | 00003180 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 73 28 | OPT FNequs(| 00003190 22 2a 42 4c 41 57 48 49 54 22 29 0d 20 32 31 30 |"*BLAWHIT"). 210| 000031a0 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e |0 OPT FN| 000031b0 65 71 75 77 28 26 32 30 30 44 29 0d 20 32 31 31 |equw(&200D). 211| 000031c0 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e |0 OPT FN| 000031d0 65 71 75 73 28 22 2a 52 45 44 43 59 41 4e 22 29 |equs("*REDCYAN")| 000031e0 0d 20 32 31 32 30 20 20 20 20 20 20 20 20 20 4f |. 2120 O| 000031f0 50 54 20 46 4e 65 71 75 77 28 26 32 30 30 44 29 |PT FNequw(&200D)| 00003200 0d 20 32 31 33 30 20 20 20 20 20 20 20 20 20 4f |. 2130 O| 00003210 50 54 20 46 4e 65 71 75 73 28 22 2a 47 52 45 45 |PT FNequs("*GREE| 00003220 4d 41 47 22 29 0d 20 32 31 34 30 20 20 20 20 20 |MAG"). 2140 | 00003230 20 20 20 20 4f 50 54 20 46 4e 65 71 75 77 28 26 | OPT FNequw(&| 00003240 32 30 30 44 29 0d 20 32 31 35 30 20 20 20 20 20 |200D). 2150 | 00003250 20 20 20 20 4f 50 54 20 46 4e 65 71 75 73 28 22 | OPT FNequs("| 00003260 2a 59 45 4c 4c 42 4c 55 22 29 0d 20 32 31 36 30 |*YELLBLU"). 2160| 00003270 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 | OPT FNe| 00003280 71 75 77 28 26 32 30 30 44 29 0d 20 32 31 37 30 |quw(&200D). 2170| 00003290 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 | OPT FNe| 000032a0 71 75 73 28 22 2a 42 4c 55 59 45 4c 4c 22 29 0d |qus("*BLUYELL").| 000032b0 20 32 31 38 30 20 20 20 20 20 20 20 20 20 4f 50 | 2180 OP| 000032c0 54 20 46 4e 65 71 75 77 28 26 32 30 30 44 29 0d |T FNequw(&200D).| 000032d0 20 32 31 39 30 20 20 20 20 20 20 20 20 20 4f 50 | 2190 OP| 000032e0 54 20 46 4e 65 71 75 73 28 22 2a 4d 41 47 52 45 |T FNequs("*MAGRE| 000032f0 45 4e 22 29 0d 20 32 32 30 30 20 20 20 20 20 20 |EN"). 2200 | 00003300 20 20 20 4f 50 54 20 46 4e 65 71 75 77 28 26 32 | OPT FNequw(&2| 00003310 30 30 44 29 0d 20 32 32 31 30 20 20 20 20 20 20 |00D). 2210 | 00003320 20 20 20 4f 50 54 20 46 4e 65 71 75 73 28 22 2a | OPT FNequs("*| 00003330 43 59 41 4e 52 45 44 22 29 0d 20 32 32 32 30 20 |CYANRED"). 2220 | 00003340 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 | OPT FNeq| 00003350 75 77 28 26 32 30 30 44 29 0d 20 32 32 33 30 20 |uw(&200D). 2230 | 00003360 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 | OPT FNeq| 00003370 75 73 28 22 2a 57 48 49 42 4c 41 43 22 29 0d 20 |us("*WHIBLAC"). | 00003380 32 32 34 30 20 20 20 20 20 20 20 20 20 4f 50 54 |2240 OPT| 00003390 20 46 4e 65 71 75 77 28 26 30 30 30 44 29 0d 20 | FNequw(&000D). | 000033a0 32 32 35 30 20 2e 70 72 69 6e 74 65 72 0d 20 32 |2250 .printer. 2| 000033b0 32 36 30 20 20 20 20 20 20 20 20 20 53 54 58 20 |260 STX | 000033c0 61 64 64 72 65 73 73 0d 20 32 32 37 30 20 20 20 |address. 2270 | 000033d0 20 20 20 20 20 20 53 54 59 20 61 64 64 72 65 73 | STY addres| 000033e0 73 2b 31 0d 20 32 32 38 30 20 20 20 20 20 20 20 |s+1. 2280 | 000033f0 20 20 4c 44 59 20 23 26 46 46 0d 20 32 32 39 30 | LDY #&FF. 2290| 00003400 20 2e 70 72 69 6e 74 6c 6f 6f 70 0d 20 32 33 30 | .printloop. 230| 00003410 30 20 20 20 20 20 20 20 20 20 49 4e 59 0d 20 32 |0 INY. 2| 00003420 33 31 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 |310 LDA | 00003430 28 61 64 64 72 65 73 73 29 2c 59 0d 20 32 33 32 |(address),Y. 232| 00003440 30 20 20 20 20 20 20 20 20 20 42 45 51 20 65 6e |0 BEQ en| 00003450 64 70 72 69 6e 74 0d 20 32 33 33 30 20 20 20 20 |dprint. 2330 | 00003460 20 20 20 20 20 42 4d 49 20 70 72 69 6e 74 6c 6f | BMI printlo| 00003470 6f 70 0d 20 32 33 34 30 20 20 20 20 20 20 20 20 |op. 2340 | 00003480 20 4a 53 52 20 6f 73 61 73 63 69 0d 20 32 33 35 | JSR osasci. 235| 00003490 30 20 20 20 20 20 20 20 20 20 4a 4d 50 20 70 72 |0 JMP pr| 000034a0 69 6e 74 6c 6f 6f 70 2b 64 69 66 66 0d 20 32 33 |intloop+diff. 23| 000034b0 36 30 20 2e 65 6e 64 70 72 69 6e 74 0d 20 32 33 |60 .endprint. 23| 000034c0 37 30 20 20 20 20 20 20 20 20 20 52 54 53 0d 20 |70 RTS. | 000034d0 32 33 38 30 20 2e 62 6c 61 63 6b 0d 20 32 33 39 |2380 .black. 239| 000034e0 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 30 |0 LDA #0| 000034f0 0d 20 32 34 30 30 20 20 20 20 20 20 20 20 20 42 |. 2400 B| 00003500 45 51 20 6d 6f 64 65 0d 20 32 34 31 30 20 2e 72 |EQ mode. 2410 .r| 00003510 65 64 0d 20 32 34 32 30 20 20 20 20 20 20 20 20 |ed. 2420 | 00003520 20 4c 44 41 20 23 31 0d 20 32 34 33 30 20 20 20 | LDA #1. 2430 | 00003530 20 20 20 20 20 20 42 4e 45 20 6d 6f 64 65 0d 20 | BNE mode. | 00003540 32 34 34 30 20 2e 67 72 65 65 6e 0d 20 32 34 35 |2440 .green. 245| 00003550 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 32 |0 LDA #2| 00003560 0d 20 32 34 36 30 20 20 20 20 20 20 20 20 20 42 |. 2460 B| 00003570 4e 45 20 6d 6f 64 65 0d 20 32 34 37 30 20 2e 79 |NE mode. 2470 .y| 00003580 65 6c 6c 6f 77 0d 20 32 34 38 30 20 20 20 20 20 |ellow. 2480 | 00003590 20 20 20 20 4c 44 41 20 23 33 0d 20 32 34 39 30 | LDA #3. 2490| 000035a0 20 20 20 20 20 20 20 20 20 42 4e 45 20 6d 6f 64 | BNE mod| 000035b0 65 0d 20 32 35 30 30 20 2e 62 6c 75 65 0d 20 32 |e. 2500 .blue. 2| 000035c0 35 31 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 |510 LDA | 000035d0 23 34 0d 20 32 35 32 30 20 20 20 20 20 20 20 20 |#4. 2520 | 000035e0 20 42 4e 45 20 6d 6f 64 65 0d 20 32 35 33 30 20 | BNE mode. 2530 | 000035f0 2e 6d 61 67 65 6e 74 61 0d 20 32 35 34 30 20 20 |.magenta. 2540 | 00003600 20 20 20 20 20 20 20 4c 44 41 20 23 35 0d 20 32 | LDA #5. 2| 00003610 35 35 30 20 20 20 20 20 20 20 20 20 42 4e 45 20 |550 BNE | 00003620 6d 6f 64 65 0d 20 32 35 36 30 20 2e 63 79 61 6e |mode. 2560 .cyan| 00003630 0d 20 32 35 37 30 20 20 20 20 20 20 20 20 20 4c |. 2570 L| 00003640 44 41 20 23 36 0d 20 32 35 38 30 20 20 20 20 20 |DA #6. 2580 | 00003650 20 20 20 20 42 4e 45 20 6d 6f 64 65 0d 20 32 35 | BNE mode. 25| 00003660 39 30 20 2e 77 68 69 74 65 0d 20 32 36 30 30 20 |90 .white. 2600 | 00003670 20 20 20 20 20 20 20 20 4c 44 41 20 23 37 0d 20 | LDA #7. | 00003680 32 36 31 30 20 20 20 20 20 20 20 20 20 42 4e 45 |2610 BNE| 00003690 20 6d 6f 64 65 0d 20 32 36 32 30 20 2e 62 6c 61 | mode. 2620 .bla| 000036a0 77 68 69 74 0d 20 32 36 33 30 20 20 20 20 20 20 |whit. 2630 | 000036b0 20 20 20 4c 44 41 20 23 38 0d 20 32 36 34 30 20 | LDA #8. 2640 | 000036c0 20 20 20 20 20 20 20 20 42 4e 45 20 6d 6f 64 65 | BNE mode| 000036d0 0d 20 32 36 35 30 20 2e 72 65 64 63 79 61 6e 0d |. 2650 .redcyan.| 000036e0 20 32 36 36 30 20 20 20 20 20 20 20 20 20 4c 44 | 2660 LD| 000036f0 41 20 23 39 0d 20 32 36 37 30 20 20 20 20 20 20 |A #9. 2670 | 00003700 20 20 20 42 4e 45 20 6d 6f 64 65 0d 20 32 36 38 | BNE mode. 268| 00003710 30 20 2e 67 72 65 65 6d 61 67 0d 20 32 36 39 30 |0 .greemag. 2690| 00003720 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 31 30 | LDA #10| 00003730 0d 20 32 37 30 30 20 20 20 20 20 20 20 20 20 42 |. 2700 B| 00003740 4e 45 20 6d 6f 64 65 0d 20 32 37 31 30 20 2e 79 |NE mode. 2710 .y| 00003750 65 6c 6c 62 6c 75 0d 20 32 37 32 30 20 20 20 20 |ellblu. 2720 | 00003760 20 20 20 20 20 4c 44 41 20 23 31 31 0d 20 32 37 | LDA #11. 27| 00003770 33 30 20 20 20 20 20 20 20 20 20 42 4e 45 20 6d |30 BNE m| 00003780 6f 64 65 0d 20 32 37 34 30 20 2e 62 6c 75 79 65 |ode. 2740 .bluye| 00003790 6c 6c 0d 20 32 37 35 30 20 20 20 20 20 20 20 20 |ll. 2750 | 000037a0 20 4c 44 41 20 23 31 32 0d 20 32 37 36 30 20 20 | LDA #12. 2760 | 000037b0 20 20 20 20 20 20 20 42 4e 45 20 6d 6f 64 65 0d | BNE mode.| 000037c0 20 32 37 37 30 20 2e 6d 61 67 72 65 65 6e 0d 20 | 2770 .magreen. | 000037d0 32 37 38 30 20 20 20 20 20 20 20 20 20 4c 44 41 |2780 LDA| 000037e0 20 23 31 33 0d 20 32 37 39 30 20 20 20 20 20 20 | #13. 2790 | 000037f0 20 20 20 42 4e 45 20 6d 6f 64 65 0d 20 32 38 30 | BNE mode. 280| 00003800 30 20 2e 63 79 61 6e 72 65 64 0d 20 32 38 31 30 |0 .cyanred. 2810| 00003810 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 31 34 | LDA #14| 00003820 0d 20 32 38 32 30 20 20 20 20 20 20 20 20 20 42 |. 2820 B| 00003830 4e 45 20 6d 6f 64 65 0d 20 32 38 33 30 20 2e 77 |NE mode. 2830 .w| 00003840 68 69 62 6c 61 63 0d 20 32 38 34 30 20 20 20 20 |hiblac. 2840 | 00003850 20 20 20 20 20 4c 44 41 20 23 31 35 0d 20 32 38 | LDA #15. 28| 00003860 35 30 20 2e 6d 6f 64 65 0d 20 32 38 36 30 20 20 |50 .mode. 2860 | 00003870 20 20 20 20 20 20 20 50 48 41 0d 20 32 38 37 30 | PHA. 2870| 00003880 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 26 38 | LDA #&8| 00003890 37 0d 20 32 38 38 30 20 20 20 20 20 20 20 20 20 |7. 2880 | 000038a0 4a 53 52 20 6f 73 62 79 74 65 20 20 20 20 5c 20 |JSR osbyte \ | 000038b0 43 68 65 63 6b 20 73 63 72 65 65 6e 20 6d 6f 64 |Check screen mod| 000038c0 65 0d 20 32 38 39 30 20 20 20 20 20 20 20 20 20 |e. 2890 | 000038d0 43 50 59 20 23 37 0d 20 32 39 30 30 20 20 20 20 |CPY #7. 2900 | 000038e0 20 20 20 20 20 42 4e 45 20 6d 6f 64 65 30 74 6f | BNE mode0to| 000038f0 36 0d 20 32 39 31 30 20 20 20 20 20 20 20 20 20 |6. 2910 | 00003900 50 4c 41 0d 20 32 39 32 30 20 20 20 20 20 20 20 |PLA. 2920 | 00003910 20 20 4c 44 41 20 23 28 77 72 6f 6e 67 6d 6f 64 | LDA #(wrongmod| 00003920 65 2b 64 69 66 66 29 20 4d 4f 44 20 32 35 36 0d |e+diff) MOD 256.| 00003930 20 32 39 33 30 20 20 20 20 20 20 20 20 20 53 54 | 2930 ST| 00003940 41 20 61 64 64 72 65 73 73 0d 20 32 39 34 30 20 |A address. 2940 | 00003950 20 20 20 20 20 20 20 20 4c 44 41 20 23 28 77 72 | LDA #(wr| 00003960 6f 6e 67 6d 6f 64 65 2b 64 69 66 66 29 20 44 49 |ongmode+diff) DI| 00003970 56 20 32 35 36 0d 20 32 39 35 30 20 20 20 20 20 |V 256. 2950 | 00003980 20 20 20 20 53 54 41 20 61 64 64 72 65 73 73 2b | STA address+| 00003990 31 0d 20 32 39 36 30 20 20 20 20 20 20 20 20 20 |1. 2960 | 000039a0 4c 44 59 20 23 26 46 46 0d 20 32 39 37 30 20 2e |LDY #&FF. 2970 .| 000039b0 65 72 72 6f 72 6c 6f 6f 70 0d 20 32 39 38 30 20 |errorloop. 2980 | 000039c0 20 20 20 20 20 20 20 20 49 4e 59 0d 20 32 39 39 | INY. 299| 000039d0 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 28 61 |0 LDA (a| 000039e0 64 64 72 65 73 73 29 2c 59 0d 20 33 30 30 30 20 |ddress),Y. 3000 | 000039f0 20 20 20 20 20 20 20 20 53 54 41 20 65 72 72 73 | STA errs| 00003a00 74 61 63 6b 2c 59 0d 20 33 30 31 30 20 20 20 20 |tack,Y. 3010 | 00003a10 20 20 20 20 20 42 50 4c 20 65 72 72 6f 72 6c 6f | BPL errorlo| 00003a20 6f 70 0d 20 33 30 32 30 20 20 20 20 20 20 20 20 |op. 3020 | 00003a30 20 50 4c 41 0d 20 33 30 33 30 20 20 20 20 20 20 | PLA. 3030 | 00003a40 20 20 20 53 54 41 20 61 64 64 72 65 73 73 2b 31 | STA address+1| 00003a50 0d 20 33 30 34 30 20 20 20 20 20 20 20 20 20 50 |. 3040 P| 00003a60 4c 41 0d 20 33 30 35 30 20 20 20 20 20 20 20 20 |LA. 3050 | 00003a70 20 53 54 41 20 61 64 64 72 65 73 73 0d 20 33 30 | STA address. 30| 00003a80 36 30 20 20 20 20 20 20 20 20 20 4a 4d 50 20 65 |60 JMP e| 00003a90 72 72 73 74 61 63 6b 0d 20 33 30 37 30 20 2e 6d |rrstack. 3070 .m| 00003aa0 6f 64 65 30 74 6f 36 0d 20 33 30 38 30 20 20 20 |ode0to6. 3080 | 00003ab0 20 20 20 20 20 20 4c 44 41 20 63 6f 6c 6f 75 72 | LDA colour| 00003ac0 73 2b 64 69 66 66 2c 59 0d 20 33 30 39 30 20 20 |s+diff,Y. 3090 | 00003ad0 20 20 20 20 20 20 20 50 48 41 0d 20 33 31 30 30 | PHA. 3100| 00003ae0 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 31 39 | LDA #19| 00003af0 0d 20 33 31 31 30 20 20 20 20 20 20 20 20 20 4a |. 3110 J| 00003b00 53 52 20 6f 73 61 73 63 69 0d 20 33 31 32 30 20 |SR osasci. 3120 | 00003b10 20 20 20 20 20 20 20 20 50 4c 41 0d 20 33 31 33 | PLA. 313| 00003b20 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 6f 73 |0 JSR os| 00003b30 61 73 63 69 0d 20 33 31 34 30 20 20 20 20 20 20 |asci. 3140 | 00003b40 20 20 20 50 4c 41 0d 20 33 31 35 30 20 20 20 20 | PLA. 3150 | 00003b50 20 20 20 20 20 4a 53 52 20 6f 73 61 73 63 69 0d | JSR osasci.| 00003b60 20 33 31 36 30 20 20 20 20 20 20 20 20 20 4c 44 | 3160 LD| 00003b70 41 20 23 30 0d 20 33 31 37 30 20 20 20 20 20 20 |A #0. 3170 | 00003b80 20 20 20 4a 53 52 20 6f 73 61 73 63 69 0d 20 33 | JSR osasci. 3| 00003b90 31 38 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 |180 JSR | 00003ba0 6f 73 61 73 63 69 0d 20 33 31 39 30 20 20 20 20 |osasci. 3190 | 00003bb0 20 20 20 20 20 4a 53 52 20 6f 73 61 73 63 69 0d | JSR osasci.| 00003bc0 20 33 32 30 30 20 2e 70 75 6c 6c 6f 75 74 0d 20 | 3200 .pullout. | 00003bd0 33 32 31 30 20 20 20 20 20 20 20 20 20 50 4c 41 |3210 PLA| 00003be0 0d 20 33 32 32 30 20 20 20 20 20 20 20 20 20 53 |. 3220 S| 00003bf0 54 41 20 61 64 64 72 65 73 73 2b 31 0d 20 33 32 |TA address+1. 32| 00003c00 33 30 20 20 20 20 20 20 20 20 20 50 4c 41 0d 20 |30 PLA. | 00003c10 33 32 34 30 20 20 20 20 20 20 20 20 20 53 54 41 |3240 STA| 00003c20 20 61 64 64 72 65 73 73 0d 20 33 32 35 30 20 20 | address. 3250 | 00003c30 20 20 20 20 20 20 20 50 4c 41 0d 20 33 32 36 30 | PLA. 3260| 00003c40 20 20 20 20 20 20 20 20 20 50 4c 41 0d 20 33 32 | PLA. 32| 00003c50 37 30 20 20 20 20 20 20 20 20 20 50 4c 41 0d 20 |70 PLA. | 00003c60 33 32 38 30 20 20 20 20 20 20 20 20 20 4c 44 41 |3280 LDA| 00003c70 20 23 30 0d 20 33 32 39 30 20 20 20 20 20 20 20 | #0. 3290 | 00003c80 20 20 52 54 53 0d 20 33 33 30 30 20 2e 63 6f 6c | RTS. 3300 .col| 00003c90 6f 75 72 73 0d 20 33 33 31 30 20 20 20 20 20 20 |ours. 3310 | 00003ca0 20 20 20 4f 50 54 20 46 4e 65 71 75 64 28 26 30 | OPT FNequd(&0| 00003cb0 31 30 37 30 33 30 31 29 0d 20 33 33 32 30 20 20 |1070301). 3320 | 00003cc0 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 | OPT FNequ| 00003cd0 77 28 26 30 33 30 31 29 0d 20 33 33 33 30 20 20 |w(&0301). 3330 | 00003ce0 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 | OPT FNequ| 00003cf0 62 28 26 30 31 29 0d 20 33 33 34 30 20 2e 77 72 |b(&01). 3340 .wr| 00003d00 6f 6e 67 6d 6f 64 65 0d 20 33 33 35 30 20 20 20 |ongmode. 3350 | 00003d10 20 20 20 20 20 20 42 52 4b 0d 20 33 33 36 30 20 | BRK. 3360 | 00003d20 20 20 20 20 20 20 20 20 42 52 4b 0d 20 33 33 37 | BRK. 337| 00003d30 30 20 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e |0 OPT FN| 00003d40 65 71 75 73 28 22 4d 6f 64 65 73 20 30 2d 36 20 |equs("Modes 0-6 | 00003d50 6f 6e 6c 79 22 29 0d 20 33 33 38 30 20 20 20 20 |only"). 3380 | 00003d60 20 20 20 20 20 42 52 4b 0d 20 33 33 39 30 20 20 | BRK. 3390 | 00003d70 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 75 | OPT FNequ| 00003d80 62 28 26 46 46 29 0d 20 33 34 30 30 20 2e 6c 61 |b(&FF). 3400 .la| 00003d90 73 74 62 79 74 65 0d 20 33 34 31 30 20 5d 0d 20 |stbyte. 3410 ]. | 00003da0 33 34 32 30 20 4e 45 58 54 0d 20 33 34 33 30 20 |3420 NEXT. 3430 | 00003db0 49 4e 50 55 54 27 22 53 61 76 65 20 66 69 6c 65 |INPUT'"Save file| 00003dc0 6e 61 6d 65 20 3d 20 22 66 69 6c 65 6e 61 6d 65 |name = "filename| 00003dd0 24 0d 20 33 34 34 30 20 49 46 20 66 69 6c 65 6e |$. 3440 IF filen| 00003de0 61 6d 65 24 3d 22 22 20 45 4e 44 0d 20 33 34 35 |ame$="" END. 345| 00003df0 30 20 24 73 61 76 65 3d 22 53 41 56 45 20 22 2b |0 $save="SAVE "+| 00003e00 66 69 6c 65 6e 61 6d 65 24 2b 22 20 22 2b 53 54 |filename$+" "+ST| 00003e10 52 24 7e 28 48 49 4d 45 4d 29 2b 22 20 22 2b 53 |R$~(HIMEM)+" "+S| 00003e20 54 52 24 7e 28 6c 61 73 0d 20 20 20 20 20 20 74 |TR$~(las. t| 00003e30 62 79 74 65 29 2b 22 20 46 46 46 46 38 30 30 30 |byte)+" FFFF8000| 00003e40 20 46 46 46 46 38 30 30 30 22 0d 20 33 34 36 30 | FFFF8000". 3460| 00003e50 20 58 25 3d 73 61 76 65 20 4d 4f 44 20 32 35 36 | X%=save MOD 256| 00003e60 0d 20 33 34 37 30 20 59 25 3d 73 61 76 65 20 44 |. 3470 Y%=save D| 00003e70 49 56 20 32 35 36 0d 20 33 34 38 30 20 2a 4f 50 |IV 256. 3480 *OP| 00003e80 54 31 2c 32 0d 20 33 34 39 30 20 43 41 4c 4c 20 |T1,2. 3490 CALL | 00003e90 6f 73 63 6c 69 0d 20 33 35 30 30 20 2a 4f 50 54 |oscli. 3500 *OPT| 00003ea0 31 2c 30 0d 20 33 35 31 30 20 45 4e 44 0d 20 33 |1,0. 3510 END. 3| 00003eb0 35 32 30 20 44 45 46 46 4e 65 71 75 62 28 62 79 |520 DEFFNequb(by| 00003ec0 74 65 29 0d 20 33 35 33 30 20 3f 50 25 3d 62 79 |te). 3530 ?P%=by| 00003ed0 74 65 0d 20 33 35 34 30 20 50 25 3d 50 25 2b 31 |te. 3540 P%=P%+1| 00003ee0 0d 20 33 35 35 30 20 3d 70 61 73 73 0d 20 33 35 |. 3550 =pass. 35| 00003ef0 36 30 20 44 45 46 46 4e 65 71 75 77 28 77 6f 72 |60 DEFFNequw(wor| 00003f00 64 29 0d 20 33 35 37 30 20 3f 50 25 3d 77 6f 72 |d). 3570 ?P%=wor| 00003f10 64 20 4d 4f 44 20 32 35 36 0d 20 33 35 38 30 20 |d MOD 256. 3580 | 00003f20 50 25 3f 31 3d 77 6f 72 64 20 44 49 56 20 32 35 |P%?1=word DIV 25| 00003f30 36 0d 20 33 35 39 30 20 50 25 3d 50 25 2b 32 0d |6. 3590 P%=P%+2.| 00003f40 20 33 36 30 30 20 3d 70 61 73 73 0d 20 33 36 31 | 3600 =pass. 361| 00003f50 30 20 44 45 46 46 4e 65 71 75 64 28 64 6f 75 62 |0 DEFFNequd(doub| 00003f60 6c 65 29 0d 20 33 36 32 30 20 21 50 25 3d 64 6f |le). 3620 !P%=do| 00003f70 75 62 6c 65 0d 20 33 36 33 30 20 50 25 3d 50 25 |uble. 3630 P%=P%| 00003f80 2b 34 0d 20 33 36 34 30 20 3d 70 61 73 73 0d 20 |+4. 3640 =pass. | 00003f90 33 36 35 30 20 44 45 46 46 4e 65 71 75 73 28 73 |3650 DEFFNequs(s| 00003fa0 74 72 69 6e 67 24 29 0d 20 33 36 36 30 20 24 50 |tring$). 3660 $P| 00003fb0 25 3d 73 74 72 69 6e 67 24 0d 20 33 36 37 30 20 |%=string$. 3670 | 00003fc0 50 25 3d 50 25 2b 4c 45 4e 28 73 74 72 69 6e 67 |P%=P%+LEN(string| 00003fd0 24 29 0d 20 33 36 38 30 20 3d 70 61 73 73 0d |$). 3680 =pass.| 00003fdf