Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199604.adf » Features » StarInfo/Fletcher/AllWCD/PatchBas

StarInfo/Fletcher/AllWCD/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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199604.adf » Features
Filename: StarInfo/Fletcher/AllWCD/PatchBas
Read OK:
File size: 2106 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
   60REM **** Workspace structures ****
   70:
   80ptr=0:REM Start structure of createiconblock
   90`ci_window=ptr:ptr+=4
  100`ci_left=ptr:ptr+=4
  110`ci_bottom=ptr:ptr+=4
  120`ci_right=ptr:ptr+=4
  130`ci_top=ptr:ptr+=4
  140`ci_flags=ptr:ptr+=4
  150`ci_string=ptr:ptr+=4
  160`ci_valid=ptr:ptr+=4
  170`ci_len=ptr:ptr+=4
  180`len_createiconblock=ptr
  190:
  200ptr=0:REM Start structure of basiciconblock
  210`ib_left=ptr:ptr+=4
  220`ib_bottom=ptr:ptr+=4
  230`ib_right=ptr:ptr+=4
  240`ib_top=ptr:ptr+=4
  250`ib_flags=ptr:ptr+=4
  260`ib_string=ptr:ptr+=4
  270`ib_valid=ptr:ptr+=4
  280`ib_len=ptr:ptr+=4
  290`len_basiciconblock=ptr
  300:
  310ptr=0:REM Start structure of windowblock
  320`cw_left=ptr:ptr+=4
  330`cw_bottom=ptr:ptr+=4
  340`cw_right=ptr:ptr+=4
  350`cw_top=ptr:ptr+=4
  360`cw_vwaleft=ptr:ptr+=4
  370`cw_vwatop=ptr:ptr+=4
  380`cw_position=ptr:ptr+=4
  390`cw_winflags=ptr:ptr+=4
  400`cw_cols1=ptr:ptr+=4
  410`cw_cols2=ptr:ptr+=4
  420`cw_twaleft=ptr:ptr+=4
  430`cw_twabottom=ptr:ptr+=4
  440`cw_twaright=ptr:ptr+=4
  450`cw_tawtop=ptr:ptr+=4
  460`cw_tbflags=ptr:ptr+=4
  470`cw_tbbut=ptr:ptr+=4
  480`cw_sprite=ptr:ptr+=4
  490`cw_reserved=ptr:ptr+=4
  500`cw_title=ptr:ptr+=12
  510`cw_numicons=ptr:ptr+=4
  520`cw_icons=ptr:ptr+=`len_basiciconblock
  530`len_windowblock=ptr
  540:
  550sp=13:link=14:pc=15
  560vbit=1<<28:cbit=1<<29:zbit=1<<30:nbit=1<<31
  570P%=&0:O%=MC%
  580FOR pass%=4 TO 6 STEP2
  590REM **** Start of main code ****
  600PROCpatch_setpc(0)
  610[OPT pass%
  620          ; **** Add module header ****
  630   EQUD 0                  ; Start offset
  640   EQUD module_init        ; Initialisation offset
  650   EQUD module_final       ; Finalisation offset
  660   EQUD 0                  ; Service request offset
  670   EQUD module_title       ; Title string offset
  680   EQUD module_help        ; Help string offset
  690   EQUD module_commands    ; Help and command keyword table offset
  700:
  710.module_title
  720   EQUS "AllWCD"+CHR$0
  730   ALIGN
  740:
  750.module_help
  760   EQUS "All Write/Click/Drag"+CHR$9+"1.00 ("+MID$(TIME$,5,11)+") � Justin Fletcher"+CHR$0
  770   ALIGN
  780:
  790.module_init
  800   STMFD   (sp)!,{r0-r4,link}     ; Stack registers
  810; ***** WimpSWI claim code
  820   MOV     r0,#18
  830 FNLADR("",1,`module_WSWIname)
  840   SWI     "XOS_Module"           ; Look up module name
  850 FNLADR("VS",0,`module_WSWIerr)
  860   ADDVS   sp,sp,#4
  870   LDMVSFD (sp)!,{r1-r4,pc}
  880   LDR     r0,`module_WSWIword
  890   MOV     r2,r12
  900   MOV     r1,#2+(%10<<30)
  910 FNLADR("",3,createicon)
  920   MOV     r4,#0
  930   SWI     "Wimp_RegisterFilter"
  940   MOV     r1,#1+(%10<<30)
  950 FNLADR("",3,createwindow)
  960   MOV     r4,#0
  970   SWI     "Wimp_RegisterFilter"
  980   LDMFD   (sp)!,{r0-r4,pc}       ; restore registers
  990:
 1000.`module_WSWIerr
 1010   EQUD     &0
 1020   EQUS     "AllWCD requires the WimpSWIVe module to be present"+CHR$0
 1030.`module_WSWIname
 1040   EQUS     "WimpSWIVe"+CHR$0
 1050   ALIGN
 1060.`module_WSWIword
 1070   EQUS     "WSWI"
 1080:
 1090.module_final
 1100   STMFD   (sp)!,{r0-r4,r12,link} ; Stack registers
 1110; ***** WimpSWI release code
 1120   LDR     r0,`module_WSWIword
 1130   MOV     r2,r12
 1140   MOV     r1,#2+(%00<<30)
 1150 FNLADR("",3,createicon)
 1160   MOV     r4,#0
 1170   SWI     "Wimp_RegisterFilter"
 1180   MOV     r1,#1+(%00<<30)
 1190 FNLADR("",3,createwindow)
 1200   MOV     r4,#0
 1210   SWI     "Wimp_RegisterFilter"
 1220   LDMFD   (sp),{r0-r4}           ; restore registers
 1230   LDMFD   (sp)!,{r0-r4,r12,pc}   ; Return
 1240:
 1250; ***** Module commands table
 1260.module_commands
 1270   EQUS "AllWCD"           ; Command name
 1280   EQUB 0:ALIGN
 1290   EQUD 0                  ; Code to call
 1300   EQUD &0                 ; Flags
 1310   EQUD 0                  ; Syntax pointer
 1320   EQUD help_allwcd        ; Help pointer
 1330   EQUB 0
 1340   ALIGN
 1350:
 1360; ***** Help and Syntax messages
 1370.help_allwcd
 1380   EQUS "The AllWCD module forces all writable icons to be of type 14 "
 1390   EQUS "(Write/Click/Drag) rather than type 15 (Write only). The main reason you "
 1400   EQUS "may wish to do this is to force all applications to allow TextCopy to "
 1410   EQUS "drag all writable icons around the desktop."+CHR$13
 1420   EQUS "For best effect, the module should have been loaded BEFORE the desktop "
 1430   EQUS "has started. "
 1440   EQUB 0
 1450   ALIGN
 1460:
 1470          ; **** End of module header ****
 1480:
 1490.createicon
 1500   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
 1510   LDR     r2,[r1,#`ci_flags]
 1520          ; get the flags
 1530   AND     r0,r2,#&F000                  ; leave just button type
 1540   CMP     r0,#&F000                     ; is it type 15 ?
 1550   LDMNEFD (sp)!,{r0-r5,pc}              ; Return from call if not
 1560   BIC     r2,r2,#&1000                  ; clear bit 12 to leave type 14
 1570   STR     r2,[r1,#`ci_flags]
 1580          ; store back in block
 1590   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
 1600:
 1610.createwindow
 1620   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
 1630   LDR     r5,[r1,#`cw_numicons]
 1640          ; get the number of icons
 1650 FNLADD("  ",2,1,`cw_icons)
 1660          ; pointer to icon data
 1670.__z0_loop
 1680   CMP     r5,#0
 1690   BLE     __z0_exit
 1700   LDR     r3,[r2,#`ib_flags]
 1710          ; get the flags
 1720   AND     r0,r3,#&F000                  ; leave just button type
 1730   CMP     r0,#&F000                     ; is it type 15 ?
 1740   BNE     __z0_next                         ; if not then go on to next icon
 1750   BIC     r3,r3,#&1000                  ; clear bit 12 to leave type 14
 1760   STR     r3,[r2,#`ib_flags]
 1770          ; store back in block
 1780.__z0_next
 1790   ADD     r2,r2,#`len_basiciconblock    ; increment position
 1800   SUB     r5,r5,#1                      ; decrement number left
 1810   B       __z0_loop
 1820.__z0_exit
 1830   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
 1840:
 1850]
 1860REM **** End of main code ****
 1870REM Set final pointer to find the length of the code
 1880PROCpatch_setpc(0)
 1890NEXT pass%
 1900PROCpatch_savefile
 1930REM **** Post-assembly user code *****
 1950END
 1960:
 1970:
 1980REM **** Filing procedures ****
 1990:
 2000DEF PROCpatch_loadfile
 2010codelen=0
 2020DIM MC% &8000
 2030endofcode=codelen+&0:max=codelen
 2040L%=endofcode:__cap%=FALSE
 2140ENDPROC
 2150:
 2160DEF PROCpatch_savefile
 2170outfile$="<AllWriteClickDrag$Dir>.AllWCD"
 2180OSCLI("Save "+outfile$+" "+STR$~MC%+" "+STR$~(max+MC%))
 2190OSCLI("Settype "+outfile$+" Module")
 2200patchdir$="<AllWriteClickDrag$Dir>"
 2240ENDPROC
 2250:
 2260REM **** Error Handler ****
 2270:
 2280DEFPROCError
 2360ERROR EXT ERR,REPORT$+" at line "+STR$ERL
 2370ENDPROC
 2380:
 2390REM **** Utility procedures ****
 2400:
 2410DEFPROCpatch_setpc(n)
 2420IF P%-&0>max THENmax=P%-&0
 2430P%=n:O%=MC%+n-&0
 2440ENDPROC
 2450:
 2460DEFFNfindfreereg(a,b,c,d):LOCAL n:n=0
 2470WHILE n=a OR n=b OR n=c OR n=d
 2480 n+=1
 2490ENDWHILE
 2500=n
 2510:
 2520REM **** Long ADR macro procedure ****
 2530:
 2540REM DESC. : ADR equivalent for long address ranges, in 2 insts
 2550REM ENTRY : cond$ = two char string, containing the ARM condition
 2560REM         reg% = 0..15
 2570REM         pointer% = long range pointer
 2580REM COMM. : pass% = OPT variable in the assembler FOR..NEXT loop
 2590REM         Can only handle 64 KByte ranges
 2600DEFFNLADR(cond$,reg%,pointer%)
 2610LOCAL cc%,diff%,lo%,hi%,op1%,op2%
 2620IF (pass% AND%10)=0 P%+=8:O%+=8:=0
 2630IF ABS(pointer%-P%)>65535 THEN ERROR 1,"LADR can only handle 64 KByte ranges at &"+STR$~P%+" (&"+STR$~(pointer%-P%)+" distant)"
 2640IFcond$="  " OR cond$=""  THENcond$="AL"
 2650cc%=INSTR("EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)
 2660IF cc%=0 ERROR 1,"FATAL ERROR : Unknown condition for LADR at &"+STR$~P%+" (&"+STR$~O%+")" ELSE cc%=(cc%-1)DIV2
 2670diff%=pointer%-P%-8
 2680lo%=ABS(diff%)AND&FF
 2690hi%=ABS(diff%)AND&FF00
 2700IFdiff%>=0THEN
 2710 op1%=(cc%<<28)+&028F0000+(reg%<<12)+lo%
 2720 op2%=(cc%<<28)+&02800C00+(reg%<<16)+(reg%<<12)+(hi%>>8)
 2730ELSE
 2740 op1%=(cc%<<28)+&024F0000+(reg%<<12)+lo%
 2750 op2%=(cc%<<28)+&02400C00+(reg%<<16)+(reg%<<12)+(hi%>>8)
 2760ENDIF
 2770[OPT pass%:EQUD op1%:EQUD op2%:]
 2780=0
 2790:
 2800REM **** Long ADD macro instruction ****
 2810:
 2820DEFFNLADD(cond$,reg1,reg2,value)
 2830IF cond$="" OR cond$="  " THENcond$="AL"
 2840cond=(INSTR("EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)-1)/2
 2850add1=(&28<<20)+(reg1<<12)+(reg2<<16)+(cond<<28)
 2860add2=(&28<<20)+(reg1<<12)+(reg1<<16)+(cond<<28)
 2870shift=0
 2880REPEAT
 2890 WHILE (value AND 3)=0 AND shift<16
 2900  shift+=1:value=value DIV4
 2910 ENDWHILE
 2920 xshift=16-shift:IF xshift=16 THENxshift=0
 2930 IF add1<>0 THEN
 2940  [OPT pass%:EQUDadd1+(xshift<<8)+(value AND 255):]
 2950  add1=0
 2960 ELSE
 2970  [OPT pass%:EQUDadd2+(xshift<<8)+(value AND 255):]
 2980 ENDIF
 2990 value=value DIV256:shift+=4
 3000UNTILvalue=0
 3010=0
 3020:
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
<$� **** Workspace structures ****
F:
P.ptr=0:� Start structure of createiconblock
Z`ci_window=ptr:ptr+=4
d`ci_left=ptr:ptr+=4
n`ci_bottom=ptr:ptr+=4
x`ci_right=ptr:ptr+=4
�`ci_top=ptr:ptr+=4
�`ci_flags=ptr:ptr+=4
�`ci_string=ptr:ptr+=4
�`ci_valid=ptr:ptr+=4
�`ci_len=ptr:ptr+=4
�`len_createiconblock=ptr
�:
�-ptr=0:� Start structure of basiciconblock
�`ib_left=ptr:ptr+=4
�`ib_bottom=ptr:ptr+=4
�`ib_right=ptr:ptr+=4
�`ib_top=ptr:ptr+=4
�`ib_flags=ptr:ptr+=4
`ib_string=ptr:ptr+=4
`ib_valid=ptr:ptr+=4
`ib_len=ptr:ptr+=4
"`len_basiciconblock=ptr
,:
6*ptr=0:� Start structure of windowblock
@`cw_left=ptr:ptr+=4
J`cw_bottom=ptr:ptr+=4
T`cw_right=ptr:ptr+=4
^`cw_top=ptr:ptr+=4
h`cw_vwaleft=ptr:ptr+=4
r`cw_vwatop=ptr:ptr+=4
|`cw_position=ptr:ptr+=4
�`cw_winflags=ptr:ptr+=4
�`cw_cols1=ptr:ptr+=4
�`cw_cols2=ptr:ptr+=4
�`cw_twaleft=ptr:ptr+=4
�`cw_twabottom=ptr:ptr+=4
�`cw_twaright=ptr:ptr+=4
�`cw_tawtop=ptr:ptr+=4
�`cw_tbflags=ptr:ptr+=4
�`cw_tbbut=ptr:ptr+=4
�`cw_sprite=ptr:ptr+=4
�`cw_reserved=ptr:ptr+=4
�`cw_title=ptr:ptr+=12
�`cw_numicons=ptr:ptr+=4
*`cw_icons=ptr:ptr+=`len_basiciconblock
`len_windowblock=ptr
:
&sp=13:link=14:pc=15
0/vbit=1<<28:cbit=1<<29:zbit=1<<30:nbit=1<<31
:P%=&0:O%=MC%
D� pass%=4 � 6 �2
N"� **** Start of main code ****
X�patch_setpc(0)
b[OPT pass%
l+          ; **** Add module header ****
v-   EQUD 0                  ; Start offset
�6   EQUD module_init        ; Initialisation offset
�4   EQUD module_final       ; Finalisation offset
�7   EQUD 0                  ; 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
�   EQUS "AllWCD"+�0
�   ALIGN
�:
�.module_help
�Q   EQUS "All Write/Click/Drag"+�9+"1.00 ("+��$,5,11)+") � Justin Fletcher"+�0
   ALIGN
:
.module_init
 7   STMFD   (sp)!,{r0-r4,link}     ; Stack registers
*; ***** WimpSWI claim code
4   MOV     r0,#18
>! �LADR("",1,`module_WSWIname)
H;   SWI     "XOS_Module"           ; Look up module name
R" �LADR("VS",0,`module_WSWIerr)
\   ADDVS   sp,sp,#4
f   LDMVSFD (sp)!,{r1-r4,pc}
p"   LDR     r0,`module_WSWIword
z   MOV     r2,r12
�   MOV     r1,#2+(%10<<30)
� �LADR("",3,createicon)
�   MOV     r4,#0
�$   SWI     "Wimp_RegisterFilter"
�   MOV     r1,#1+(%10<<30)
� �LADR("",3,createwindow)
�   MOV     r4,#0
�$   SWI     "Wimp_RegisterFilter"
�9   LDMFD   (sp)!,{r0-r4,pc}       ; restore registers
�:
�.`module_WSWIerr
�   EQUD     &0
�G   EQUS     "AllWCD requires the WimpSWIVe module to be present"+�0
.`module_WSWIname
   EQUS     "WimpSWIVe"+�0
   ALIGN
$.`module_WSWIword
.   EQUS     "WSWI"
8:
B.module_final
L7   STMFD   (sp)!,{r0-r4,r12,link} ; Stack registers
V ; ***** WimpSWI release code
`"   LDR     r0,`module_WSWIword
j   MOV     r2,r12
t   MOV     r1,#2+(%00<<30)
~ �LADR("",3,createicon)
�   MOV     r4,#0
�$   SWI     "Wimp_RegisterFilter"
�   MOV     r1,#1+(%00<<30)
� �LADR("",3,createwindow)
�   MOV     r4,#0
�$   SWI     "Wimp_RegisterFilter"
�9   LDMFD   (sp),{r0-r4}           ; restore registers
�.   LDMFD   (sp)!,{r0-r4,r12,pc}   ; Return
�:
�!; ***** Module commands table
�.module_commands
�-   EQUS "AllWCD"           ; Command name
   EQUB 0:ALIGN

-   EQUD 0                  ; Code to call
&   EQUD &0                 ; Flags
/   EQUD 0                  ; Syntax pointer
(-   EQUD help_allwcd        ; Help pointer
2
   EQUB 0
<   ALIGN
F:
P$; ***** Help and Syntax messages
Z.help_allwcd
dK   EQUS "The AllWCD module forces all writable icons to be of type 14 "
nW   EQUS "(Write/Click/Drag) rather than type 15 (Write only). The main reason you "
xT   EQUS "may wish to do this is to force all applications to allow TextCopy to "
�=   EQUS "drag all writable icons around the desktop."+�13
�U   EQUS "For best effect, the module should have been loaded BEFORE the desktop "
�   EQUS "has started. "
�
   EQUB 0
�   ALIGN
�:
�.          ; **** End of module header ****
�:
�.createicon
�>   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
�!   LDR     r2,[r1,#`ci_flags]
�          ; get the flags
�C   �     r0,r2,#&F000                  ; leave just button type
>   CMP     r0,#&F000                     ; is it type 15 ?
F   LDMNEFD (sp)!,{r0-r5,pc}              ; Return from call if not
L   BIC     r2,r2,#&1000                  ; clear bit 12 to leave type 14
"!   STR     r2,[r1,#`ci_flags]
,#          ; store back in block
6?   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
@:
J.createwindow
T>   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
^$   LDR     r5,[r1,#`cw_numicons]
h'          ; get the number of icons
r �LADD("  ",2,1,`cw_icons)
|$          ; pointer to icon data
�.__z0_loop
�   CMP     r5,#0
�   BLE     __z0_exit
�!   LDR     r3,[r2,#`ib_flags]
�          ; get the flags
�C   �     r0,r3,#&F000                  ; leave just button type
�>   CMP     r0,#&F000                     ; is it type 15 ?
�Q   BNE     __z0_next                         ; if not then go on to next icon
�L   BIC     r3,r3,#&1000                  ; clear bit 12 to leave type 14
�!   STR     r3,[r2,#`ib_flags]
�#          ; store back in block
�.__z0_next
�A   ADD     r2,r2,#`len_basiciconblock    ; increment position
D   SUB     r5,r5,#1                      ; decrement number left
   B       __z0_loop
.__z0_exit
&?   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
0:
:]
D � **** End of main code ****
N6� Set final pointer to find the length of the code
X�patch_setpc(0)
b� pass%
l�patch_savefile
�(� **** Post-assembly user code *****
��
�:
�:
�!� **** Filing procedures ****
�:
�� �patch_loadfile
�
codelen=0
�� MC% &8000
�$endofcode=codelen+&0:max=codelen
�L%=endofcode:__cap%=�
\�
f:
p� �patch_savefile
z-outfile$="<AllWriteClickDrag$Dir>.AllWCD"
�1�("Save "+outfile$+" "+�~MC%+" "+�~(max+MC%))
�$�("Settype "+outfile$+" Module")
�'patchdir$="<AllWriteClickDrag$Dir>"
��
�:
�� **** Error Handler ****
�:
���Error
	8� � �,�$+" at line "+Þ
	B�
	L:
	V"� **** Utility procedures ****
	`:
	j��patch_setpc(n)
	t� 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
	�	 n+=1
	��
	�=n
	�:
	�(� **** Long ADR macro procedure ****
	�:
	�@� DESC. : ADR equivalent for long address ranges, in 2 insts
	�C� 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%)
2!� cc%,diff%,lo%,hi%,op1%,op2%
<#� (pass% �%10)=0 P%+=8:O%+=8:=0
Fs� �(pointer%-P%)>65535 � � 1,"LADR can only handle 64 KByte ranges at &"+�~P%+" (&"+�~(pointer%-P%)+" distant)"
P'�cond$="  " � cond$=""  �cond$="AL"
Z2cc%=�"EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)
dc� cc%=0 � 1,"FATAL ERROR : Unknown condition for LADR at &"+�~P%+" (&"+�~O%+")" � cc%=(cc%-1)�2
ndiff%=pointer%-P%-8
xlo%=�(diff%)�&FF
�hi%=�(diff%)�&FF00
��diff%>=0�
�, op1%=(cc%<<28)+&028F0000+(reg%<<12)+lo%
�< op2%=(cc%<<28)+&02800C00+(reg%<<16)+(reg%<<12)+(hi%>>8)
��
�, op1%=(cc%<<28)+&024F0000+(reg%<<12)+lo%
�< op2%=(cc%<<28)+&02400C00+(reg%<<16)+(reg%<<12)+(hi%>>8)
��
�$[OPT pass%:EQUD op1%:EQUD op2%:]
�=0
�:
�*� **** Long ADD macro instruction ****
�:
!ݤLADD(cond$,reg1,reg2,value)
'� cond$="" � cond$="  " �cond$="AL"
9cond=(�"EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)-1)/2
"3add1=(&28<<20)+(reg1<<12)+(reg2<<16)+(cond<<28)
,3add2=(&28<<20)+(reg1<<12)+(reg1<<16)+(cond<<28)
6shift=0
@�
J  ȕ (value � 3)=0 � shift<16
T  shift+=1:value=value �4
^ �
h* xshift=16-shift:� xshift=16 �xshift=0
r � add1<>0 �
|5  [OPT pass%:EQUDadd1+(xshift<<8)+(value � 255):]
�  add1=0
� �
�5  [OPT pass%:EQUDadd2+(xshift<<8)+(value � 255):]
� �
� value=value �256:shift+=4
��value=0
�=0
�:

� 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 24 f4 20 2a 2a 2a 2a  20 57 6f 72 6b 73 70 61  |<$. **** Workspa|
000000c0  63 65 20 73 74 72 75 63  74 75 72 65 73 20 2a 2a  |ce structures **|
000000d0  2a 2a 0d 00 46 05 3a 0d  00 50 2e 70 74 72 3d 30  |**..F.:..P.ptr=0|
000000e0  3a f4 20 53 74 61 72 74  20 73 74 72 75 63 74 75  |:. Start structu|
000000f0  72 65 20 6f 66 20 63 72  65 61 74 65 69 63 6f 6e  |re of createicon|
00000100  62 6c 6f 63 6b 0d 00 5a  19 60 63 69 5f 77 69 6e  |block..Z.`ci_win|
00000110  64 6f 77 3d 70 74 72 3a  70 74 72 2b 3d 34 0d 00  |dow=ptr:ptr+=4..|
00000120  64 17 60 63 69 5f 6c 65  66 74 3d 70 74 72 3a 70  |d.`ci_left=ptr:p|
00000130  74 72 2b 3d 34 0d 00 6e  19 60 63 69 5f 62 6f 74  |tr+=4..n.`ci_bot|
00000140  74 6f 6d 3d 70 74 72 3a  70 74 72 2b 3d 34 0d 00  |tom=ptr:ptr+=4..|
00000150  78 18 60 63 69 5f 72 69  67 68 74 3d 70 74 72 3a  |x.`ci_right=ptr:|
00000160  70 74 72 2b 3d 34 0d 00  82 16 60 63 69 5f 74 6f  |ptr+=4....`ci_to|
00000170  70 3d 70 74 72 3a 70 74  72 2b 3d 34 0d 00 8c 18  |p=ptr:ptr+=4....|
00000180  60 63 69 5f 66 6c 61 67  73 3d 70 74 72 3a 70 74  |`ci_flags=ptr:pt|
00000190  72 2b 3d 34 0d 00 96 19  60 63 69 5f 73 74 72 69  |r+=4....`ci_stri|
000001a0  6e 67 3d 70 74 72 3a 70  74 72 2b 3d 34 0d 00 a0  |ng=ptr:ptr+=4...|
000001b0  18 60 63 69 5f 76 61 6c  69 64 3d 70 74 72 3a 70  |.`ci_valid=ptr:p|
000001c0  74 72 2b 3d 34 0d 00 aa  16 60 63 69 5f 6c 65 6e  |tr+=4....`ci_len|
000001d0  3d 70 74 72 3a 70 74 72  2b 3d 34 0d 00 b4 1c 60  |=ptr:ptr+=4....`|
000001e0  6c 65 6e 5f 63 72 65 61  74 65 69 63 6f 6e 62 6c  |len_createiconbl|
000001f0  6f 63 6b 3d 70 74 72 0d  00 be 05 3a 0d 00 c8 2d  |ock=ptr....:...-|
00000200  70 74 72 3d 30 3a f4 20  53 74 61 72 74 20 73 74  |ptr=0:. Start st|
00000210  72 75 63 74 75 72 65 20  6f 66 20 62 61 73 69 63  |ructure of basic|
00000220  69 63 6f 6e 62 6c 6f 63  6b 0d 00 d2 17 60 69 62  |iconblock....`ib|
00000230  5f 6c 65 66 74 3d 70 74  72 3a 70 74 72 2b 3d 34  |_left=ptr:ptr+=4|
00000240  0d 00 dc 19 60 69 62 5f  62 6f 74 74 6f 6d 3d 70  |....`ib_bottom=p|
00000250  74 72 3a 70 74 72 2b 3d  34 0d 00 e6 18 60 69 62  |tr:ptr+=4....`ib|
00000260  5f 72 69 67 68 74 3d 70  74 72 3a 70 74 72 2b 3d  |_right=ptr:ptr+=|
00000270  34 0d 00 f0 16 60 69 62  5f 74 6f 70 3d 70 74 72  |4....`ib_top=ptr|
00000280  3a 70 74 72 2b 3d 34 0d  00 fa 18 60 69 62 5f 66  |:ptr+=4....`ib_f|
00000290  6c 61 67 73 3d 70 74 72  3a 70 74 72 2b 3d 34 0d  |lags=ptr:ptr+=4.|
000002a0  01 04 19 60 69 62 5f 73  74 72 69 6e 67 3d 70 74  |...`ib_string=pt|
000002b0  72 3a 70 74 72 2b 3d 34  0d 01 0e 18 60 69 62 5f  |r:ptr+=4....`ib_|
000002c0  76 61 6c 69 64 3d 70 74  72 3a 70 74 72 2b 3d 34  |valid=ptr:ptr+=4|
000002d0  0d 01 18 16 60 69 62 5f  6c 65 6e 3d 70 74 72 3a  |....`ib_len=ptr:|
000002e0  70 74 72 2b 3d 34 0d 01  22 1b 60 6c 65 6e 5f 62  |ptr+=4..".`len_b|
000002f0  61 73 69 63 69 63 6f 6e  62 6c 6f 63 6b 3d 70 74  |asiciconblock=pt|
00000300  72 0d 01 2c 05 3a 0d 01  36 2a 70 74 72 3d 30 3a  |r..,.:..6*ptr=0:|
00000310  f4 20 53 74 61 72 74 20  73 74 72 75 63 74 75 72  |. Start structur|
00000320  65 20 6f 66 20 77 69 6e  64 6f 77 62 6c 6f 63 6b  |e of windowblock|
00000330  0d 01 40 17 60 63 77 5f  6c 65 66 74 3d 70 74 72  |..@.`cw_left=ptr|
00000340  3a 70 74 72 2b 3d 34 0d  01 4a 19 60 63 77 5f 62  |:ptr+=4..J.`cw_b|
00000350  6f 74 74 6f 6d 3d 70 74  72 3a 70 74 72 2b 3d 34  |ottom=ptr:ptr+=4|
00000360  0d 01 54 18 60 63 77 5f  72 69 67 68 74 3d 70 74  |..T.`cw_right=pt|
00000370  72 3a 70 74 72 2b 3d 34  0d 01 5e 16 60 63 77 5f  |r:ptr+=4..^.`cw_|
00000380  74 6f 70 3d 70 74 72 3a  70 74 72 2b 3d 34 0d 01  |top=ptr:ptr+=4..|
00000390  68 1a 60 63 77 5f 76 77  61 6c 65 66 74 3d 70 74  |h.`cw_vwaleft=pt|
000003a0  72 3a 70 74 72 2b 3d 34  0d 01 72 19 60 63 77 5f  |r:ptr+=4..r.`cw_|
000003b0  76 77 61 74 6f 70 3d 70  74 72 3a 70 74 72 2b 3d  |vwatop=ptr:ptr+=|
000003c0  34 0d 01 7c 1b 60 63 77  5f 70 6f 73 69 74 69 6f  |4..|.`cw_positio|
000003d0  6e 3d 70 74 72 3a 70 74  72 2b 3d 34 0d 01 86 1b  |n=ptr:ptr+=4....|
000003e0  60 63 77 5f 77 69 6e 66  6c 61 67 73 3d 70 74 72  |`cw_winflags=ptr|
000003f0  3a 70 74 72 2b 3d 34 0d  01 90 18 60 63 77 5f 63  |:ptr+=4....`cw_c|
00000400  6f 6c 73 31 3d 70 74 72  3a 70 74 72 2b 3d 34 0d  |ols1=ptr:ptr+=4.|
00000410  01 9a 18 60 63 77 5f 63  6f 6c 73 32 3d 70 74 72  |...`cw_cols2=ptr|
00000420  3a 70 74 72 2b 3d 34 0d  01 a4 1a 60 63 77 5f 74  |:ptr+=4....`cw_t|
00000430  77 61 6c 65 66 74 3d 70  74 72 3a 70 74 72 2b 3d  |waleft=ptr:ptr+=|
00000440  34 0d 01 ae 1c 60 63 77  5f 74 77 61 62 6f 74 74  |4....`cw_twabott|
00000450  6f 6d 3d 70 74 72 3a 70  74 72 2b 3d 34 0d 01 b8  |om=ptr:ptr+=4...|
00000460  1b 60 63 77 5f 74 77 61  72 69 67 68 74 3d 70 74  |.`cw_twaright=pt|
00000470  72 3a 70 74 72 2b 3d 34  0d 01 c2 19 60 63 77 5f  |r:ptr+=4....`cw_|
00000480  74 61 77 74 6f 70 3d 70  74 72 3a 70 74 72 2b 3d  |tawtop=ptr:ptr+=|
00000490  34 0d 01 cc 1a 60 63 77  5f 74 62 66 6c 61 67 73  |4....`cw_tbflags|
000004a0  3d 70 74 72 3a 70 74 72  2b 3d 34 0d 01 d6 18 60  |=ptr:ptr+=4....`|
000004b0  63 77 5f 74 62 62 75 74  3d 70 74 72 3a 70 74 72  |cw_tbbut=ptr:ptr|
000004c0  2b 3d 34 0d 01 e0 19 60  63 77 5f 73 70 72 69 74  |+=4....`cw_sprit|
000004d0  65 3d 70 74 72 3a 70 74  72 2b 3d 34 0d 01 ea 1b  |e=ptr:ptr+=4....|
000004e0  60 63 77 5f 72 65 73 65  72 76 65 64 3d 70 74 72  |`cw_reserved=ptr|
000004f0  3a 70 74 72 2b 3d 34 0d  01 f4 19 60 63 77 5f 74  |:ptr+=4....`cw_t|
00000500  69 74 6c 65 3d 70 74 72  3a 70 74 72 2b 3d 31 32  |itle=ptr:ptr+=12|
00000510  0d 01 fe 1b 60 63 77 5f  6e 75 6d 69 63 6f 6e 73  |....`cw_numicons|
00000520  3d 70 74 72 3a 70 74 72  2b 3d 34 0d 02 08 2a 60  |=ptr:ptr+=4...*`|
00000530  63 77 5f 69 63 6f 6e 73  3d 70 74 72 3a 70 74 72  |cw_icons=ptr:ptr|
00000540  2b 3d 60 6c 65 6e 5f 62  61 73 69 63 69 63 6f 6e  |+=`len_basicicon|
00000550  62 6c 6f 63 6b 0d 02 12  18 60 6c 65 6e 5f 77 69  |block....`len_wi|
00000560  6e 64 6f 77 62 6c 6f 63  6b 3d 70 74 72 0d 02 1c  |ndowblock=ptr...|
00000570  05 3a 0d 02 26 17 73 70  3d 31 33 3a 6c 69 6e 6b  |.:..&.sp=13:link|
00000580  3d 31 34 3a 70 63 3d 31  35 0d 02 30 2f 76 62 69  |=14:pc=15..0/vbi|
00000590  74 3d 31 3c 3c 32 38 3a  63 62 69 74 3d 31 3c 3c  |t=1<<28:cbit=1<<|
000005a0  32 39 3a 7a 62 69 74 3d  31 3c 3c 33 30 3a 6e 62  |29:zbit=1<<30:nb|
000005b0  69 74 3d 31 3c 3c 33 31  0d 02 3a 10 50 25 3d 26  |it=1<<31..:.P%=&|
000005c0  30 3a 4f 25 3d 4d 43 25  0d 02 44 14 e3 20 70 61  |0:O%=MC%..D.. pa|
000005d0  73 73 25 3d 34 20 b8 20  36 20 88 32 0d 02 4e 22  |ss%=4 . 6 .2..N"|
000005e0  f4 20 2a 2a 2a 2a 20 53  74 61 72 74 20 6f 66 20  |. **** Start of |
000005f0  6d 61 69 6e 20 63 6f 64  65 20 2a 2a 2a 2a 0d 02  |main code ****..|
00000600  58 13 f2 70 61 74 63 68  5f 73 65 74 70 63 28 30  |X..patch_setpc(0|
00000610  29 0d 02 62 0e 5b 4f 50  54 20 70 61 73 73 25 0d  |)..b.[OPT pass%.|
00000620  02 6c 2b 20 20 20 20 20  20 20 20 20 20 3b 20 2a  |.l+          ; *|
00000630  2a 2a 2a 20 41 64 64 20  6d 6f 64 75 6c 65 20 68  |*** Add module h|
00000640  65 61 64 65 72 20 2a 2a  2a 2a 0d 02 76 2d 20 20  |eader ****..v-  |
00000650  20 45 51 55 44 20 30 20  20 20 20 20 20 20 20 20  | EQUD 0         |
00000660  20 20 20 20 20 20 20 20  20 3b 20 53 74 61 72 74  |         ; Start|
00000670  20 6f 66 66 73 65 74 0d  02 80 36 20 20 20 45 51  | offset...6   EQ|
00000680  55 44 20 6d 6f 64 75 6c  65 5f 69 6e 69 74 20 20  |UD module_init  |
00000690  20 20 20 20 20 20 3b 20  49 6e 69 74 69 61 6c 69  |      ; Initiali|
000006a0  73 61 74 69 6f 6e 20 6f  66 66 73 65 74 0d 02 8a  |sation offset...|
000006b0  34 20 20 20 45 51 55 44  20 6d 6f 64 75 6c 65 5f  |4   EQUD module_|
000006c0  66 69 6e 61 6c 20 20 20  20 20 20 20 3b 20 46 69  |final       ; Fi|
000006d0  6e 61 6c 69 73 61 74 69  6f 6e 20 6f 66 66 73 65  |nalisation offse|
000006e0  74 0d 02 94 37 20 20 20  45 51 55 44 20 30 20 20  |t...7   EQUD 0  |
000006f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000700  3b 20 53 65 72 76 69 63  65 20 72 65 71 75 65 73  |; Service reques|
00000710  74 20 6f 66 66 73 65 74  0d 02 9e 34 20 20 20 45  |t offset...4   E|
00000720  51 55 44 20 6d 6f 64 75  6c 65 5f 74 69 74 6c 65  |QUD module_title|
00000730  20 20 20 20 20 20 20 3b  20 54 69 74 6c 65 20 73  |       ; Title s|
00000740  74 72 69 6e 67 20 6f 66  66 73 65 74 0d 02 a8 33  |tring offset...3|
00000750  20 20 20 45 51 55 44 20  6d 6f 64 75 6c 65 5f 68  |   EQUD module_h|
00000760  65 6c 70 20 20 20 20 20  20 20 20 3b 20 48 65 6c  |elp        ; Hel|
00000770  70 20 73 74 72 69 6e 67  20 6f 66 66 73 65 74 0d  |p string offset.|
00000780  02 b2 46 20 20 20 45 51  55 44 20 6d 6f 64 75 6c  |..F   EQUD modul|
00000790  65 5f 63 6f 6d 6d 61 6e  64 73 20 20 20 20 3b 20  |e_commands    ; |
000007a0  48 65 6c 70 20 61 6e 64  20 63 6f 6d 6d 61 6e 64  |Help and command|
000007b0  20 6b 65 79 77 6f 72 64  20 74 61 62 6c 65 20 6f  | keyword table o|
000007c0  66 66 73 65 74 0d 02 bc  05 3a 0d 02 c6 11 2e 6d  |ffset....:.....m|
000007d0  6f 64 75 6c 65 5f 74 69  74 6c 65 0d 02 d0 17 20  |odule_title.... |
000007e0  20 20 45 51 55 53 20 22  41 6c 6c 57 43 44 22 2b  |  EQUS "AllWCD"+|
000007f0  bd 30 0d 02 da 0c 20 20  20 41 4c 49 47 4e 0d 02  |.0....   ALIGN..|
00000800  e4 05 3a 0d 02 ee 10 2e  6d 6f 64 75 6c 65 5f 68  |..:.....module_h|
00000810  65 6c 70 0d 02 f8 51 20  20 20 45 51 55 53 20 22  |elp...Q   EQUS "|
00000820  41 6c 6c 20 57 72 69 74  65 2f 43 6c 69 63 6b 2f  |All Write/Click/|
00000830  44 72 61 67 22 2b bd 39  2b 22 31 2e 30 30 20 28  |Drag"+.9+"1.00 (|
00000840  22 2b c1 91 24 2c 35 2c  31 31 29 2b 22 29 20 a9  |"+..$,5,11)+") .|
00000850  20 4a 75 73 74 69 6e 20  46 6c 65 74 63 68 65 72  | Justin Fletcher|
00000860  22 2b bd 30 0d 03 02 0c  20 20 20 41 4c 49 47 4e  |"+.0....   ALIGN|
00000870  0d 03 0c 05 3a 0d 03 16  10 2e 6d 6f 64 75 6c 65  |....:.....module|
00000880  5f 69 6e 69 74 0d 03 20  37 20 20 20 53 54 4d 46  |_init.. 7   STMF|
00000890  44 20 20 20 28 73 70 29  21 2c 7b 72 30 2d 72 34  |D   (sp)!,{r0-r4|
000008a0  2c 6c 69 6e 6b 7d 20 20  20 20 20 3b 20 53 74 61  |,link}     ; Sta|
000008b0  63 6b 20 72 65 67 69 73  74 65 72 73 0d 03 2a 1e  |ck registers..*.|
000008c0  3b 20 2a 2a 2a 2a 2a 20  57 69 6d 70 53 57 49 20  |; ***** WimpSWI |
000008d0  63 6c 61 69 6d 20 63 6f  64 65 0d 03 34 15 20 20  |claim code..4.  |
000008e0  20 4d 4f 56 20 20 20 20  20 72 30 2c 23 31 38 0d  | MOV     r0,#18.|
000008f0  03 3e 21 20 a4 4c 41 44  52 28 22 22 2c 31 2c 60  |.>! .LADR("",1,`|
00000900  6d 6f 64 75 6c 65 5f 57  53 57 49 6e 61 6d 65 29  |module_WSWIname)|
00000910  0d 03 48 3b 20 20 20 53  57 49 20 20 20 20 20 22  |..H;   SWI     "|
00000920  58 4f 53 5f 4d 6f 64 75  6c 65 22 20 20 20 20 20  |XOS_Module"     |
00000930  20 20 20 20 20 20 3b 20  4c 6f 6f 6b 20 75 70 20  |      ; Look up |
00000940  6d 6f 64 75 6c 65 20 6e  61 6d 65 0d 03 52 22 20  |module name..R" |
00000950  a4 4c 41 44 52 28 22 56  53 22 2c 30 2c 60 6d 6f  |.LADR("VS",0,`mo|
00000960  64 75 6c 65 5f 57 53 57  49 65 72 72 29 0d 03 5c  |dule_WSWIerr)..\|
00000970  17 20 20 20 41 44 44 56  53 20 20 20 73 70 2c 73  |.   ADDVS   sp,s|
00000980  70 2c 23 34 0d 03 66 1f  20 20 20 4c 44 4d 56 53  |p,#4..f.   LDMVS|
00000990  46 44 20 28 73 70 29 21  2c 7b 72 31 2d 72 34 2c  |FD (sp)!,{r1-r4,|
000009a0  70 63 7d 0d 03 70 22 20  20 20 4c 44 52 20 20 20  |pc}..p"   LDR   |
000009b0  20 20 72 30 2c 60 6d 6f  64 75 6c 65 5f 57 53 57  |  r0,`module_WSW|
000009c0  49 77 6f 72 64 0d 03 7a  15 20 20 20 4d 4f 56 20  |Iword..z.   MOV |
000009d0  20 20 20 20 72 32 2c 72  31 32 0d 03 84 1e 20 20  |    r2,r12....  |
000009e0  20 4d 4f 56 20 20 20 20  20 72 31 2c 23 32 2b 28  | MOV     r1,#2+(|
000009f0  25 31 30 3c 3c 33 30 29  0d 03 8e 1b 20 a4 4c 41  |%10<<30).... .LA|
00000a00  44 52 28 22 22 2c 33 2c  63 72 65 61 74 65 69 63  |DR("",3,createic|
00000a10  6f 6e 29 0d 03 98 14 20  20 20 4d 4f 56 20 20 20  |on)....   MOV   |
00000a20  20 20 72 34 2c 23 30 0d  03 a2 24 20 20 20 53 57  |  r4,#0...$   SW|
00000a30  49 20 20 20 20 20 22 57  69 6d 70 5f 52 65 67 69  |I     "Wimp_Regi|
00000a40  73 74 65 72 46 69 6c 74  65 72 22 0d 03 ac 1e 20  |sterFilter".... |
00000a50  20 20 4d 4f 56 20 20 20  20 20 72 31 2c 23 31 2b  |  MOV     r1,#1+|
00000a60  28 25 31 30 3c 3c 33 30  29 0d 03 b6 1d 20 a4 4c  |(%10<<30).... .L|
00000a70  41 44 52 28 22 22 2c 33  2c 63 72 65 61 74 65 77  |ADR("",3,createw|
00000a80  69 6e 64 6f 77 29 0d 03  c0 14 20 20 20 4d 4f 56  |indow)....   MOV|
00000a90  20 20 20 20 20 72 34 2c  23 30 0d 03 ca 24 20 20  |     r4,#0...$  |
00000aa0  20 53 57 49 20 20 20 20  20 22 57 69 6d 70 5f 52  | SWI     "Wimp_R|
00000ab0  65 67 69 73 74 65 72 46  69 6c 74 65 72 22 0d 03  |egisterFilter"..|
00000ac0  d4 39 20 20 20 4c 44 4d  46 44 20 20 20 28 73 70  |.9   LDMFD   (sp|
00000ad0  29 21 2c 7b 72 30 2d 72  34 2c 70 63 7d 20 20 20  |)!,{r0-r4,pc}   |
00000ae0  20 20 20 20 3b 20 72 65  73 74 6f 72 65 20 72 65  |    ; restore re|
00000af0  67 69 73 74 65 72 73 0d  03 de 05 3a 0d 03 e8 14  |gisters....:....|
00000b00  2e 60 6d 6f 64 75 6c 65  5f 57 53 57 49 65 72 72  |.`module_WSWIerr|
00000b10  0d 03 f2 12 20 20 20 45  51 55 44 20 20 20 20 20  |....   EQUD     |
00000b20  26 30 0d 03 fc 47 20 20  20 45 51 55 53 20 20 20  |&0...G   EQUS   |
00000b30  20 20 22 41 6c 6c 57 43  44 20 72 65 71 75 69 72  |  "AllWCD requir|
00000b40  65 73 20 74 68 65 20 57  69 6d 70 53 57 49 56 65  |es the WimpSWIVe|
00000b50  20 6d 6f 64 75 6c 65 20  74 6f 20 62 65 20 70 72  | module to be pr|
00000b60  65 73 65 6e 74 22 2b bd  30 0d 04 06 15 2e 60 6d  |esent"+.0.....`m|
00000b70  6f 64 75 6c 65 5f 57 53  57 49 6e 61 6d 65 0d 04  |odule_WSWIname..|
00000b80  10 1e 20 20 20 45 51 55  53 20 20 20 20 20 22 57  |..   EQUS     "W|
00000b90  69 6d 70 53 57 49 56 65  22 2b bd 30 0d 04 1a 0c  |impSWIVe"+.0....|
00000ba0  20 20 20 41 4c 49 47 4e  0d 04 24 15 2e 60 6d 6f  |   ALIGN..$..`mo|
00000bb0  64 75 6c 65 5f 57 53 57  49 77 6f 72 64 0d 04 2e  |dule_WSWIword...|
00000bc0  16 20 20 20 45 51 55 53  20 20 20 20 20 22 57 53  |.   EQUS     "WS|
00000bd0  57 49 22 0d 04 38 05 3a  0d 04 42 11 2e 6d 6f 64  |WI"..8.:..B..mod|
00000be0  75 6c 65 5f 66 69 6e 61  6c 0d 04 4c 37 20 20 20  |ule_final..L7   |
00000bf0  53 54 4d 46 44 20 20 20  28 73 70 29 21 2c 7b 72  |STMFD   (sp)!,{r|
00000c00  30 2d 72 34 2c 72 31 32  2c 6c 69 6e 6b 7d 20 3b  |0-r4,r12,link} ;|
00000c10  20 53 74 61 63 6b 20 72  65 67 69 73 74 65 72 73  | Stack registers|
00000c20  0d 04 56 20 3b 20 2a 2a  2a 2a 2a 20 57 69 6d 70  |..V ; ***** Wimp|
00000c30  53 57 49 20 72 65 6c 65  61 73 65 20 63 6f 64 65  |SWI release code|
00000c40  0d 04 60 22 20 20 20 4c  44 52 20 20 20 20 20 72  |..`"   LDR     r|
00000c50  30 2c 60 6d 6f 64 75 6c  65 5f 57 53 57 49 77 6f  |0,`module_WSWIwo|
00000c60  72 64 0d 04 6a 15 20 20  20 4d 4f 56 20 20 20 20  |rd..j.   MOV    |
00000c70  20 72 32 2c 72 31 32 0d  04 74 1e 20 20 20 4d 4f  | r2,r12..t.   MO|
00000c80  56 20 20 20 20 20 72 31  2c 23 32 2b 28 25 30 30  |V     r1,#2+(%00|
00000c90  3c 3c 33 30 29 0d 04 7e  1b 20 a4 4c 41 44 52 28  |<<30)..~. .LADR(|
00000ca0  22 22 2c 33 2c 63 72 65  61 74 65 69 63 6f 6e 29  |"",3,createicon)|
00000cb0  0d 04 88 14 20 20 20 4d  4f 56 20 20 20 20 20 72  |....   MOV     r|
00000cc0  34 2c 23 30 0d 04 92 24  20 20 20 53 57 49 20 20  |4,#0...$   SWI  |
00000cd0  20 20 20 22 57 69 6d 70  5f 52 65 67 69 73 74 65  |   "Wimp_Registe|
00000ce0  72 46 69 6c 74 65 72 22  0d 04 9c 1e 20 20 20 4d  |rFilter"....   M|
00000cf0  4f 56 20 20 20 20 20 72  31 2c 23 31 2b 28 25 30  |OV     r1,#1+(%0|
00000d00  30 3c 3c 33 30 29 0d 04  a6 1d 20 a4 4c 41 44 52  |0<<30).... .LADR|
00000d10  28 22 22 2c 33 2c 63 72  65 61 74 65 77 69 6e 64  |("",3,createwind|
00000d20  6f 77 29 0d 04 b0 14 20  20 20 4d 4f 56 20 20 20  |ow)....   MOV   |
00000d30  20 20 72 34 2c 23 30 0d  04 ba 24 20 20 20 53 57  |  r4,#0...$   SW|
00000d40  49 20 20 20 20 20 22 57  69 6d 70 5f 52 65 67 69  |I     "Wimp_Regi|
00000d50  73 74 65 72 46 69 6c 74  65 72 22 0d 04 c4 39 20  |sterFilter"...9 |
00000d60  20 20 4c 44 4d 46 44 20  20 20 28 73 70 29 2c 7b  |  LDMFD   (sp),{|
00000d70  72 30 2d 72 34 7d 20 20  20 20 20 20 20 20 20 20  |r0-r4}          |
00000d80  20 3b 20 72 65 73 74 6f  72 65 20 72 65 67 69 73  | ; restore regis|
00000d90  74 65 72 73 0d 04 ce 2e  20 20 20 4c 44 4d 46 44  |ters....   LDMFD|
00000da0  20 20 20 28 73 70 29 21  2c 7b 72 30 2d 72 34 2c  |   (sp)!,{r0-r4,|
00000db0  72 31 32 2c 70 63 7d 20  20 20 3b 20 52 65 74 75  |r12,pc}   ; Retu|
00000dc0  72 6e 0d 04 d8 05 3a 0d  04 e2 21 3b 20 2a 2a 2a  |rn....:...!; ***|
00000dd0  2a 2a 20 4d 6f 64 75 6c  65 20 63 6f 6d 6d 61 6e  |** Module comman|
00000de0  64 73 20 74 61 62 6c 65  0d 04 ec 14 2e 6d 6f 64  |ds table.....mod|
00000df0  75 6c 65 5f 63 6f 6d 6d  61 6e 64 73 0d 04 f6 2d  |ule_commands...-|
00000e00  20 20 20 45 51 55 53 20  22 41 6c 6c 57 43 44 22  |   EQUS "AllWCD"|
00000e10  20 20 20 20 20 20 20 20  20 20 20 3b 20 43 6f 6d  |           ; Com|
00000e20  6d 61 6e 64 20 6e 61 6d  65 0d 05 00 13 20 20 20  |mand name....   |
00000e30  45 51 55 42 20 30 3a 41  4c 49 47 4e 0d 05 0a 2d  |EQUB 0:ALIGN...-|
00000e40  20 20 20 45 51 55 44 20  30 20 20 20 20 20 20 20  |   EQUD 0       |
00000e50  20 20 20 20 20 20 20 20  20 20 20 3b 20 43 6f 64  |           ; Cod|
00000e60  65 20 74 6f 20 63 61 6c  6c 0d 05 14 26 20 20 20  |e to call...&   |
00000e70  45 51 55 44 20 26 30 20  20 20 20 20 20 20 20 20  |EQUD &0         |
00000e80  20 20 20 20 20 20 20 20  3b 20 46 6c 61 67 73 0d  |        ; Flags.|
00000e90  05 1e 2f 20 20 20 45 51  55 44 20 30 20 20 20 20  |../   EQUD 0    |
00000ea0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00000eb0  53 79 6e 74 61 78 20 70  6f 69 6e 74 65 72 0d 05  |Syntax pointer..|
00000ec0  28 2d 20 20 20 45 51 55  44 20 68 65 6c 70 5f 61  |(-   EQUD help_a|
00000ed0  6c 6c 77 63 64 20 20 20  20 20 20 20 20 3b 20 48  |llwcd        ; H|
00000ee0  65 6c 70 20 70 6f 69 6e  74 65 72 0d 05 32 0d 20  |elp pointer..2. |
00000ef0  20 20 45 51 55 42 20 30  0d 05 3c 0c 20 20 20 41  |  EQUB 0..<.   A|
00000f00  4c 49 47 4e 0d 05 46 05  3a 0d 05 50 24 3b 20 2a  |LIGN..F.:..P$; *|
00000f10  2a 2a 2a 2a 20 48 65 6c  70 20 61 6e 64 20 53 79  |**** Help and Sy|
00000f20  6e 74 61 78 20 6d 65 73  73 61 67 65 73 0d 05 5a  |ntax messages..Z|
00000f30  10 2e 68 65 6c 70 5f 61  6c 6c 77 63 64 0d 05 64  |..help_allwcd..d|
00000f40  4b 20 20 20 45 51 55 53  20 22 54 68 65 20 41 6c  |K   EQUS "The Al|
00000f50  6c 57 43 44 20 6d 6f 64  75 6c 65 20 66 6f 72 63  |lWCD module forc|
00000f60  65 73 20 61 6c 6c 20 77  72 69 74 61 62 6c 65 20  |es all writable |
00000f70  69 63 6f 6e 73 20 74 6f  20 62 65 20 6f 66 20 74  |icons to be of t|
00000f80  79 70 65 20 31 34 20 22  0d 05 6e 57 20 20 20 45  |ype 14 "..nW   E|
00000f90  51 55 53 20 22 28 57 72  69 74 65 2f 43 6c 69 63  |QUS "(Write/Clic|
00000fa0  6b 2f 44 72 61 67 29 20  72 61 74 68 65 72 20 74  |k/Drag) rather t|
00000fb0  68 61 6e 20 74 79 70 65  20 31 35 20 28 57 72 69  |han type 15 (Wri|
00000fc0  74 65 20 6f 6e 6c 79 29  2e 20 54 68 65 20 6d 61  |te only). The ma|
00000fd0  69 6e 20 72 65 61 73 6f  6e 20 79 6f 75 20 22 0d  |in reason you ".|
00000fe0  05 78 54 20 20 20 45 51  55 53 20 22 6d 61 79 20  |.xT   EQUS "may |
00000ff0  77 69 73 68 20 74 6f 20  64 6f 20 74 68 69 73 20  |wish to do this |
00001000  69 73 20 74 6f 20 66 6f  72 63 65 20 61 6c 6c 20  |is to force all |
00001010  61 70 70 6c 69 63 61 74  69 6f 6e 73 20 74 6f 20  |applications to |
00001020  61 6c 6c 6f 77 20 54 65  78 74 43 6f 70 79 20 74  |allow TextCopy t|
00001030  6f 20 22 0d 05 82 3d 20  20 20 45 51 55 53 20 22  |o "...=   EQUS "|
00001040  64 72 61 67 20 61 6c 6c  20 77 72 69 74 61 62 6c  |drag all writabl|
00001050  65 20 69 63 6f 6e 73 20  61 72 6f 75 6e 64 20 74  |e icons around t|
00001060  68 65 20 64 65 73 6b 74  6f 70 2e 22 2b bd 31 33  |he desktop."+.13|
00001070  0d 05 8c 55 20 20 20 45  51 55 53 20 22 46 6f 72  |...U   EQUS "For|
00001080  20 62 65 73 74 20 65 66  66 65 63 74 2c 20 74 68  | best effect, th|
00001090  65 20 6d 6f 64 75 6c 65  20 73 68 6f 75 6c 64 20  |e module should |
000010a0  68 61 76 65 20 62 65 65  6e 20 6c 6f 61 64 65 64  |have been loaded|
000010b0  20 42 45 46 4f 52 45 20  74 68 65 20 64 65 73 6b  | BEFORE the desk|
000010c0  74 6f 70 20 22 0d 05 96  1b 20 20 20 45 51 55 53  |top "....   EQUS|
000010d0  20 22 68 61 73 20 73 74  61 72 74 65 64 2e 20 22  | "has started. "|
000010e0  0d 05 a0 0d 20 20 20 45  51 55 42 20 30 0d 05 aa  |....   EQUB 0...|
000010f0  0c 20 20 20 41 4c 49 47  4e 0d 05 b4 05 3a 0d 05  |.   ALIGN....:..|
00001100  be 2e 20 20 20 20 20 20  20 20 20 20 3b 20 2a 2a  |..          ; **|
00001110  2a 2a 20 45 6e 64 20 6f  66 20 6d 6f 64 75 6c 65  |** End of module|
00001120  20 68 65 61 64 65 72 20  2a 2a 2a 2a 0d 05 c8 05  | header ****....|
00001130  3a 0d 05 d2 0f 2e 63 72  65 61 74 65 69 63 6f 6e  |:.....createicon|
00001140  0d 05 dc 3e 20 20 20 53  54 4d 46 44 20 20 20 28  |...>   STMFD   (|
00001150  73 70 29 21 2c 7b 72 30  2d 72 35 2c 6c 69 6e 6b  |sp)!,{r0-r5,link|
00001160  7d 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 53  |}            ; S|
00001170  74 61 63 6b 20 72 65 67  69 73 74 65 72 73 0d 05  |tack registers..|
00001180  e6 21 20 20 20 4c 44 52  20 20 20 20 20 72 32 2c  |.!   LDR     r2,|
00001190  5b 72 31 2c 23 60 63 69  5f 66 6c 61 67 73 5d 0d  |[r1,#`ci_flags].|
000011a0  05 f0 1d 20 20 20 20 20  20 20 20 20 20 3b 20 67  |...          ; g|
000011b0  65 74 20 74 68 65 20 66  6c 61 67 73 0d 05 fa 43  |et the flags...C|
000011c0  20 20 20 80 20 20 20 20  20 72 30 2c 72 32 2c 23  |   .     r0,r2,#|
000011d0  26 46 30 30 30 20 20 20  20 20 20 20 20 20 20 20  |&F000           |
000011e0  20 20 20 20 20 20 20 3b  20 6c 65 61 76 65 20 6a  |       ; leave j|
000011f0  75 73 74 20 62 75 74 74  6f 6e 20 74 79 70 65 0d  |ust button type.|
00001200  06 04 3e 20 20 20 43 4d  50 20 20 20 20 20 72 30  |..>   CMP     r0|
00001210  2c 23 26 46 30 30 30 20  20 20 20 20 20 20 20 20  |,#&F000         |
00001220  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 69 73  |            ; is|
00001230  20 69 74 20 74 79 70 65  20 31 35 20 3f 0d 06 0e  | it type 15 ?...|
00001240  46 20 20 20 4c 44 4d 4e  45 46 44 20 28 73 70 29  |F   LDMNEFD (sp)|
00001250  21 2c 7b 72 30 2d 72 35  2c 70 63 7d 20 20 20 20  |!,{r0-r5,pc}    |
00001260  20 20 20 20 20 20 20 20  20 20 3b 20 52 65 74 75  |          ; Retu|
00001270  72 6e 20 66 72 6f 6d 20  63 61 6c 6c 20 69 66 20  |rn from call if |
00001280  6e 6f 74 0d 06 18 4c 20  20 20 42 49 43 20 20 20  |not...L   BIC   |
00001290  20 20 72 32 2c 72 32 2c  23 26 31 30 30 30 20 20  |  r2,r2,#&1000  |
000012a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000012b0  3b 20 63 6c 65 61 72 20  62 69 74 20 31 32 20 74  |; clear bit 12 t|
000012c0  6f 20 6c 65 61 76 65 20  74 79 70 65 20 31 34 0d  |o leave type 14.|
000012d0  06 22 21 20 20 20 53 54  52 20 20 20 20 20 72 32  |."!   STR     r2|
000012e0  2c 5b 72 31 2c 23 60 63  69 5f 66 6c 61 67 73 5d  |,[r1,#`ci_flags]|
000012f0  0d 06 2c 23 20 20 20 20  20 20 20 20 20 20 3b 20  |..,#          ; |
00001300  73 74 6f 72 65 20 62 61  63 6b 20 69 6e 20 62 6c  |store back in bl|
00001310  6f 63 6b 0d 06 36 3f 20  20 20 4c 44 4d 46 44 20  |ock..6?   LDMFD |
00001320  20 20 28 73 70 29 21 2c  7b 72 30 2d 72 35 2c 70  |  (sp)!,{r0-r5,p|
00001330  63 7d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |c}              |
00001340  3b 20 52 65 74 75 72 6e  20 66 72 6f 6d 20 63 61  |; Return from ca|
00001350  6c 6c 0d 06 40 05 3a 0d  06 4a 11 2e 63 72 65 61  |ll..@.:..J..crea|
00001360  74 65 77 69 6e 64 6f 77  0d 06 54 3e 20 20 20 53  |tewindow..T>   S|
00001370  54 4d 46 44 20 20 20 28  73 70 29 21 2c 7b 72 30  |TMFD   (sp)!,{r0|
00001380  2d 72 35 2c 6c 69 6e 6b  7d 20 20 20 20 20 20 20  |-r5,link}       |
00001390  20 20 20 20 20 3b 20 53  74 61 63 6b 20 72 65 67  |     ; Stack reg|
000013a0  69 73 74 65 72 73 0d 06  5e 24 20 20 20 4c 44 52  |isters..^$   LDR|
000013b0  20 20 20 20 20 72 35 2c  5b 72 31 2c 23 60 63 77  |     r5,[r1,#`cw|
000013c0  5f 6e 75 6d 69 63 6f 6e  73 5d 0d 06 68 27 20 20  |_numicons]..h'  |
000013d0  20 20 20 20 20 20 20 20  3b 20 67 65 74 20 74 68  |        ; get th|
000013e0  65 20 6e 75 6d 62 65 72  20 6f 66 20 69 63 6f 6e  |e number of icon|
000013f0  73 0d 06 72 1e 20 a4 4c  41 44 44 28 22 20 20 22  |s..r. .LADD("  "|
00001400  2c 32 2c 31 2c 60 63 77  5f 69 63 6f 6e 73 29 0d  |,2,1,`cw_icons).|
00001410  06 7c 24 20 20 20 20 20  20 20 20 20 20 3b 20 70  |.|$          ; p|
00001420  6f 69 6e 74 65 72 20 74  6f 20 69 63 6f 6e 20 64  |ointer to icon d|
00001430  61 74 61 0d 06 86 0e 2e  5f 5f 7a 30 5f 6c 6f 6f  |ata.....__z0_loo|
00001440  70 0d 06 90 14 20 20 20  43 4d 50 20 20 20 20 20  |p....   CMP     |
00001450  72 35 2c 23 30 0d 06 9a  18 20 20 20 42 4c 45 20  |r5,#0....   BLE |
00001460  20 20 20 20 5f 5f 7a 30  5f 65 78 69 74 0d 06 a4  |    __z0_exit...|
00001470  21 20 20 20 4c 44 52 20  20 20 20 20 72 33 2c 5b  |!   LDR     r3,[|
00001480  72 32 2c 23 60 69 62 5f  66 6c 61 67 73 5d 0d 06  |r2,#`ib_flags]..|
00001490  ae 1d 20 20 20 20 20 20  20 20 20 20 3b 20 67 65  |..          ; ge|
000014a0  74 20 74 68 65 20 66 6c  61 67 73 0d 06 b8 43 20  |t the flags...C |
000014b0  20 20 80 20 20 20 20 20  72 30 2c 72 33 2c 23 26  |  .     r0,r3,#&|
000014c0  46 30 30 30 20 20 20 20  20 20 20 20 20 20 20 20  |F000            |
000014d0  20 20 20 20 20 20 3b 20  6c 65 61 76 65 20 6a 75  |      ; leave ju|
000014e0  73 74 20 62 75 74 74 6f  6e 20 74 79 70 65 0d 06  |st button type..|
000014f0  c2 3e 20 20 20 43 4d 50  20 20 20 20 20 72 30 2c  |.>   CMP     r0,|
00001500  23 26 46 30 30 30 20 20  20 20 20 20 20 20 20 20  |#&F000          |
00001510  20 20 20 20 20 20 20 20  20 20 20 3b 20 69 73 20  |           ; is |
00001520  69 74 20 74 79 70 65 20  31 35 20 3f 0d 06 cc 51  |it type 15 ?...Q|
00001530  20 20 20 42 4e 45 20 20  20 20 20 5f 5f 7a 30 5f  |   BNE     __z0_|
00001540  6e 65 78 74 20 20 20 20  20 20 20 20 20 20 20 20  |next            |
00001550  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 69  |             ; i|
00001560  66 20 6e 6f 74 20 74 68  65 6e 20 67 6f 20 6f 6e  |f not then go on|
00001570  20 74 6f 20 6e 65 78 74  20 69 63 6f 6e 0d 06 d6  | to next icon...|
00001580  4c 20 20 20 42 49 43 20  20 20 20 20 72 33 2c 72  |L   BIC     r3,r|
00001590  33 2c 23 26 31 30 30 30  20 20 20 20 20 20 20 20  |3,#&1000        |
000015a0  20 20 20 20 20 20 20 20  20 20 3b 20 63 6c 65 61  |          ; clea|
000015b0  72 20 62 69 74 20 31 32  20 74 6f 20 6c 65 61 76  |r bit 12 to leav|
000015c0  65 20 74 79 70 65 20 31  34 0d 06 e0 21 20 20 20  |e type 14...!   |
000015d0  53 54 52 20 20 20 20 20  72 33 2c 5b 72 32 2c 23  |STR     r3,[r2,#|
000015e0  60 69 62 5f 66 6c 61 67  73 5d 0d 06 ea 23 20 20  |`ib_flags]...#  |
000015f0  20 20 20 20 20 20 20 20  3b 20 73 74 6f 72 65 20  |        ; store |
00001600  62 61 63 6b 20 69 6e 20  62 6c 6f 63 6b 0d 06 f4  |back in block...|
00001610  0e 2e 5f 5f 7a 30 5f 6e  65 78 74 0d 06 fe 41 20  |..__z0_next...A |
00001620  20 20 41 44 44 20 20 20  20 20 72 32 2c 72 32 2c  |  ADD     r2,r2,|
00001630  23 60 6c 65 6e 5f 62 61  73 69 63 69 63 6f 6e 62  |#`len_basiciconb|
00001640  6c 6f 63 6b 20 20 20 20  3b 20 69 6e 63 72 65 6d  |lock    ; increm|
00001650  65 6e 74 20 70 6f 73 69  74 69 6f 6e 0d 07 08 44  |ent position...D|
00001660  20 20 20 53 55 42 20 20  20 20 20 72 35 2c 72 35  |   SUB     r5,r5|
00001670  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
00001680  20 20 20 20 20 20 20 20  20 3b 20 64 65 63 72 65  |         ; decre|
00001690  6d 65 6e 74 20 6e 75 6d  62 65 72 20 6c 65 66 74  |ment number left|
000016a0  0d 07 12 18 20 20 20 42  20 20 20 20 20 20 20 5f  |....   B       _|
000016b0  5f 7a 30 5f 6c 6f 6f 70  0d 07 1c 0e 2e 5f 5f 7a  |_z0_loop.....__z|
000016c0  30 5f 65 78 69 74 0d 07  26 3f 20 20 20 4c 44 4d  |0_exit..&?   LDM|
000016d0  46 44 20 20 20 28 73 70  29 21 2c 7b 72 30 2d 72  |FD   (sp)!,{r0-r|
000016e0  35 2c 70 63 7d 20 20 20  20 20 20 20 20 20 20 20  |5,pc}           |
000016f0  20 20 20 3b 20 52 65 74  75 72 6e 20 66 72 6f 6d  |   ; Return from|
00001700  20 63 61 6c 6c 0d 07 30  05 3a 0d 07 3a 05 5d 0d  | call..0.:..:.].|
00001710  07 44 20 f4 20 2a 2a 2a  2a 20 45 6e 64 20 6f 66  |.D . **** End of|
00001720  20 6d 61 69 6e 20 63 6f  64 65 20 2a 2a 2a 2a 0d  | main code ****.|
00001730  07 4e 36 f4 20 53 65 74  20 66 69 6e 61 6c 20 70  |.N6. Set final p|
00001740  6f 69 6e 74 65 72 20 74  6f 20 66 69 6e 64 20 74  |ointer to find t|
00001750  68 65 20 6c 65 6e 67 74  68 20 6f 66 20 74 68 65  |he length of the|
00001760  20 63 6f 64 65 0d 07 58  13 f2 70 61 74 63 68 5f  | code..X..patch_|
00001770  73 65 74 70 63 28 30 29  0d 07 62 0b ed 20 70 61  |setpc(0)..b.. pa|
00001780  73 73 25 0d 07 6c 13 f2  70 61 74 63 68 5f 73 61  |ss%..l..patch_sa|
00001790  76 65 66 69 6c 65 0d 07  8a 28 f4 20 2a 2a 2a 2a  |vefile...(. ****|
000017a0  20 50 6f 73 74 2d 61 73  73 65 6d 62 6c 79 20 75  | Post-assembly u|
000017b0  73 65 72 20 63 6f 64 65  20 2a 2a 2a 2a 2a 0d 07  |ser code *****..|
000017c0  9e 05 e0 0d 07 a8 05 3a  0d 07 b2 05 3a 0d 07 bc  |.......:....:...|
000017d0  21 f4 20 2a 2a 2a 2a 20  46 69 6c 69 6e 67 20 70  |!. **** Filing p|
000017e0  72 6f 63 65 64 75 72 65  73 20 2a 2a 2a 2a 0d 07  |rocedures ****..|
000017f0  c6 05 3a 0d 07 d0 15 dd  20 f2 70 61 74 63 68 5f  |..:..... .patch_|
00001800  6c 6f 61 64 66 69 6c 65  0d 07 da 0d 63 6f 64 65  |loadfile....code|
00001810  6c 65 6e 3d 30 0d 07 e4  0f de 20 4d 43 25 20 26  |len=0..... MC% &|
00001820  38 30 30 30 0d 07 ee 24  65 6e 64 6f 66 63 6f 64  |8000...$endofcod|
00001830  65 3d 63 6f 64 65 6c 65  6e 2b 26 30 3a 6d 61 78  |e=codelen+&0:max|
00001840  3d 63 6f 64 65 6c 65 6e  0d 07 f8 19 4c 25 3d 65  |=codelen....L%=e|
00001850  6e 64 6f 66 63 6f 64 65  3a 5f 5f 63 61 70 25 3d  |ndofcode:__cap%=|
00001860  a3 0d 08 5c 05 e1 0d 08  66 05 3a 0d 08 70 15 dd  |...\....f.:..p..|
00001870  20 f2 70 61 74 63 68 5f  73 61 76 65 66 69 6c 65  | .patch_savefile|
00001880  0d 08 7a 2d 6f 75 74 66  69 6c 65 24 3d 22 3c 41  |..z-outfile$="<A|
00001890  6c 6c 57 72 69 74 65 43  6c 69 63 6b 44 72 61 67  |llWriteClickDrag|
000018a0  24 44 69 72 3e 2e 41 6c  6c 57 43 44 22 0d 08 84  |$Dir>.AllWCD"...|
000018b0  31 ff 28 22 53 61 76 65  20 22 2b 6f 75 74 66 69  |1.("Save "+outfi|
000018c0  6c 65 24 2b 22 20 22 2b  c3 7e 4d 43 25 2b 22 20  |le$+" "+.~MC%+" |
000018d0  22 2b c3 7e 28 6d 61 78  2b 4d 43 25 29 29 0d 08  |"+.~(max+MC%))..|
000018e0  8e 24 ff 28 22 53 65 74  74 79 70 65 20 22 2b 6f  |.$.("Settype "+o|
000018f0  75 74 66 69 6c 65 24 2b  22 20 4d 6f 64 75 6c 65  |utfile$+" Module|
00001900  22 29 0d 08 98 27 70 61  74 63 68 64 69 72 24 3d  |")...'patchdir$=|
00001910  22 3c 41 6c 6c 57 72 69  74 65 43 6c 69 63 6b 44  |"<AllWriteClickD|
00001920  72 61 67 24 44 69 72 3e  22 0d 08 c0 05 e1 0d 08  |rag$Dir>".......|
00001930  ca 05 3a 0d 08 d4 1d f4  20 2a 2a 2a 2a 20 45 72  |..:..... **** Er|
00001940  72 6f 72 20 48 61 6e 64  6c 65 72 20 2a 2a 2a 2a  |ror Handler ****|
00001950  0d 08 de 05 3a 0d 08 e8  0b dd f2 45 72 72 6f 72  |....:......Error|
00001960  0d 09 38 1b 85 20 a2 20  9f 2c f6 24 2b 22 20 61  |..8.. . .,.$+" a|
00001970  74 20 6c 69 6e 65 20 22  2b c3 9e 0d 09 42 05 e1  |t line "+....B..|
00001980  0d 09 4c 05 3a 0d 09 56  22 f4 20 2a 2a 2a 2a 20  |..L.:..V". **** |
00001990  55 74 69 6c 69 74 79 20  70 72 6f 63 65 64 75 72  |Utility procedur|
000019a0  65 73 20 2a 2a 2a 2a 0d  09 60 05 3a 0d 09 6a 14  |es ****..`.:..j.|
000019b0  dd f2 70 61 74 63 68 5f  73 65 74 70 63 28 6e 29  |..patch_setpc(n)|
000019c0  0d 09 74 1a e7 20 50 25  2d 26 30 3e 6d 61 78 20  |..t.. P%-&0>max |
000019d0  8c 6d 61 78 3d 50 25 2d  26 30 0d 09 7e 14 50 25  |.max=P%-&0..~.P%|
000019e0  3d 6e 3a 4f 25 3d 4d 43  25 2b 6e 2d 26 30 0d 09  |=n:O%=MC%+n-&0..|
000019f0  88 05 e1 0d 09 92 05 3a  0d 09 9c 22 dd a4 66 69  |.......:..."..fi|
00001a00  6e 64 66 72 65 65 72 65  67 28 61 2c 62 2c 63 2c  |ndfreereg(a,b,c,|
00001a10  64 29 3a ea 20 6e 3a 6e  3d 30 0d 09 a6 1c c8 95  |d):. n:n=0......|
00001a20  20 6e 3d 61 20 84 20 6e  3d 62 20 84 20 6e 3d 63  | n=a . n=b . n=c|
00001a30  20 84 20 6e 3d 64 0d 09  b0 09 20 6e 2b 3d 31 0d  | . n=d.... n+=1.|
00001a40  09 ba 05 ce 0d 09 c4 06  3d 6e 0d 09 ce 05 3a 0d  |........=n....:.|
00001a50  09 d8 28 f4 20 2a 2a 2a  2a 20 4c 6f 6e 67 20 41  |..(. **** Long A|
00001a60  44 52 20 6d 61 63 72 6f  20 70 72 6f 63 65 64 75  |DR macro procedu|
00001a70  72 65 20 2a 2a 2a 2a 0d  09 e2 05 3a 0d 09 ec 40  |re ****....:...@|
00001a80  f4 20 44 45 53 43 2e 20  3a 20 41 44 52 20 65 71  |. DESC. : ADR eq|
00001a90  75 69 76 61 6c 65 6e 74  20 66 6f 72 20 6c 6f 6e  |uivalent for lon|
00001aa0  67 20 61 64 64 72 65 73  73 20 72 61 6e 67 65 73  |g address ranges|
00001ab0  2c 20 69 6e 20 32 20 69  6e 73 74 73 0d 09 f6 43  |, in 2 insts...C|
00001ac0  f4 20 45 4e 54 52 59 20  3a 20 63 6f 6e 64 24 20  |. ENTRY : cond$ |
00001ad0  3d 20 74 77 6f 20 63 68  61 72 20 73 74 72 69 6e  |= two char strin|
00001ae0  67 2c 20 63 6f 6e 74 61  69 6e 69 6e 67 20 74 68  |g, containing th|
00001af0  65 20 41 52 4d 20 63 6f  6e 64 69 74 69 6f 6e 0d  |e ARM condition.|
00001b00  0a 00 1a f4 20 20 20 20  20 20 20 20 20 72 65 67  |....         reg|
00001b10  25 20 3d 20 30 2e 2e 31  35 0d 0a 0a 2b f4 20 20  |% = 0..15...+.  |
00001b20  20 20 20 20 20 20 20 70  6f 69 6e 74 65 72 25 20  |       pointer% |
00001b30  3d 20 6c 6f 6e 67 20 72  61 6e 67 65 20 70 6f 69  |= long range poi|
00001b40  6e 74 65 72 0d 0a 14 42  f4 20 43 4f 4d 4d 2e 20  |nter...B. COMM. |
00001b50  3a 20 70 61 73 73 25 20  3d 20 4f 50 54 20 76 61  |: pass% = OPT va|
00001b60  72 69 61 62 6c 65 20 69  6e 20 74 68 65 20 61 73  |riable in the as|
00001b70  73 65 6d 62 6c 65 72 20  46 4f 52 2e 2e 4e 45 58  |sembler FOR..NEX|
00001b80  54 20 6c 6f 6f 70 0d 0a  1e 2d f4 20 20 20 20 20  |T loop...-.     |
00001b90  20 20 20 20 43 61 6e 20  6f 6e 6c 79 20 68 61 6e  |    Can only han|
00001ba0  64 6c 65 20 36 34 20 4b  42 79 74 65 20 72 61 6e  |dle 64 KByte ran|
00001bb0  67 65 73 0d 0a 28 1f dd  a4 4c 41 44 52 28 63 6f  |ges..(...LADR(co|
00001bc0  6e 64 24 2c 72 65 67 25  2c 70 6f 69 6e 74 65 72  |nd$,reg%,pointer|
00001bd0  25 29 0d 0a 32 21 ea 20  63 63 25 2c 64 69 66 66  |%)..2!. cc%,diff|
00001be0  25 2c 6c 6f 25 2c 68 69  25 2c 6f 70 31 25 2c 6f  |%,lo%,hi%,op1%,o|
00001bf0  70 32 25 0d 0a 3c 23 e7  20 28 70 61 73 73 25 20  |p2%..<#. (pass% |
00001c00  80 25 31 30 29 3d 30 20  50 25 2b 3d 38 3a 4f 25  |.%10)=0 P%+=8:O%|
00001c10  2b 3d 38 3a 3d 30 0d 0a  46 73 e7 20 94 28 70 6f  |+=8:=0..Fs. .(po|
00001c20  69 6e 74 65 72 25 2d 50  25 29 3e 36 35 35 33 35  |inter%-P%)>65535|
00001c30  20 8c 20 85 20 31 2c 22  4c 41 44 52 20 63 61 6e  | . . 1,"LADR can|
00001c40  20 6f 6e 6c 79 20 68 61  6e 64 6c 65 20 36 34 20  | only handle 64 |
00001c50  4b 42 79 74 65 20 72 61  6e 67 65 73 20 61 74 20  |KByte ranges at |
00001c60  26 22 2b c3 7e 50 25 2b  22 20 28 26 22 2b c3 7e  |&"+.~P%+" (&"+.~|
00001c70  28 70 6f 69 6e 74 65 72  25 2d 50 25 29 2b 22 20  |(pointer%-P%)+" |
00001c80  64 69 73 74 61 6e 74 29  22 0d 0a 50 27 e7 63 6f  |distant)"..P'.co|
00001c90  6e 64 24 3d 22 20 20 22  20 84 20 63 6f 6e 64 24  |nd$="  " . cond$|
00001ca0  3d 22 22 20 20 8c 63 6f  6e 64 24 3d 22 41 4c 22  |=""  .cond$="AL"|
00001cb0  0d 0a 5a 32 63 63 25 3d  a7 22 45 51 4e 45 43 53  |..Z2cc%=."EQNECS|
00001cc0  43 43 4d 49 50 4c 56 53  56 43 48 49 4c 53 47 45  |CCMIPLVSVCHILSGE|
00001cd0  4c 54 47 54 4c 45 41 4c  4e 56 22 2c 63 6f 6e 64  |LTGTLEALNV",cond|
00001ce0  24 29 0d 0a 64 63 e7 20  63 63 25 3d 30 20 85 20  |$)..dc. cc%=0 . |
00001cf0  31 2c 22 46 41 54 41 4c  20 45 52 52 4f 52 20 3a  |1,"FATAL ERROR :|
00001d00  20 55 6e 6b 6e 6f 77 6e  20 63 6f 6e 64 69 74 69  | Unknown conditi|
00001d10  6f 6e 20 66 6f 72 20 4c  41 44 52 20 61 74 20 26  |on for LADR at &|
00001d20  22 2b c3 7e 50 25 2b 22  20 28 26 22 2b c3 7e 4f  |"+.~P%+" (&"+.~O|
00001d30  25 2b 22 29 22 20 8b 20  63 63 25 3d 28 63 63 25  |%+")" . cc%=(cc%|
00001d40  2d 31 29 81 32 0d 0a 6e  17 64 69 66 66 25 3d 70  |-1).2..n.diff%=p|
00001d50  6f 69 6e 74 65 72 25 2d  50 25 2d 38 0d 0a 78 14  |ointer%-P%-8..x.|
00001d60  6c 6f 25 3d 94 28 64 69  66 66 25 29 80 26 46 46  |lo%=.(diff%).&FF|
00001d70  0d 0a 82 16 68 69 25 3d  94 28 64 69 66 66 25 29  |....hi%=.(diff%)|
00001d80  80 26 46 46 30 30 0d 0a  8c 0e e7 64 69 66 66 25  |.&FF00.....diff%|
00001d90  3e 3d 30 8c 0d 0a 96 2c  20 6f 70 31 25 3d 28 63  |>=0...., op1%=(c|
00001da0  63 25 3c 3c 32 38 29 2b  26 30 32 38 46 30 30 30  |c%<<28)+&028F000|
00001db0  30 2b 28 72 65 67 25 3c  3c 31 32 29 2b 6c 6f 25  |0+(reg%<<12)+lo%|
00001dc0  0d 0a a0 3c 20 6f 70 32  25 3d 28 63 63 25 3c 3c  |...< op2%=(cc%<<|
00001dd0  32 38 29 2b 26 30 32 38  30 30 43 30 30 2b 28 72  |28)+&02800C00+(r|
00001de0  65 67 25 3c 3c 31 36 29  2b 28 72 65 67 25 3c 3c  |eg%<<16)+(reg%<<|
00001df0  31 32 29 2b 28 68 69 25  3e 3e 38 29 0d 0a aa 05  |12)+(hi%>>8)....|
00001e00  cc 0d 0a b4 2c 20 6f 70  31 25 3d 28 63 63 25 3c  |...., op1%=(cc%<|
00001e10  3c 32 38 29 2b 26 30 32  34 46 30 30 30 30 2b 28  |<28)+&024F0000+(|
00001e20  72 65 67 25 3c 3c 31 32  29 2b 6c 6f 25 0d 0a be  |reg%<<12)+lo%...|
00001e30  3c 20 6f 70 32 25 3d 28  63 63 25 3c 3c 32 38 29  |< op2%=(cc%<<28)|
00001e40  2b 26 30 32 34 30 30 43  30 30 2b 28 72 65 67 25  |+&02400C00+(reg%|
00001e50  3c 3c 31 36 29 2b 28 72  65 67 25 3c 3c 31 32 29  |<<16)+(reg%<<12)|
00001e60  2b 28 68 69 25 3e 3e 38  29 0d 0a c8 05 cd 0d 0a  |+(hi%>>8).......|
00001e70  d2 24 5b 4f 50 54 20 70  61 73 73 25 3a 45 51 55  |.$[OPT pass%:EQU|
00001e80  44 20 6f 70 31 25 3a 45  51 55 44 20 6f 70 32 25  |D op1%:EQUD op2%|
00001e90  3a 5d 0d 0a dc 06 3d 30  0d 0a e6 05 3a 0d 0a f0  |:]....=0....:...|
00001ea0  2a f4 20 2a 2a 2a 2a 20  4c 6f 6e 67 20 41 44 44  |*. **** Long ADD|
00001eb0  20 6d 61 63 72 6f 20 69  6e 73 74 72 75 63 74 69  | macro instructi|
00001ec0  6f 6e 20 2a 2a 2a 2a 0d  0a fa 05 3a 0d 0b 04 21  |on ****....:...!|
00001ed0  dd a4 4c 41 44 44 28 63  6f 6e 64 24 2c 72 65 67  |..LADD(cond$,reg|
00001ee0  31 2c 72 65 67 32 2c 76  61 6c 75 65 29 0d 0b 0e  |1,reg2,value)...|
00001ef0  27 e7 20 63 6f 6e 64 24  3d 22 22 20 84 20 63 6f  |'. cond$="" . co|
00001f00  6e 64 24 3d 22 20 20 22  20 8c 63 6f 6e 64 24 3d  |nd$="  " .cond$=|
00001f10  22 41 4c 22 0d 0b 18 39  63 6f 6e 64 3d 28 a7 22  |"AL"...9cond=(."|
00001f20  45 51 4e 45 43 53 43 43  4d 49 50 4c 56 53 56 43  |EQNECSCCMIPLVSVC|
00001f30  48 49 4c 53 47 45 4c 54  47 54 4c 45 41 4c 4e 56  |HILSGELTGTLEALNV|
00001f40  22 2c 63 6f 6e 64 24 29  2d 31 29 2f 32 0d 0b 22  |",cond$)-1)/2.."|
00001f50  33 61 64 64 31 3d 28 26  32 38 3c 3c 32 30 29 2b  |3add1=(&28<<20)+|
00001f60  28 72 65 67 31 3c 3c 31  32 29 2b 28 72 65 67 32  |(reg1<<12)+(reg2|
00001f70  3c 3c 31 36 29 2b 28 63  6f 6e 64 3c 3c 32 38 29  |<<16)+(cond<<28)|
00001f80  0d 0b 2c 33 61 64 64 32  3d 28 26 32 38 3c 3c 32  |..,3add2=(&28<<2|
00001f90  30 29 2b 28 72 65 67 31  3c 3c 31 32 29 2b 28 72  |0)+(reg1<<12)+(r|
00001fa0  65 67 31 3c 3c 31 36 29  2b 28 63 6f 6e 64 3c 3c  |eg1<<16)+(cond<<|
00001fb0  32 38 29 0d 0b 36 0b 73  68 69 66 74 3d 30 0d 0b  |28)..6.shift=0..|
00001fc0  40 05 f5 0d 0b 4a 20 20  c8 95 20 28 76 61 6c 75  |@....J  .. (valu|
00001fd0  65 20 80 20 33 29 3d 30  20 80 20 73 68 69 66 74  |e . 3)=0 . shift|
00001fe0  3c 31 36 0d 0b 54 1d 20  20 73 68 69 66 74 2b 3d  |<16..T.  shift+=|
00001ff0  31 3a 76 61 6c 75 65 3d  76 61 6c 75 65 20 81 34  |1:value=value .4|
00002000  0d 0b 5e 06 20 ce 0d 0b  68 2a 20 78 73 68 69 66  |..^. ...h* xshif|
00002010  74 3d 31 36 2d 73 68 69  66 74 3a e7 20 78 73 68  |t=16-shift:. xsh|
00002020  69 66 74 3d 31 36 20 8c  78 73 68 69 66 74 3d 30  |ift=16 .xshift=0|
00002030  0d 0b 72 10 20 e7 20 61  64 64 31 3c 3e 30 20 8c  |..r. . add1<>0 .|
00002040  0d 0b 7c 35 20 20 5b 4f  50 54 20 70 61 73 73 25  |..|5  [OPT pass%|
00002050  3a 45 51 55 44 61 64 64  31 2b 28 78 73 68 69 66  |:EQUDadd1+(xshif|
00002060  74 3c 3c 38 29 2b 28 76  61 6c 75 65 20 80 20 32  |t<<8)+(value . 2|
00002070  35 35 29 3a 5d 0d 0b 86  0c 20 20 61 64 64 31 3d  |55):]....  add1=|
00002080  30 0d 0b 90 06 20 cc 0d  0b 9a 35 20 20 5b 4f 50  |0.... ....5  [OP|
00002090  54 20 70 61 73 73 25 3a  45 51 55 44 61 64 64 32  |T pass%:EQUDadd2|
000020a0  2b 28 78 73 68 69 66 74  3c 3c 38 29 2b 28 76 61  |+(xshift<<8)+(va|
000020b0  6c 75 65 20 80 20 32 35  35 29 3a 5d 0d 0b a4 06  |lue . 255):]....|
000020c0  20 cd 0d 0b ae 1e 20 76  61 6c 75 65 3d 76 61 6c  | ..... value=val|
000020d0  75 65 20 81 32 35 36 3a  73 68 69 66 74 2b 3d 34  |ue .256:shift+=4|
000020e0  0d 0b b8 0c fd 76 61 6c  75 65 3d 30 0d 0b c2 06  |.....value=0....|
000020f0  3d 30 0d 0b cc 05 3a 0d  7f 7f 0d f4 20 4a 46 50  |=0....:..... JFP|
00002100  61 74 63 68 0d ff                                 |atch..|
00002106