Home » Archimedes archive » Acorn User » AU 1996-03 B.adf » Regulars » StarInfo/Fletcher/!SpaceFile/PatchBas
StarInfo/Fletcher/!SpaceFile/PatchBas
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 » Archimedes archive » Acorn User » AU 1996-03 B.adf » Regulars |
Filename: | StarInfo/Fletcher/!SpaceFile/PatchBas |
Read OK: | ✔ |
File size: | 17F7 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM > Patch for memory compilation 20REM Created by JFPatch LEN Justin Fletcher, 05 Sep 1995 30REM Intermediate code file created 23 Sep 1995 40ON ERROR PROCError:END 50PROCpatch_loadfile 60: 70REM **** User pre-assembly **** 80 PRINT "Do you want to change underlines to spaces ? (y/n) "; 90 REPEAT:SYS "OS_Confirm" TO g:g$=CHR$g:UNTILINSTR("yn",g$)>0 100 PRINTg$ 110 cond_underline=INSTR("yY",g$)>0 120: 130REM **** Main assembly routine **** 140sp=13:link=14:pc=15 150vbit=1<<28:cbit=1<<29:zbit=1<<30:nbit=1<<31 160P%=&0:O%=MC% 170FOR pass%=4 TO 6 STEP2 180REM **** Start of main code **** 190PROCpatch_setpc(0) 200[OPT pass% 210 ; **** Add module header **** 220 EQUD 0 ; Start offset 230 EQUD module_init ; Initialisation offset 240 EQUD module_final ; Finalisation offset 250 EQUD module_service ; Service request offset 260 EQUD module_title ; Title string offset 270 EQUD module_help ; Help string offset 280 EQUD module_commands ; Help and command keyword table offset 290: 300.module_title 310 EQUS "SpacedFiles"+CHR$0 320 ALIGN 330: 340.module_help 350 EQUS "Spaced filenames"+CHR$9+"1.00 ("+MID$(TIME$,5,11)+") � Justin Fletcher"+CHR$0 360 ALIGN 370: 380.module_service 390 LDR r12,[r12] 400 CMP r1,#&87 410 BEQ mod_svc_newfiltermgr 420._mod_svc_return 430 MOVS pc,link 440: 450.mod_svc_newfiltermgr 460 STMFD (sp)!,{r0-r4,link} ; Stack registers 470 BL mod_set_PostFilter 480 SWI "Filter_RegisterPostFilter" 490 LDMFD (sp)!,{r0-r4,link} 500 B _mod_svc_return 510: 520.module_init 530 STMFD (sp)!,{r0-r4,link} ; Stack registers 540 BL mod_set_PostFilter 550 SWI "Filter_RegisterPostFilter" 560 LDMFD (sp)!,{r0-r4,pc} ; restore registers 570: 580.module_final 590 STMFD (sp)!,{r0-r4,r12,link} ; Stack registers 600 BL mod_set_PostFilter 610 SWI "Filter_DeRegisterPostFilter" 620 LDMFD (sp)!,{r0-r4,r12,pc} ; Return 630: 640; ***** Module commands table 650.module_commands 660 EQUS "SpacedFiles" ; Command name 670 EQUB 0:ALIGN 680 EQUD 0 ; Code to call 690 EQUD &0 ; Flags 700 EQUD 0 ; Syntax pointer 710 EQUD help_spacedfiles ; Help pointer 720 EQUB 0 730 ALIGN 740: 750; ***** Help and Syntax messages 760.help_spacedfiles 770 EQUS "The SpacedFiles module allows you to create files with spaces in their " 780 EQUS "names and to have them automatically formatted into Alt-Spaces. " 790 EQUB 0 800 ALIGN 810: 820; ***** Set up registers for filters 830.mod_set_PostFilter 840 STMFD (sp)!,{link} 850 MOV r3,#0 860 ADR r0,`module_PostFilterName 870 FNLADR("",1,filtercode) 880 MOV r2,r12 890 LDR r4,`module_PostFilterMask 900 LDMFD (sp)!,{pc} 910: 920.`module_PostFilterMask 930 EQUD %10011111111111111111 940.`module_PostFilterName 950 EQUS "Spaced Filenames"+CHR$0 960 ALIGN 970: 980 ; **** End of module header **** 990: 1000.eventtype 1010 EQUD 0 1020: 1030.filtercode 1040 STMFD (sp)!,{r1-r2,link} 1050 CMP r0,#17 1060 CMPNE r0,#18 1070 BEQ isourevent 1080 LDMFD (sp)!,{r1-r2,pc} 1090: 1100.isourevent 1110; SWI &104 1120 ; "Filter %r0" 1130 STR r0,eventtype 1140 LDR r2,[r1,#16] 1150 CMP r2,#1 1160 BEQ isDataSave 1170.exitevent 1180 LDR r0,eventtype 1190 LDMFD (sp)!,{r1-r2,pc} 1200: 1210.isDataSave 1220; check the filename 1230 ADD r2,r1,#44 ; filename 1240 ; "Check icon, pointer = %&2" 1250._iDS_loop 1260 LDRB r0,[r2] ; read byte of filename 1270 ADD r2,r2,#1 1280] 1290IF cond_underline THEN 1300[ OPT pass% 1310 CMP r0,#ASC("_") ; is it a _ ? 1320 MOVEQ r0,#160 ; change to space 1330] 1340ENDIF 1350[ OPT pass% 1360 CMP r0,#32 ; is it space 1370 MOVEQ r0,#160 ; if so, use a hard-space 1380 STRB r0,[r2,#-1] ; store back 1390 BGE _iDS_loop 1400 LDR r0,eventtype 1410 LDMFD (sp)!,{r1-r2,pc} 1420: 1430 EQUS "Check out Final Conflict's albumn �Quest� - it's really " 1440 EQUS "excellent prog-rock. Also, try Grey Lady Down �The Crime�, " 1450 EQUS "or Jadis �More That Meets The Eye�." 1460 EQUB 0 1470: 1480] 1490REM **** End of main code **** 1500REM Set final pointer to find the length of the code 1510PROCpatch_setpc(0) 1520NEXT pass% 1530PROCpatch_savefile 1560REM **** Post-assembly user code ***** 1580END 1590: 1600REM **** Filing procedures **** 1610: 1620DEF PROCpatch_loadfile 1630codelen=0 1640DIM MC% &1400 1650endofcode=codelen+&0:max=codelen 1660L%=endofcode:__cap%=FALSE 1760ENDPROC 1770: 1780DEF PROCpatch_savefile 1790outfile$="<SpacedFiles$Dir>.SpcFiles" 1800OSCLI("Save "+outfile$+" "+STR$~MC%+" "+STR$~(max+MC%)) 1810OSCLI("Settype "+outfile$+" Module") 1820patchdir$="<SpacedFiles$Dir>" 1860ENDPROC 1870: 1880REM **** Error Handler **** 1890: 1900DEFPROCError 1980ERROR EXT ERR,REPORT$+" at line "+STR$ERL 1990ENDPROC 2000: 2010REM **** Utility procedures **** 2020: 2030DEFPROCpatch_setpc(n) 2040IF P%-&0>max THENmax=P%-&0 2050P%=n:O%=MC%+n-&0 2060ENDPROC 2070: 2080DEFFNfindfreereg(a,b,c,d):LOCAL n:n=0 2090WHILE n=a OR n=b OR n=c OR n=d 2100 n+=1 2110ENDWHILE 2120=n 2130: 2140REM **** Long ADR macro procedure **** 2150: 2160REM DESC. : ADR equivalent for long address ranges, in 2 insts 2170REM ENTRY : cond$ = two char string, containing the ARM condition 2180REM reg% = 0..15 2190REM pointer% = long range pointer 2200REM COMM. : pass% = OPT variable in the assembler FOR..NEXT loop 2210REM Can only handle 64 KByte ranges 2220DEFFNLADR(cond$,reg%,pointer%) 2230LOCAL cc%,diff%,lo%,hi%,op1%,op2% 2240IF (pass% AND%10)=0 P%+=8:O%+=8:=0 2250IF ABS(pointer%-P%)>65535 THEN ERROR 1,"LADR can only handle 64 KByte ranges at &"+STR$~P%+" (&"+STR$~(pointer%-P%)+" distant)" 2260IFcond$=" " OR cond$="" THENcond$="AL" 2270cc%=INSTR("EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$) 2280IF cc%=0 ERROR 1,"FATAL ERROR : Unknown condition for LADR at &"+STR$~P%+" (&"+STR$~O%+")" ELSE cc%=(cc%-1)DIV2 2290diff%=pointer%-P%-8 2300lo%=ABS(diff%)AND&FF 2310hi%=ABS(diff%)AND&FF00 2320IFdiff%>=0THEN 2330 op1%=(cc%<<28)+&028F0000+(reg%<<12)+lo% 2340 op2%=(cc%<<28)+&02800C00+(reg%<<16)+(reg%<<12)+(hi%>>8) 2350ELSE 2360 op1%=(cc%<<28)+&024F0000+(reg%<<12)+lo% 2370 op2%=(cc%<<28)+&02400C00+(reg%<<16)+(reg%<<12)+(hi%>>8) 2380ENDIF 2390[OPT pass%:EQUD op1%:EQUD op2%:] 2400=0 2410: 32639REM JFPatch
$� > Patch for memory compilation 7� Created by JFPatch � Justin Fletcher, 05 Sep 1995 0� Intermediate code file created 23 Sep 1995 (� � �Error:� 2�patch_loadfile <: F!� **** User pre-assembly **** P= � "Do you want to change underlines to spaces ? (y/n) "; Z- �:ș "OS_Confirm" � g:g$=�g:��"yn",g$)>0 d �g$ n cond_underline=�"yY",g$)>0 x: �%� **** Main assembly routine **** �sp=13:link=14:pc=15 �/vbit=1<<28:cbit=1<<29:zbit=1<<30:nbit=1<<31 �P%=&0:O%=MC% �� pass%=4 � 6 �2 �"� **** Start of main code **** ��patch_setpc(0) �[OPT pass% �+ ; **** Add module header **** �- EQUD 0 ; Start offset �6 EQUD module_init ; Initialisation offset �4 EQUD module_final ; Finalisation offset �7 EQUD module_service ; Service request offset 4 EQUD module_title ; Title string offset 3 EQUD module_help ; Help string offset F EQUD module_commands ; Help and command keyword table offset ": ,.module_title 6 EQUS "SpacedFiles"+�0 @ ALIGN J: T.module_help ^M EQUS "Spaced filenames"+�9+"1.00 ("+��$,5,11)+") � Justin Fletcher"+�0 h ALIGN r: |.module_service � LDR r12,[r12] � CMP r1,#&87 �# BEQ mod_svc_newfiltermgr �._mod_svc_return � MOVS pc,link �: �.mod_svc_newfiltermgr �7 STMFD (sp)!,{r0-r4,link} ; Stack registers �! BL mod_set_PostFilter �* SWI "Filter_RegisterPostFilter" �! LDMFD (sp)!,{r0-r4,link} � B _mod_svc_return �: .module_init 7 STMFD (sp)!,{r0-r4,link} ; Stack registers ! BL mod_set_PostFilter &* SWI "Filter_RegisterPostFilter" 09 LDMFD (sp)!,{r0-r4,pc} ; restore registers :: D.module_final N7 STMFD (sp)!,{r0-r4,r12,link} ; Stack registers X! BL mod_set_PostFilter b, SWI "Filter_DeRegisterPostFilter" l. LDMFD (sp)!,{r0-r4,r12,pc} ; Return v: �!; ***** Module commands table �.module_commands �- EQUS "SpacedFiles" ; Command name � EQUB 0:ALIGN �- EQUD 0 ; Code to call �& EQUD &0 ; Flags �/ EQUD 0 ; Syntax pointer �- EQUD help_spacedfiles ; Help pointer � EQUB 0 � ALIGN �: �$; ***** Help and Syntax messages �.help_spacedfiles U EQUS "The SpacedFiles module allows you to create files with spaces in their " N EQUS "names and to have them automatically formatted into Alt-Spaces. " EQUB 0 ALIGN *: 4(; ***** Set up registers for filters >.mod_set_PostFilter H STMFD (sp)!,{link} R MOV r3,#0 \( ADR r0,`module_PostFilterName f �LADR("",1,filtercode) p MOV r2,r12 z( LDR r4,`module_PostFilterMask � LDMFD (sp)!,{pc} �: �.`module_PostFilterMask �$ EQUD %10011111111111111111 �.`module_PostFilterName �$ EQUS "Spaced Filenames"+�0 � ALIGN �: �. ; **** End of module header **** �: �.eventtype � EQUD 0 �: .filtercode STMFD (sp)!,{r1-r2,link} CMP r0,#17 $ CMPNE r0,#18 . BEQ isourevent 8 LDMFD (sp)!,{r1-r2,pc} B: L.isourevent V; SWI &104 ` ; "Filter %r0" j STR r0,eventtype t LDR r2,[r1,#16] ~ CMP r2,#1 � BEQ isDataSave �.exitevent � LDR r0,eventtype � LDMFD (sp)!,{r1-r2,pc} �: �.isDataSave �; check the filename �( ADD r2,r1,#44 ; filename �+ ; "Check icon, pointer = %&2" �._iDS_loop �5 LDRB r0,[r2] ; read byte of filename � ADD r2,r2,#1 ] � cond_underline � [ OPT pass% ) CMP r0,#�("_") ; is it a _ ? (, �Q r0,#160 ; change to space 2] <� F[ OPT pass% P+ CMP r0,#32 ; is it space Z4 �Q r0,#160 ; if so, use a hard-space d* STRB r0,[r2,#-1] ; store back n BGE _iDS_loop x LDR r0,eventtype � LDMFD (sp)!,{r1-r2,pc} �: �H EQUS "Check out Final Conflict's albumn �Quest� - it's really " �K EQUS "excellent prog-rock. Also, try Grey Lady Down �The Crime�, " �3 EQUS "or Jadis �More That Meets The Eye�." � EQUB 0 �: �] � � **** End of main code **** �6� Set final pointer to find the length of the code ��patch_setpc(0) �� pass% ��patch_savefile (� **** Post-assembly user code ***** ,� 6: @!� **** Filing procedures **** J: T� �patch_loadfile ^ codelen=0 h� MC% &1400 r$endofcode=codelen+&0:max=codelen |L%=endofcode:__cap%=� �� �: �� �patch_savefile �)outfile$="<SpacedFiles$Dir>.SpcFiles" 1�("Save "+outfile$+" "+�~MC%+" "+�~(max+MC%)) $�("Settype "+outfile$+" Module") !patchdir$="<SpacedFiles$Dir>" D� N: X� **** Error Handler **** b: l��Error �� � �,�$+" at line "+Þ �� �: �"� **** Utility procedures **** �: ���patch_setpc(n) �� P%-&0>max �max=P%-&0 P%=n:O%=MC%+n-&0 � : "ݤfindfreereg(a,b,c,d):� n:n=0 *ȕ n=a � n=b � n=c � n=d 4 n+=1 >� H=n R: \(� **** Long ADR macro procedure **** f: p@� DESC. : ADR equivalent for long address ranges, in 2 insts zC� ENTRY : cond$ = two char string, containing the ARM condition �� reg% = 0..15 �+� pointer% = long range pointer �B� COMM. : pass% = OPT variable in the assembler FOR..NEXT loop �-� Can only handle 64 KByte ranges �ݤLADR(cond$,reg%,pointer%) �!� cc%,diff%,lo%,hi%,op1%,op2% �#� (pass% �%10)=0 P%+=8:O%+=8:=0 �s� �(pointer%-P%)>65535 � � 1,"LADR can only handle 64 KByte ranges at &"+�~P%+" (&"+�~(pointer%-P%)+" distant)" �'�cond$=" " � cond$="" �cond$="AL" �2cc%=�"EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$) �c� cc%=0 � 1,"FATAL ERROR : Unknown condition for LADR at &"+�~P%+" (&"+�~O%+")" � cc%=(cc%-1)�2 �diff%=pointer%-P%-8 �lo%=�(diff%)�&FF hi%=�(diff%)�&FF00 �diff%>=0� , op1%=(cc%<<28)+&028F0000+(reg%<<12)+lo% $< op2%=(cc%<<28)+&02800C00+(reg%<<16)+(reg%<<12)+(hi%>>8) .� 8, op1%=(cc%<<28)+&024F0000+(reg%<<12)+lo% B< op2%=(cc%<<28)+&02400C00+(reg%<<16)+(reg%<<12)+(hi%>>8) L� V$[OPT pass%:EQUD op1%:EQUD op2%:] `=0 j: � JFPatch �
00000000 0d 00 0a 24 f4 20 3e 20 50 61 74 63 68 20 66 6f |...$. > Patch fo| 00000010 72 20 6d 65 6d 6f 72 79 20 63 6f 6d 70 69 6c 61 |r memory compila| 00000020 74 69 6f 6e 0d 00 14 37 f4 20 43 72 65 61 74 65 |tion...7. Create| 00000030 64 20 62 79 20 4a 46 50 61 74 63 68 20 a9 20 4a |d by JFPatch . J| 00000040 75 73 74 69 6e 20 46 6c 65 74 63 68 65 72 2c 20 |ustin Fletcher, | 00000050 30 35 20 53 65 70 20 31 39 39 35 0d 00 1e 30 f4 |05 Sep 1995...0.| 00000060 20 49 6e 74 65 72 6d 65 64 69 61 74 65 20 63 6f | Intermediate co| 00000070 64 65 20 66 69 6c 65 20 63 72 65 61 74 65 64 20 |de file created | 00000080 32 33 20 53 65 70 20 31 39 39 35 0d 00 28 10 ee |23 Sep 1995..(..| 00000090 20 85 20 f2 45 72 72 6f 72 3a e0 0d 00 32 13 f2 | . .Error:...2..| 000000a0 70 61 74 63 68 5f 6c 6f 61 64 66 69 6c 65 0d 00 |patch_loadfile..| 000000b0 3c 05 3a 0d 00 46 21 f4 20 2a 2a 2a 2a 20 55 73 |<.:..F!. **** Us| 000000c0 65 72 20 70 72 65 2d 61 73 73 65 6d 62 6c 79 20 |er pre-assembly | 000000d0 2a 2a 2a 2a 0d 00 50 3d 20 f1 20 22 44 6f 20 79 |****..P= . "Do y| 000000e0 6f 75 20 77 61 6e 74 20 74 6f 20 63 68 61 6e 67 |ou want to chang| 000000f0 65 20 75 6e 64 65 72 6c 69 6e 65 73 20 74 6f 20 |e underlines to | 00000100 73 70 61 63 65 73 20 3f 20 28 79 2f 6e 29 20 22 |spaces ? (y/n) "| 00000110 3b 0d 00 5a 2d 20 f5 3a c8 99 20 22 4f 53 5f 43 |;..Z- .:.. "OS_C| 00000120 6f 6e 66 69 72 6d 22 20 b8 20 67 3a 67 24 3d bd |onfirm" . g:g$=.| 00000130 67 3a fd a7 22 79 6e 22 2c 67 24 29 3e 30 0d 00 |g:.."yn",g$)>0..| 00000140 64 08 20 f1 67 24 0d 00 6e 1f 20 63 6f 6e 64 5f |d. .g$..n. cond_| 00000150 75 6e 64 65 72 6c 69 6e 65 3d a7 22 79 59 22 2c |underline=."yY",| 00000160 67 24 29 3e 30 0d 00 78 05 3a 0d 00 82 25 f4 20 |g$)>0..x.:...%. | 00000170 2a 2a 2a 2a 20 4d 61 69 6e 20 61 73 73 65 6d 62 |**** Main assemb| 00000180 6c 79 20 72 6f 75 74 69 6e 65 20 2a 2a 2a 2a 0d |ly routine ****.| 00000190 00 8c 17 73 70 3d 31 33 3a 6c 69 6e 6b 3d 31 34 |...sp=13:link=14| 000001a0 3a 70 63 3d 31 35 0d 00 96 2f 76 62 69 74 3d 31 |:pc=15.../vbit=1| 000001b0 3c 3c 32 38 3a 63 62 69 74 3d 31 3c 3c 32 39 3a |<<28:cbit=1<<29:| 000001c0 7a 62 69 74 3d 31 3c 3c 33 30 3a 6e 62 69 74 3d |zbit=1<<30:nbit=| 000001d0 31 3c 3c 33 31 0d 00 a0 10 50 25 3d 26 30 3a 4f |1<<31....P%=&0:O| 000001e0 25 3d 4d 43 25 0d 00 aa 14 e3 20 70 61 73 73 25 |%=MC%..... pass%| 000001f0 3d 34 20 b8 20 36 20 88 32 0d 00 b4 22 f4 20 2a |=4 . 6 .2...". *| 00000200 2a 2a 2a 20 53 74 61 72 74 20 6f 66 20 6d 61 69 |*** Start of mai| 00000210 6e 20 63 6f 64 65 20 2a 2a 2a 2a 0d 00 be 13 f2 |n code ****.....| 00000220 70 61 74 63 68 5f 73 65 74 70 63 28 30 29 0d 00 |patch_setpc(0)..| 00000230 c8 0e 5b 4f 50 54 20 70 61 73 73 25 0d 00 d2 2b |..[OPT pass%...+| 00000240 20 20 20 20 20 20 20 20 20 20 3b 20 2a 2a 2a 2a | ; ****| 00000250 20 41 64 64 20 6d 6f 64 75 6c 65 20 68 65 61 64 | Add module head| 00000260 65 72 20 2a 2a 2a 2a 0d 00 dc 2d 20 20 20 45 51 |er ****...- EQ| 00000270 55 44 20 30 20 20 20 20 20 20 20 20 20 20 20 20 |UD 0 | 00000280 20 20 20 20 20 20 3b 20 53 74 61 72 74 20 6f 66 | ; Start of| 00000290 66 73 65 74 0d 00 e6 36 20 20 20 45 51 55 44 20 |fset...6 EQUD | 000002a0 6d 6f 64 75 6c 65 5f 69 6e 69 74 20 20 20 20 20 |module_init | 000002b0 20 20 20 3b 20 49 6e 69 74 69 61 6c 69 73 61 74 | ; Initialisat| 000002c0 69 6f 6e 20 6f 66 66 73 65 74 0d 00 f0 34 20 20 |ion offset...4 | 000002d0 20 45 51 55 44 20 6d 6f 64 75 6c 65 5f 66 69 6e | EQUD module_fin| 000002e0 61 6c 20 20 20 20 20 20 20 3b 20 46 69 6e 61 6c |al ; Final| 000002f0 69 73 61 74 69 6f 6e 20 6f 66 66 73 65 74 0d 00 |isation offset..| 00000300 fa 37 20 20 20 45 51 55 44 20 6d 6f 64 75 6c 65 |.7 EQUD module| 00000310 5f 73 65 72 76 69 63 65 20 20 20 20 20 3b 20 53 |_service ; S| 00000320 65 72 76 69 63 65 20 72 65 71 75 65 73 74 20 6f |ervice request o| 00000330 66 66 73 65 74 0d 01 04 34 20 20 20 45 51 55 44 |ffset...4 EQUD| 00000340 20 6d 6f 64 75 6c 65 5f 74 69 74 6c 65 20 20 20 | module_title | 00000350 20 20 20 20 3b 20 54 69 74 6c 65 20 73 74 72 69 | ; Title stri| 00000360 6e 67 20 6f 66 66 73 65 74 0d 01 0e 33 20 20 20 |ng offset...3 | 00000370 45 51 55 44 20 6d 6f 64 75 6c 65 5f 68 65 6c 70 |EQUD module_help| 00000380 20 20 20 20 20 20 20 20 3b 20 48 65 6c 70 20 73 | ; Help s| 00000390 74 72 69 6e 67 20 6f 66 66 73 65 74 0d 01 18 46 |tring offset...F| 000003a0 20 20 20 45 51 55 44 20 6d 6f 64 75 6c 65 5f 63 | EQUD module_c| 000003b0 6f 6d 6d 61 6e 64 73 20 20 20 20 3b 20 48 65 6c |ommands ; Hel| 000003c0 70 20 61 6e 64 20 63 6f 6d 6d 61 6e 64 20 6b 65 |p and command ke| 000003d0 79 77 6f 72 64 20 74 61 62 6c 65 20 6f 66 66 73 |yword table offs| 000003e0 65 74 0d 01 22 05 3a 0d 01 2c 11 2e 6d 6f 64 75 |et..".:..,..modu| 000003f0 6c 65 5f 74 69 74 6c 65 0d 01 36 1c 20 20 20 45 |le_title..6. E| 00000400 51 55 53 20 22 53 70 61 63 65 64 46 69 6c 65 73 |QUS "SpacedFiles| 00000410 22 2b bd 30 0d 01 40 0c 20 20 20 41 4c 49 47 4e |"+.0..@. ALIGN| 00000420 0d 01 4a 05 3a 0d 01 54 10 2e 6d 6f 64 75 6c 65 |..J.:..T..module| 00000430 5f 68 65 6c 70 0d 01 5e 4d 20 20 20 45 51 55 53 |_help..^M EQUS| 00000440 20 22 53 70 61 63 65 64 20 66 69 6c 65 6e 61 6d | "Spaced filenam| 00000450 65 73 22 2b bd 39 2b 22 31 2e 30 30 20 28 22 2b |es"+.9+"1.00 ("+| 00000460 c1 91 24 2c 35 2c 31 31 29 2b 22 29 20 a9 20 4a |..$,5,11)+") . J| 00000470 75 73 74 69 6e 20 46 6c 65 74 63 68 65 72 22 2b |ustin Fletcher"+| 00000480 bd 30 0d 01 68 0c 20 20 20 41 4c 49 47 4e 0d 01 |.0..h. ALIGN..| 00000490 72 05 3a 0d 01 7c 13 2e 6d 6f 64 75 6c 65 5f 73 |r.:..|..module_s| 000004a0 65 72 76 69 63 65 0d 01 86 18 20 20 20 4c 44 52 |ervice.... LDR| 000004b0 20 20 20 20 20 72 31 32 2c 5b 72 31 32 5d 0d 01 | r12,[r12]..| 000004c0 90 16 20 20 20 43 4d 50 20 20 20 20 20 72 31 2c |.. CMP r1,| 000004d0 23 26 38 37 0d 01 9a 23 20 20 20 42 45 51 20 20 |#&87...# BEQ | 000004e0 20 20 20 6d 6f 64 5f 73 76 63 5f 6e 65 77 66 69 | mod_svc_newfi| 000004f0 6c 74 65 72 6d 67 72 0d 01 a4 14 2e 5f 6d 6f 64 |ltermgr....._mod| 00000500 5f 73 76 63 5f 72 65 74 75 72 6e 0d 01 ae 16 20 |_svc_return.... | 00000510 20 20 4d 4f 56 53 20 20 20 20 70 63 2c 6c 69 6e | MOVS pc,lin| 00000520 6b 0d 01 b8 05 3a 0d 01 c2 19 2e 6d 6f 64 5f 73 |k....:.....mod_s| 00000530 76 63 5f 6e 65 77 66 69 6c 74 65 72 6d 67 72 0d |vc_newfiltermgr.| 00000540 01 cc 37 20 20 20 53 54 4d 46 44 20 20 20 28 73 |..7 STMFD (s| 00000550 70 29 21 2c 7b 72 30 2d 72 34 2c 6c 69 6e 6b 7d |p)!,{r0-r4,link}| 00000560 20 20 20 20 20 3b 20 53 74 61 63 6b 20 72 65 67 | ; Stack reg| 00000570 69 73 74 65 72 73 0d 01 d6 21 20 20 20 42 4c 20 |isters...! BL | 00000580 20 20 20 20 20 6d 6f 64 5f 73 65 74 5f 50 6f 73 | mod_set_Pos| 00000590 74 46 69 6c 74 65 72 0d 01 e0 2a 20 20 20 53 57 |tFilter...* SW| 000005a0 49 20 20 20 20 20 22 46 69 6c 74 65 72 5f 52 65 |I "Filter_Re| 000005b0 67 69 73 74 65 72 50 6f 73 74 46 69 6c 74 65 72 |gisterPostFilter| 000005c0 22 0d 01 ea 21 20 20 20 4c 44 4d 46 44 20 20 20 |"...! LDMFD | 000005d0 28 73 70 29 21 2c 7b 72 30 2d 72 34 2c 6c 69 6e |(sp)!,{r0-r4,lin| 000005e0 6b 7d 0d 01 f4 1e 20 20 20 42 20 20 20 20 20 20 |k}.... B | 000005f0 20 5f 6d 6f 64 5f 73 76 63 5f 72 65 74 75 72 6e | _mod_svc_return| 00000600 0d 01 fe 05 3a 0d 02 08 10 2e 6d 6f 64 75 6c 65 |....:.....module| 00000610 5f 69 6e 69 74 0d 02 12 37 20 20 20 53 54 4d 46 |_init...7 STMF| 00000620 44 20 20 20 28 73 70 29 21 2c 7b 72 30 2d 72 34 |D (sp)!,{r0-r4| 00000630 2c 6c 69 6e 6b 7d 20 20 20 20 20 3b 20 53 74 61 |,link} ; Sta| 00000640 63 6b 20 72 65 67 69 73 74 65 72 73 0d 02 1c 21 |ck registers...!| 00000650 20 20 20 42 4c 20 20 20 20 20 20 6d 6f 64 5f 73 | BL mod_s| 00000660 65 74 5f 50 6f 73 74 46 69 6c 74 65 72 0d 02 26 |et_PostFilter..&| 00000670 2a 20 20 20 53 57 49 20 20 20 20 20 22 46 69 6c |* SWI "Fil| 00000680 74 65 72 5f 52 65 67 69 73 74 65 72 50 6f 73 74 |ter_RegisterPost| 00000690 46 69 6c 74 65 72 22 0d 02 30 39 20 20 20 4c 44 |Filter"..09 LD| 000006a0 4d 46 44 20 20 20 28 73 70 29 21 2c 7b 72 30 2d |MFD (sp)!,{r0-| 000006b0 72 34 2c 70 63 7d 20 20 20 20 20 20 20 3b 20 72 |r4,pc} ; r| 000006c0 65 73 74 6f 72 65 20 72 65 67 69 73 74 65 72 73 |estore registers| 000006d0 0d 02 3a 05 3a 0d 02 44 11 2e 6d 6f 64 75 6c 65 |..:.:..D..module| 000006e0 5f 66 69 6e 61 6c 0d 02 4e 37 20 20 20 53 54 4d |_final..N7 STM| 000006f0 46 44 20 20 20 28 73 70 29 21 2c 7b 72 30 2d 72 |FD (sp)!,{r0-r| 00000700 34 2c 72 31 32 2c 6c 69 6e 6b 7d 20 3b 20 53 74 |4,r12,link} ; St| 00000710 61 63 6b 20 72 65 67 69 73 74 65 72 73 0d 02 58 |ack registers..X| 00000720 21 20 20 20 42 4c 20 20 20 20 20 20 6d 6f 64 5f |! BL mod_| 00000730 73 65 74 5f 50 6f 73 74 46 69 6c 74 65 72 0d 02 |set_PostFilter..| 00000740 62 2c 20 20 20 53 57 49 20 20 20 20 20 22 46 69 |b, SWI "Fi| 00000750 6c 74 65 72 5f 44 65 52 65 67 69 73 74 65 72 50 |lter_DeRegisterP| 00000760 6f 73 74 46 69 6c 74 65 72 22 0d 02 6c 2e 20 20 |ostFilter"..l. | 00000770 20 4c 44 4d 46 44 20 20 20 28 73 70 29 21 2c 7b | LDMFD (sp)!,{| 00000780 72 30 2d 72 34 2c 72 31 32 2c 70 63 7d 20 20 20 |r0-r4,r12,pc} | 00000790 3b 20 52 65 74 75 72 6e 0d 02 76 05 3a 0d 02 80 |; Return..v.:...| 000007a0 21 3b 20 2a 2a 2a 2a 2a 20 4d 6f 64 75 6c 65 20 |!; ***** Module | 000007b0 63 6f 6d 6d 61 6e 64 73 20 74 61 62 6c 65 0d 02 |commands table..| 000007c0 8a 14 2e 6d 6f 64 75 6c 65 5f 63 6f 6d 6d 61 6e |...module_comman| 000007d0 64 73 0d 02 94 2d 20 20 20 45 51 55 53 20 22 53 |ds...- EQUS "S| 000007e0 70 61 63 65 64 46 69 6c 65 73 22 20 20 20 20 20 |pacedFiles" | 000007f0 20 3b 20 43 6f 6d 6d 61 6e 64 20 6e 61 6d 65 0d | ; Command name.| 00000800 02 9e 13 20 20 20 45 51 55 42 20 30 3a 41 4c 49 |... EQUB 0:ALI| 00000810 47 4e 0d 02 a8 2d 20 20 20 45 51 55 44 20 30 20 |GN...- EQUD 0 | 00000820 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000830 20 3b 20 43 6f 64 65 20 74 6f 20 63 61 6c 6c 0d | ; Code to call.| 00000840 02 b2 26 20 20 20 45 51 55 44 20 26 30 20 20 20 |..& EQUD &0 | 00000850 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3b 20 | ; | 00000860 46 6c 61 67 73 0d 02 bc 2f 20 20 20 45 51 55 44 |Flags.../ EQUD| 00000870 20 30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | 0 | 00000880 20 20 20 20 3b 20 53 79 6e 74 61 78 20 70 6f 69 | ; Syntax poi| 00000890 6e 74 65 72 0d 02 c6 2d 20 20 20 45 51 55 44 20 |nter...- EQUD | 000008a0 68 65 6c 70 5f 73 70 61 63 65 64 66 69 6c 65 73 |help_spacedfiles| 000008b0 20 20 20 3b 20 48 65 6c 70 20 70 6f 69 6e 74 65 | ; Help pointe| 000008c0 72 0d 02 d0 0d 20 20 20 45 51 55 42 20 30 0d 02 |r.... EQUB 0..| 000008d0 da 0c 20 20 20 41 4c 49 47 4e 0d 02 e4 05 3a 0d |.. ALIGN....:.| 000008e0 02 ee 24 3b 20 2a 2a 2a 2a 2a 20 48 65 6c 70 20 |..$; ***** Help | 000008f0 61 6e 64 20 53 79 6e 74 61 78 20 6d 65 73 73 61 |and Syntax messa| 00000900 67 65 73 0d 02 f8 15 2e 68 65 6c 70 5f 73 70 61 |ges.....help_spa| 00000910 63 65 64 66 69 6c 65 73 0d 03 02 55 20 20 20 45 |cedfiles...U E| 00000920 51 55 53 20 22 54 68 65 20 53 70 61 63 65 64 46 |QUS "The SpacedF| 00000930 69 6c 65 73 20 6d 6f 64 75 6c 65 20 61 6c 6c 6f |iles module allo| 00000940 77 73 20 79 6f 75 20 74 6f 20 63 72 65 61 74 65 |ws you to create| 00000950 20 66 69 6c 65 73 20 77 69 74 68 20 73 70 61 63 | files with spac| 00000960 65 73 20 69 6e 20 74 68 65 69 72 20 22 0d 03 0c |es in their "...| 00000970 4e 20 20 20 45 51 55 53 20 22 6e 61 6d 65 73 20 |N EQUS "names | 00000980 61 6e 64 20 74 6f 20 68 61 76 65 20 74 68 65 6d |and to have them| 00000990 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 66 | automatically f| 000009a0 6f 72 6d 61 74 74 65 64 20 69 6e 74 6f 20 41 6c |ormatted into Al| 000009b0 74 2d 53 70 61 63 65 73 2e 20 22 0d 03 16 0d 20 |t-Spaces. ".... | 000009c0 20 20 45 51 55 42 20 30 0d 03 20 0c 20 20 20 41 | EQUB 0.. . A| 000009d0 4c 49 47 4e 0d 03 2a 05 3a 0d 03 34 28 3b 20 2a |LIGN..*.:..4(; *| 000009e0 2a 2a 2a 2a 20 53 65 74 20 75 70 20 72 65 67 69 |**** Set up regi| 000009f0 73 74 65 72 73 20 66 6f 72 20 66 69 6c 74 65 72 |sters for filter| 00000a00 73 0d 03 3e 17 2e 6d 6f 64 5f 73 65 74 5f 50 6f |s..>..mod_set_Po| 00000a10 73 74 46 69 6c 74 65 72 0d 03 48 1b 20 20 20 53 |stFilter..H. S| 00000a20 54 4d 46 44 20 20 20 28 73 70 29 21 2c 7b 6c 69 |TMFD (sp)!,{li| 00000a30 6e 6b 7d 0d 03 52 14 20 20 20 4d 4f 56 20 20 20 |nk}..R. MOV | 00000a40 20 20 72 33 2c 23 30 0d 03 5c 28 20 20 20 41 44 | r3,#0..\( AD| 00000a50 52 20 20 20 20 20 72 30 2c 60 6d 6f 64 75 6c 65 |R r0,`module| 00000a60 5f 50 6f 73 74 46 69 6c 74 65 72 4e 61 6d 65 0d |_PostFilterName.| 00000a70 03 66 1b 20 a4 4c 41 44 52 28 22 22 2c 31 2c 66 |.f. .LADR("",1,f| 00000a80 69 6c 74 65 72 63 6f 64 65 29 0d 03 70 15 20 20 |iltercode)..p. | 00000a90 20 4d 4f 56 20 20 20 20 20 72 32 2c 72 31 32 0d | MOV r2,r12.| 00000aa0 03 7a 28 20 20 20 4c 44 52 20 20 20 20 20 72 34 |.z( LDR r4| 00000ab0 2c 60 6d 6f 64 75 6c 65 5f 50 6f 73 74 46 69 6c |,`module_PostFil| 00000ac0 74 65 72 4d 61 73 6b 0d 03 84 19 20 20 20 4c 44 |terMask.... LD| 00000ad0 4d 46 44 20 20 20 28 73 70 29 21 2c 7b 70 63 7d |MFD (sp)!,{pc}| 00000ae0 0d 03 8e 05 3a 0d 03 98 1b 2e 60 6d 6f 64 75 6c |....:.....`modul| 00000af0 65 5f 50 6f 73 74 46 69 6c 74 65 72 4d 61 73 6b |e_PostFilterMask| 00000b00 0d 03 a2 24 20 20 20 45 51 55 44 20 20 20 20 25 |...$ EQUD %| 00000b10 31 30 30 31 31 31 31 31 31 31 31 31 31 31 31 31 |1001111111111111| 00000b20 31 31 31 31 0d 03 ac 1b 2e 60 6d 6f 64 75 6c 65 |1111.....`module| 00000b30 5f 50 6f 73 74 46 69 6c 74 65 72 4e 61 6d 65 0d |_PostFilterName.| 00000b40 03 b6 24 20 20 20 45 51 55 53 20 20 20 20 22 53 |..$ EQUS "S| 00000b50 70 61 63 65 64 20 46 69 6c 65 6e 61 6d 65 73 22 |paced Filenames"| 00000b60 2b bd 30 0d 03 c0 0c 20 20 20 41 4c 49 47 4e 0d |+.0.... ALIGN.| 00000b70 03 ca 05 3a 0d 03 d4 2e 20 20 20 20 20 20 20 20 |...:.... | 00000b80 20 20 3b 20 2a 2a 2a 2a 20 45 6e 64 20 6f 66 20 | ; **** End of | 00000b90 6d 6f 64 75 6c 65 20 68 65 61 64 65 72 20 2a 2a |module header **| 00000ba0 2a 2a 0d 03 de 05 3a 0d 03 e8 0e 2e 65 76 65 6e |**....:.....even| 00000bb0 74 74 79 70 65 0d 03 f2 0f 20 20 20 45 51 55 44 |ttype.... EQUD| 00000bc0 20 20 20 30 0d 03 fc 05 3a 0d 04 06 0f 2e 66 69 | 0....:.....fi| 00000bd0 6c 74 65 72 63 6f 64 65 0d 04 10 20 20 20 20 53 |ltercode... S| 00000be0 54 4d 46 44 20 20 28 73 70 29 21 2c 7b 72 31 2d |TMFD (sp)!,{r1-| 00000bf0 72 32 2c 6c 69 6e 6b 7d 0d 04 1a 14 20 20 20 43 |r2,link}.... C| 00000c00 4d 50 20 20 20 20 72 30 2c 23 31 37 0d 04 24 14 |MP r0,#17..$.| 00000c10 20 20 20 43 4d 50 4e 45 20 20 72 30 2c 23 31 38 | CMPNE r0,#18| 00000c20 0d 04 2e 18 20 20 20 42 45 51 20 20 20 20 69 73 |.... BEQ is| 00000c30 6f 75 72 65 76 65 6e 74 0d 04 38 1e 20 20 20 4c |ourevent..8. L| 00000c40 44 4d 46 44 20 20 28 73 70 29 21 2c 7b 72 31 2d |DMFD (sp)!,{r1-| 00000c50 72 32 2c 70 63 7d 0d 04 42 05 3a 0d 04 4c 0f 2e |r2,pc}..B.:..L..| 00000c60 69 73 6f 75 72 65 76 65 6e 74 0d 04 56 13 3b 20 |isourevent..V.; | 00000c70 20 20 53 57 49 20 20 20 20 26 31 30 34 0d 04 60 | SWI &104..`| 00000c80 1c 20 20 20 20 20 20 20 20 20 20 3b 20 22 46 69 |. ; "Fi| 00000c90 6c 74 65 72 20 25 72 30 22 0d 04 6a 1a 20 20 20 |lter %r0"..j. | 00000ca0 53 54 52 20 20 20 20 72 30 2c 65 76 65 6e 74 74 |STR r0,eventt| 00000cb0 79 70 65 0d 04 74 19 20 20 20 4c 44 52 20 20 20 |ype..t. LDR | 00000cc0 20 72 32 2c 5b 72 31 2c 23 31 36 5d 0d 04 7e 13 | r2,[r1,#16]..~.| 00000cd0 20 20 20 43 4d 50 20 20 20 20 72 32 2c 23 31 0d | CMP r2,#1.| 00000ce0 04 88 18 20 20 20 42 45 51 20 20 20 20 69 73 44 |... BEQ isD| 00000cf0 61 74 61 53 61 76 65 0d 04 92 0e 2e 65 78 69 74 |ataSave.....exit| 00000d00 65 76 65 6e 74 0d 04 9c 1a 20 20 20 4c 44 52 20 |event.... LDR | 00000d10 20 20 20 72 30 2c 65 76 65 6e 74 74 79 70 65 0d | r0,eventtype.| 00000d20 04 a6 1e 20 20 20 4c 44 4d 46 44 20 20 28 73 70 |... LDMFD (sp| 00000d30 29 21 2c 7b 72 31 2d 72 32 2c 70 63 7d 0d 04 b0 |)!,{r1-r2,pc}...| 00000d40 05 3a 0d 04 ba 0f 2e 69 73 44 61 74 61 53 61 76 |.:.....isDataSav| 00000d50 65 0d 04 c4 18 3b 20 63 68 65 63 6b 20 74 68 65 |e....; check the| 00000d60 20 66 69 6c 65 6e 61 6d 65 0d 04 ce 28 20 20 20 | filename...( | 00000d70 41 44 44 20 20 20 20 72 32 2c 72 31 2c 23 34 34 |ADD r2,r1,#44| 00000d80 20 20 20 20 20 20 20 3b 20 66 69 6c 65 6e 61 6d | ; filenam| 00000d90 65 0d 04 d8 2b 20 20 20 20 20 20 20 20 20 20 3b |e...+ ;| 00000da0 20 22 43 68 65 63 6b 20 69 63 6f 6e 2c 20 70 6f | "Check icon, po| 00000db0 69 6e 74 65 72 20 3d 20 25 26 32 22 0d 04 e2 0e |inter = %&2"....| 00000dc0 2e 5f 69 44 53 5f 6c 6f 6f 70 0d 04 ec 35 20 20 |._iDS_loop...5 | 00000dd0 20 4c 44 52 42 20 20 20 72 30 2c 5b 72 32 5d 20 | LDRB r0,[r2] | 00000de0 20 20 20 20 20 20 20 20 3b 20 72 65 61 64 20 62 | ; read b| 00000df0 79 74 65 20 6f 66 20 66 69 6c 65 6e 61 6d 65 0d |yte of filename.| 00000e00 04 f6 16 20 20 20 41 44 44 20 20 20 20 72 32 2c |... ADD r2,| 00000e10 72 32 2c 23 31 0d 05 00 05 5d 0d 05 0a 16 e7 20 |r2,#1....]..... | 00000e20 63 6f 6e 64 5f 75 6e 64 65 72 6c 69 6e 65 20 8c |cond_underline .| 00000e30 0d 05 14 0f 5b 20 4f 50 54 20 70 61 73 73 25 0d |....[ OPT pass%.| 00000e40 05 1e 29 20 20 20 43 4d 50 20 20 20 20 72 30 2c |..) CMP r0,| 00000e50 23 97 28 22 5f 22 29 20 20 20 20 3b 20 69 73 20 |#.("_") ; is | 00000e60 69 74 20 61 20 5f 20 3f 0d 05 28 2c 20 20 20 ec |it a _ ?..(, .| 00000e70 51 20 20 72 30 2c 23 31 36 30 20 20 20 20 20 20 |Q r0,#160 | 00000e80 20 20 20 3b 20 63 68 61 6e 67 65 20 74 6f 20 73 | ; change to s| 00000e90 70 61 63 65 0d 05 32 05 5d 0d 05 3c 05 cd 0d 05 |pace..2.]..<....| 00000ea0 46 0f 5b 20 4f 50 54 20 70 61 73 73 25 0d 05 50 |F.[ OPT pass%..P| 00000eb0 2b 20 20 20 43 4d 50 20 20 20 20 72 30 2c 23 33 |+ CMP r0,#3| 00000ec0 32 20 20 20 20 20 20 20 20 20 20 3b 20 69 73 20 |2 ; is | 00000ed0 69 74 20 73 70 61 63 65 0d 05 5a 34 20 20 20 ec |it space..Z4 .| 00000ee0 51 20 20 72 30 2c 23 31 36 30 20 20 20 20 20 20 |Q r0,#160 | 00000ef0 20 20 20 3b 20 69 66 20 73 6f 2c 20 75 73 65 20 | ; if so, use | 00000f00 61 20 68 61 72 64 2d 73 70 61 63 65 0d 05 64 2a |a hard-space..d*| 00000f10 20 20 20 53 54 52 42 20 20 20 72 30 2c 5b 72 32 | STRB r0,[r2| 00000f20 2c 23 2d 31 5d 20 20 20 20 20 3b 20 73 74 6f 72 |,#-1] ; stor| 00000f30 65 20 62 61 63 6b 0d 05 6e 17 20 20 20 42 47 45 |e back..n. BGE| 00000f40 20 20 20 20 5f 69 44 53 5f 6c 6f 6f 70 0d 05 78 | _iDS_loop..x| 00000f50 1a 20 20 20 4c 44 52 20 20 20 20 72 30 2c 65 76 |. LDR r0,ev| 00000f60 65 6e 74 74 79 70 65 0d 05 82 1e 20 20 20 4c 44 |enttype.... LD| 00000f70 4d 46 44 20 20 28 73 70 29 21 2c 7b 72 31 2d 72 |MFD (sp)!,{r1-r| 00000f80 32 2c 70 63 7d 0d 05 8c 05 3a 0d 05 96 48 20 20 |2,pc}....:...H | 00000f90 20 45 51 55 53 20 20 20 22 43 68 65 63 6b 20 6f | EQUS "Check o| 00000fa0 75 74 20 46 69 6e 61 6c 20 43 6f 6e 66 6c 69 63 |ut Final Conflic| 00000fb0 74 27 73 20 61 6c 62 75 6d 6e 20 94 51 75 65 73 |t's albumn .Ques| 00000fc0 74 95 20 2d 20 69 74 27 73 20 72 65 61 6c 6c 79 |t. - it's really| 00000fd0 20 22 0d 05 a0 4b 20 20 20 45 51 55 53 20 20 20 | "...K EQUS | 00000fe0 22 65 78 63 65 6c 6c 65 6e 74 20 70 72 6f 67 2d |"excellent prog-| 00000ff0 72 6f 63 6b 2e 20 41 6c 73 6f 2c 20 74 72 79 20 |rock. Also, try | 00001000 47 72 65 79 20 4c 61 64 79 20 44 6f 77 6e 20 94 |Grey Lady Down .| 00001010 54 68 65 20 43 72 69 6d 65 95 2c 20 22 0d 05 aa |The Crime., "...| 00001020 33 20 20 20 45 51 55 53 20 20 20 22 6f 72 20 4a |3 EQUS "or J| 00001030 61 64 69 73 20 94 4d 6f 72 65 20 54 68 61 74 20 |adis .More That | 00001040 4d 65 65 74 73 20 54 68 65 20 45 79 65 95 2e 22 |Meets The Eye.."| 00001050 0d 05 b4 0f 20 20 20 45 51 55 42 20 20 20 30 0d |.... EQUB 0.| 00001060 05 be 05 3a 0d 05 c8 05 5d 0d 05 d2 20 f4 20 2a |...:....]... . *| 00001070 2a 2a 2a 20 45 6e 64 20 6f 66 20 6d 61 69 6e 20 |*** End of main | 00001080 63 6f 64 65 20 2a 2a 2a 2a 0d 05 dc 36 f4 20 53 |code ****...6. S| 00001090 65 74 20 66 69 6e 61 6c 20 70 6f 69 6e 74 65 72 |et final pointer| 000010a0 20 74 6f 20 66 69 6e 64 20 74 68 65 20 6c 65 6e | to find the len| 000010b0 67 74 68 20 6f 66 20 74 68 65 20 63 6f 64 65 0d |gth of the code.| 000010c0 05 e6 13 f2 70 61 74 63 68 5f 73 65 74 70 63 28 |....patch_setpc(| 000010d0 30 29 0d 05 f0 0b ed 20 70 61 73 73 25 0d 05 fa |0)..... pass%...| 000010e0 13 f2 70 61 74 63 68 5f 73 61 76 65 66 69 6c 65 |..patch_savefile| 000010f0 0d 06 18 28 f4 20 2a 2a 2a 2a 20 50 6f 73 74 2d |...(. **** Post-| 00001100 61 73 73 65 6d 62 6c 79 20 75 73 65 72 20 63 6f |assembly user co| 00001110 64 65 20 2a 2a 2a 2a 2a 0d 06 2c 05 e0 0d 06 36 |de *****..,....6| 00001120 05 3a 0d 06 40 21 f4 20 2a 2a 2a 2a 20 46 69 6c |.:..@!. **** Fil| 00001130 69 6e 67 20 70 72 6f 63 65 64 75 72 65 73 20 2a |ing procedures *| 00001140 2a 2a 2a 0d 06 4a 05 3a 0d 06 54 15 dd 20 f2 70 |***..J.:..T.. .p| 00001150 61 74 63 68 5f 6c 6f 61 64 66 69 6c 65 0d 06 5e |atch_loadfile..^| 00001160 0d 63 6f 64 65 6c 65 6e 3d 30 0d 06 68 0f de 20 |.codelen=0..h.. | 00001170 4d 43 25 20 26 31 34 30 30 0d 06 72 24 65 6e 64 |MC% &1400..r$end| 00001180 6f 66 63 6f 64 65 3d 63 6f 64 65 6c 65 6e 2b 26 |ofcode=codelen+&| 00001190 30 3a 6d 61 78 3d 63 6f 64 65 6c 65 6e 0d 06 7c |0:max=codelen..|| 000011a0 19 4c 25 3d 65 6e 64 6f 66 63 6f 64 65 3a 5f 5f |.L%=endofcode:__| 000011b0 63 61 70 25 3d a3 0d 06 e0 05 e1 0d 06 ea 05 3a |cap%=..........:| 000011c0 0d 06 f4 15 dd 20 f2 70 61 74 63 68 5f 73 61 76 |..... .patch_sav| 000011d0 65 66 69 6c 65 0d 06 fe 29 6f 75 74 66 69 6c 65 |efile...)outfile| 000011e0 24 3d 22 3c 53 70 61 63 65 64 46 69 6c 65 73 24 |$="<SpacedFiles$| 000011f0 44 69 72 3e 2e 53 70 63 46 69 6c 65 73 22 0d 07 |Dir>.SpcFiles"..| 00001200 08 31 ff 28 22 53 61 76 65 20 22 2b 6f 75 74 66 |.1.("Save "+outf| 00001210 69 6c 65 24 2b 22 20 22 2b c3 7e 4d 43 25 2b 22 |ile$+" "+.~MC%+"| 00001220 20 22 2b c3 7e 28 6d 61 78 2b 4d 43 25 29 29 0d | "+.~(max+MC%)).| 00001230 07 12 24 ff 28 22 53 65 74 74 79 70 65 20 22 2b |..$.("Settype "+| 00001240 6f 75 74 66 69 6c 65 24 2b 22 20 4d 6f 64 75 6c |outfile$+" Modul| 00001250 65 22 29 0d 07 1c 21 70 61 74 63 68 64 69 72 24 |e")...!patchdir$| 00001260 3d 22 3c 53 70 61 63 65 64 46 69 6c 65 73 24 44 |="<SpacedFiles$D| 00001270 69 72 3e 22 0d 07 44 05 e1 0d 07 4e 05 3a 0d 07 |ir>"..D....N.:..| 00001280 58 1d f4 20 2a 2a 2a 2a 20 45 72 72 6f 72 20 48 |X.. **** Error H| 00001290 61 6e 64 6c 65 72 20 2a 2a 2a 2a 0d 07 62 05 3a |andler ****..b.:| 000012a0 0d 07 6c 0b dd f2 45 72 72 6f 72 0d 07 bc 1b 85 |..l...Error.....| 000012b0 20 a2 20 9f 2c f6 24 2b 22 20 61 74 20 6c 69 6e | . .,.$+" at lin| 000012c0 65 20 22 2b c3 9e 0d 07 c6 05 e1 0d 07 d0 05 3a |e "+...........:| 000012d0 0d 07 da 22 f4 20 2a 2a 2a 2a 20 55 74 69 6c 69 |...". **** Utili| 000012e0 74 79 20 70 72 6f 63 65 64 75 72 65 73 20 2a 2a |ty procedures **| 000012f0 2a 2a 0d 07 e4 05 3a 0d 07 ee 14 dd f2 70 61 74 |**....:......pat| 00001300 63 68 5f 73 65 74 70 63 28 6e 29 0d 07 f8 1a e7 |ch_setpc(n).....| 00001310 20 50 25 2d 26 30 3e 6d 61 78 20 8c 6d 61 78 3d | P%-&0>max .max=| 00001320 50 25 2d 26 30 0d 08 02 14 50 25 3d 6e 3a 4f 25 |P%-&0....P%=n:O%| 00001330 3d 4d 43 25 2b 6e 2d 26 30 0d 08 0c 05 e1 0d 08 |=MC%+n-&0.......| 00001340 16 05 3a 0d 08 20 22 dd a4 66 69 6e 64 66 72 65 |..:.. "..findfre| 00001350 65 72 65 67 28 61 2c 62 2c 63 2c 64 29 3a ea 20 |ereg(a,b,c,d):. | 00001360 6e 3a 6e 3d 30 0d 08 2a 1c c8 95 20 6e 3d 61 20 |n:n=0..*... n=a | 00001370 84 20 6e 3d 62 20 84 20 6e 3d 63 20 84 20 6e 3d |. n=b . n=c . n=| 00001380 64 0d 08 34 09 20 6e 2b 3d 31 0d 08 3e 05 ce 0d |d..4. n+=1..>...| 00001390 08 48 06 3d 6e 0d 08 52 05 3a 0d 08 5c 28 f4 20 |.H.=n..R.:..\(. | 000013a0 2a 2a 2a 2a 20 4c 6f 6e 67 20 41 44 52 20 6d 61 |**** Long ADR ma| 000013b0 63 72 6f 20 70 72 6f 63 65 64 75 72 65 20 2a 2a |cro procedure **| 000013c0 2a 2a 0d 08 66 05 3a 0d 08 70 40 f4 20 44 45 53 |**..f.:..p@. DES| 000013d0 43 2e 20 3a 20 41 44 52 20 65 71 75 69 76 61 6c |C. : ADR equival| 000013e0 65 6e 74 20 66 6f 72 20 6c 6f 6e 67 20 61 64 64 |ent for long add| 000013f0 72 65 73 73 20 72 61 6e 67 65 73 2c 20 69 6e 20 |ress ranges, in | 00001400 32 20 69 6e 73 74 73 0d 08 7a 43 f4 20 45 4e 54 |2 insts..zC. ENT| 00001410 52 59 20 3a 20 63 6f 6e 64 24 20 3d 20 74 77 6f |RY : cond$ = two| 00001420 20 63 68 61 72 20 73 74 72 69 6e 67 2c 20 63 6f | char string, co| 00001430 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 41 52 4d |ntaining the ARM| 00001440 20 63 6f 6e 64 69 74 69 6f 6e 0d 08 84 1a f4 20 | condition..... | 00001450 20 20 20 20 20 20 20 20 72 65 67 25 20 3d 20 30 | reg% = 0| 00001460 2e 2e 31 35 0d 08 8e 2b f4 20 20 20 20 20 20 20 |..15...+. | 00001470 20 20 70 6f 69 6e 74 65 72 25 20 3d 20 6c 6f 6e | pointer% = lon| 00001480 67 20 72 61 6e 67 65 20 70 6f 69 6e 74 65 72 0d |g range pointer.| 00001490 08 98 42 f4 20 43 4f 4d 4d 2e 20 3a 20 70 61 73 |..B. COMM. : pas| 000014a0 73 25 20 3d 20 4f 50 54 20 76 61 72 69 61 62 6c |s% = OPT variabl| 000014b0 65 20 69 6e 20 74 68 65 20 61 73 73 65 6d 62 6c |e in the assembl| 000014c0 65 72 20 46 4f 52 2e 2e 4e 45 58 54 20 6c 6f 6f |er FOR..NEXT loo| 000014d0 70 0d 08 a2 2d f4 20 20 20 20 20 20 20 20 20 43 |p...-. C| 000014e0 61 6e 20 6f 6e 6c 79 20 68 61 6e 64 6c 65 20 36 |an only handle 6| 000014f0 34 20 4b 42 79 74 65 20 72 61 6e 67 65 73 0d 08 |4 KByte ranges..| 00001500 ac 1f dd a4 4c 41 44 52 28 63 6f 6e 64 24 2c 72 |....LADR(cond$,r| 00001510 65 67 25 2c 70 6f 69 6e 74 65 72 25 29 0d 08 b6 |eg%,pointer%)...| 00001520 21 ea 20 63 63 25 2c 64 69 66 66 25 2c 6c 6f 25 |!. cc%,diff%,lo%| 00001530 2c 68 69 25 2c 6f 70 31 25 2c 6f 70 32 25 0d 08 |,hi%,op1%,op2%..| 00001540 c0 23 e7 20 28 70 61 73 73 25 20 80 25 31 30 29 |.#. (pass% .%10)| 00001550 3d 30 20 50 25 2b 3d 38 3a 4f 25 2b 3d 38 3a 3d |=0 P%+=8:O%+=8:=| 00001560 30 0d 08 ca 73 e7 20 94 28 70 6f 69 6e 74 65 72 |0...s. .(pointer| 00001570 25 2d 50 25 29 3e 36 35 35 33 35 20 8c 20 85 20 |%-P%)>65535 . . | 00001580 31 2c 22 4c 41 44 52 20 63 61 6e 20 6f 6e 6c 79 |1,"LADR can only| 00001590 20 68 61 6e 64 6c 65 20 36 34 20 4b 42 79 74 65 | handle 64 KByte| 000015a0 20 72 61 6e 67 65 73 20 61 74 20 26 22 2b c3 7e | ranges at &"+.~| 000015b0 50 25 2b 22 20 28 26 22 2b c3 7e 28 70 6f 69 6e |P%+" (&"+.~(poin| 000015c0 74 65 72 25 2d 50 25 29 2b 22 20 64 69 73 74 61 |ter%-P%)+" dista| 000015d0 6e 74 29 22 0d 08 d4 27 e7 63 6f 6e 64 24 3d 22 |nt)"...'.cond$="| 000015e0 20 20 22 20 84 20 63 6f 6e 64 24 3d 22 22 20 20 | " . cond$="" | 000015f0 8c 63 6f 6e 64 24 3d 22 41 4c 22 0d 08 de 32 63 |.cond$="AL"...2c| 00001600 63 25 3d a7 22 45 51 4e 45 43 53 43 43 4d 49 50 |c%=."EQNECSCCMIP| 00001610 4c 56 53 56 43 48 49 4c 53 47 45 4c 54 47 54 4c |LVSVCHILSGELTGTL| 00001620 45 41 4c 4e 56 22 2c 63 6f 6e 64 24 29 0d 08 e8 |EALNV",cond$)...| 00001630 63 e7 20 63 63 25 3d 30 20 85 20 31 2c 22 46 41 |c. cc%=0 . 1,"FA| 00001640 54 41 4c 20 45 52 52 4f 52 20 3a 20 55 6e 6b 6e |TAL ERROR : Unkn| 00001650 6f 77 6e 20 63 6f 6e 64 69 74 69 6f 6e 20 66 6f |own condition fo| 00001660 72 20 4c 41 44 52 20 61 74 20 26 22 2b c3 7e 50 |r LADR at &"+.~P| 00001670 25 2b 22 20 28 26 22 2b c3 7e 4f 25 2b 22 29 22 |%+" (&"+.~O%+")"| 00001680 20 8b 20 63 63 25 3d 28 63 63 25 2d 31 29 81 32 | . cc%=(cc%-1).2| 00001690 0d 08 f2 17 64 69 66 66 25 3d 70 6f 69 6e 74 65 |....diff%=pointe| 000016a0 72 25 2d 50 25 2d 38 0d 08 fc 14 6c 6f 25 3d 94 |r%-P%-8....lo%=.| 000016b0 28 64 69 66 66 25 29 80 26 46 46 0d 09 06 16 68 |(diff%).&FF....h| 000016c0 69 25 3d 94 28 64 69 66 66 25 29 80 26 46 46 30 |i%=.(diff%).&FF0| 000016d0 30 0d 09 10 0e e7 64 69 66 66 25 3e 3d 30 8c 0d |0.....diff%>=0..| 000016e0 09 1a 2c 20 6f 70 31 25 3d 28 63 63 25 3c 3c 32 |.., op1%=(cc%<<2| 000016f0 38 29 2b 26 30 32 38 46 30 30 30 30 2b 28 72 65 |8)+&028F0000+(re| 00001700 67 25 3c 3c 31 32 29 2b 6c 6f 25 0d 09 24 3c 20 |g%<<12)+lo%..$< | 00001710 6f 70 32 25 3d 28 63 63 25 3c 3c 32 38 29 2b 26 |op2%=(cc%<<28)+&| 00001720 30 32 38 30 30 43 30 30 2b 28 72 65 67 25 3c 3c |02800C00+(reg%<<| 00001730 31 36 29 2b 28 72 65 67 25 3c 3c 31 32 29 2b 28 |16)+(reg%<<12)+(| 00001740 68 69 25 3e 3e 38 29 0d 09 2e 05 cc 0d 09 38 2c |hi%>>8).......8,| 00001750 20 6f 70 31 25 3d 28 63 63 25 3c 3c 32 38 29 2b | op1%=(cc%<<28)+| 00001760 26 30 32 34 46 30 30 30 30 2b 28 72 65 67 25 3c |&024F0000+(reg%<| 00001770 3c 31 32 29 2b 6c 6f 25 0d 09 42 3c 20 6f 70 32 |<12)+lo%..B< op2| 00001780 25 3d 28 63 63 25 3c 3c 32 38 29 2b 26 30 32 34 |%=(cc%<<28)+&024| 00001790 30 30 43 30 30 2b 28 72 65 67 25 3c 3c 31 36 29 |00C00+(reg%<<16)| 000017a0 2b 28 72 65 67 25 3c 3c 31 32 29 2b 28 68 69 25 |+(reg%<<12)+(hi%| 000017b0 3e 3e 38 29 0d 09 4c 05 cd 0d 09 56 24 5b 4f 50 |>>8)..L....V$[OP| 000017c0 54 20 70 61 73 73 25 3a 45 51 55 44 20 6f 70 31 |T pass%:EQUD op1| 000017d0 25 3a 45 51 55 44 20 6f 70 32 25 3a 5d 0d 09 60 |%:EQUD op2%:]..`| 000017e0 06 3d 30 0d 09 6a 05 3a 0d 7f 7f 0d f4 20 4a 46 |.=0..j.:..... JF| 000017f0 50 61 74 63 68 0d ff |Patch..| 000017f7