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

StarInfo/Fletcher/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/PatchBas
Read OK:
File size: 6883 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > Patch for memory compilation
   20REM Created by JFPatch LEN Justin Fletcher, 25 Feb 1995
   30REM Intermediate code file created 20 Aug 1995
   40ON ERROR PROCError:END
   50PROCpatch_loadfile
   60REM **** Workspace structures ****
   70:
   80ptr=0:REM Start structure of DragBox
   90`db_left=ptr:ptr+=4
  100`db_bottom=ptr:ptr+=4
  110`db_right=ptr:ptr+=4
  120`db_top=ptr:ptr+=4
  130`len_DragBox=ptr
  140:
  150ptr=0:REM Start structure of workspace
  160`filehandle=ptr:ptr+=4
  170`window=ptr:ptr+=4
  180`icon=ptr:ptr+=4
  190`left=ptr:ptr+=4
  200`bottom=ptr:ptr+=4
  210`right=ptr:ptr+=4
  220`top=ptr:ptr+=4
  230`flags=ptr:ptr+=4
  240`str=ptr:ptr+=4
  250`valid=ptr:ptr+=4
  260`length=ptr:ptr+=4
  270`eventtype=ptr:ptr+=4
  280`saveaddr=ptr:ptr+=4
  290`savelen=ptr:ptr+=4
  300`dragbox=ptr:ptr+=`len_DragBox
  310`userblock=ptr:ptr+=4
  320`ptrblock=ptr:ptr+=4
  330`mousey=ptr:ptr+=4
  340`mouseb=ptr:ptr+=4
  350`mousew=ptr:ptr+=4
  360`mousei=ptr:ptr+=4
  370`dragging=ptr:ptr+=4
  380`len_workspace=ptr
  390:
  400sp=13:link=14:pc=15
  410vbit=1<<28:cbit=1<<29:zbit=1<<30:nbit=1<<31
  420P%=&0:O%=MC%
  430FOR pass%=4 TO 6 STEP2
  440REM **** Start of main code ****
  450PROCpatch_setpc(0)
  460[OPT pass%
  470          ; **** Add module header ****
  480   EQUD 0                  ; Start offset
  490   EQUD module_init        ; Initialisation offset
  500   EQUD module_final       ; Finalisation offset
  510   EQUD module_service     ; Service request offset
  520   EQUD module_title       ; Title string offset
  530   EQUD module_help        ; Help string offset
  540   EQUD module_commands    ; Help and command keyword table offset
  550:
  560.module_title
  570   EQUS "TextCopy"+CHR$0
  580   ALIGN
  590:
  600.module_help
  610   EQUS "Text Copy"+CHR$9+"1.11 ("+MID$(TIME$,5,11)+") � Justin Fletcher"+CHR$0
  620   ALIGN
  630:
  640.module_service
  650   LDR     r12,[r12]
  660   CMP     r1,#&87
  670   BEQ     mod_svc_newfiltermgr
  680._mod_svc_return
  690   MOVS    pc,link
  700:
  710.mod_svc_newfiltermgr
  720   STMFD   (sp)!,{r0-r4,link}     ; Stack registers
  730   BL      mod_set_PostFilter
  740   SWI     "Filter_RegisterPostFilter"
  750   LDMFD   (sp)!,{r0-r4,link}
  760   B       _mod_svc_return
  770:
  780.module_init
  790   STMFD   (sp)!,{r0-r4,link}     ; Stack registers
  800   MOV     r0,#6
  810 FNLMOV("",3,`len_workspace)
  820   SWI     "XOS_Module"           ; Claim private workspace
  830   ADDVS   sp,sp,#4               ; return error
  840   LDMVSFD (sp)!,{r1-r4,pc}       ; return error
  850   STR     r2,[r12]               ; store in private word
  860   MOV     r12,r2                 ; r12=space
  870   BL      mod_set_PostFilter
  880   SWI     "Filter_RegisterPostFilter"
  890   LDMFD   (sp)!,{r0-r4,link}     ; restore registers
  900   B       InitCode
  910:
  920.module_final
  930   STMFD   (sp)!,{r0-r4,r12,link} ; Stack registers
  940   LDR     r12,[r12]
  950   BL      mod_set_PostFilter
  960   SWI     "Filter_DeRegisterPostFilter"
  970   MOV     r0,#7
  980   MOV     r2,r12
  990   SWI     "XOS_Module"           ; Release workspace
 1000   ADDVS   sp,sp,#4
 1010   LDMVSFD (sp)!,{r1-r4,r12,pc}   ; Return if error
 1020   LDMFD   (sp)!,{r0-r4,r12,pc}   ; Return
 1030:
 1040; ***** Module commands table
 1050.module_commands
 1060   EQUS "TextCopy"         ; Command name
 1070   EQUB 0:ALIGN
 1080   EQUD 0                  ; Code to call
 1090   EQUD &0                 ; Flags
 1100   EQUD 0                  ; Syntax pointer
 1110   EQUD help_textcopy      ; Help pointer
 1120   EQUB 0
 1130   ALIGN
 1140:
 1150; ***** Help and Syntax messages
 1160.help_textcopy
 1170   EQUS "The TextCopy allows you to drag text files directly on to writable "
 1180   EQUS "icons. This is done by use of filters, so this may clash with "
 1190   EQUS "applications which process text files dragged onto writeable icons. "
 1200   EQUS "If multiple writable icons are present, then the text will span "
 1210   EQUS "these."+CHR$13
 1220   EQUS "Holding down Shift when dragging will copy the filename into the icon. "
 1230   EQUS CHR$13+CHR$13+"Dragging of writable icons is also possible for type 15 icons and "
 1240   EQUS "for all icons if the AllWCD module is present."+CHR$13+CHR$13
 1250   EQUS "Holding down Ctrl when dragging will bypass the both patches. "
 1260   EQUB 0
 1270   ALIGN
 1280:
 1290; ***** Set up registers for filters
 1300.mod_set_PostFilter
 1310   STMFD   (sp)!,{link}
 1320   MOV     r3,#0
 1330   ADR     r0,`module_PostFilterName
 1340 FNLADR("",1,filtercode)
 1350   MOV     r2,r12
 1360   LDR     r4,`module_PostFilterMask
 1370   LDMFD   (sp)!,{pc}
 1380:
 1390.`module_PostFilterMask
 1400   EQUD    %00011111111100111110
 1410.`module_PostFilterName
 1420   EQUS    "Text Copy"+CHR$0
 1430   ALIGN
 1440:
 1450          ; **** End of module header ****
 1460:
 1470.InitCode
 1480   STMFD  (sp)!,{r0,link}
 1490   MOV    r0,#0
 1500   STR     r0,[r12,#`dragging]
 1510   LDMFD  (sp)!,{r0,pc}
 1520:
 1530.filtercode
 1540   STMFD   (sp)!,{r1-r2,link}
 1550   CMP     r0,#0
 1560   BEQ     checknullevent
 1570   CMP     r0,#6
 1580   BEQ     ismouseclick
 1590   CMP     r0,#7
 1600   BEQ     isdragdone
 1610   CMP     r0,#17
 1620   CMPNE   r0,#18
 1630   BEQ     ismessage
 1640   CMP     r0,#19
 1650   BEQ     ismessageack
 1660   LDMFD   (sp)!,{r1-r2,pc}
 1670:
 1680.ismessageack
 1690   STR     r0,[r12,#`eventtype]
 1700          ; "%c04%c30Acknowledged"
 1710   LDR     r2,[r1,#16]
 1720   CMP     r2,#1
 1730   BEQ     isNoDataSaveAck           ; Nobody loves me, so transfer diesTHEN
 1740   B       exitevent
 1750.ismessage
 1760   STR     r0,[r12,#`eventtype]
 1770   LDR     r2,[r1,#16]
 1780          ; "%c04%c30Message %&2"
 1790   CMP     r2,#1
 1800   BEQ     isDataSave                ; Initial message, can I save to you ?
 1810   CMP     r2,#3
 1820   BEQ     isDataLoad                ; Please load this data from meTHEN
 1830   CMP     r2,#2
 1840   BEQ     isDataSaveAck             ; I want your data, give it to me nowTHEN
 1850.exitevent
 1860   LDR     r0,[r12,#`eventtype]
 1870   LDMFD   (sp)!,{r1-r2,pc}
 1880:
 1890.isDataSaveAck
 1900   LDR     r0,[r12,#`dragging]
 1910   CMP     r0,#2
 1920   BNE     exitevent
 1930          ; "Data save initiated..."
 1940   MOV     r0,#10
 1950   ADD     r1,r1,#44                     ; address in block of filename
 1960          ; "File name to save as %$1"
 1970 FNLMOV("  ",2,&FFF)
 1980          ; filetype
 1990   LDR     r4,[r12,#`saveaddr]
 2000          ; start address
 2010   LDR     r5,[r12,#`savelen]
 2020          ; length
 2030   ADD     r5,r5,r4                      ; end address
 2040          ; "Save memory %&4 - %&5"
 2050   SWI     "OS_File"                     ; save file
 2060   SUB     r1,r1,#44                     ; restore block pointer
 2070   MOV     r0,#3                         ; acknowledge sending of data
 2080   STR     r0,[r1,#16]                   ; store in block
 2090   LDR     r0,[r1,#8]                    ; get their ref
 2100   STR     r0,[r1,#12]                   ; store in our ref to mark as reply
 2110   LDR     r2,[r1,#4]                    ; task to return to
 2120   MOV     r0,#17
 2130   SWI     "Wimp_SendMessage"            ; tell them...
 2140   MOV     r0,#0
 2150   STR     r0,[r12,#`dragging]
 2160          ; mark as not dragging
 2170   LDMFD   (sp)!,{r1-r2,pc}              ; Return from call
 2180:
 2190.isNoDataSaveAck
 2200   LDR     r0,[r12,#`dragging]
 2210   CMP     r0,#2
 2220   BNE     exitevent
 2230   MOV     r0,#0
 2240   STR     r0,[r12,#`dragging]
 2250          ; mark as not dragging
 2260   LDMFD   (sp)!,{r1-r2,pc}              ; Return from call
 2270:
 2280.isDataSave
 2290; check for the correct icon
 2300          ; "Check icon"
 2310   BL     checkctrl
 2320   BEQ    exitevent
 2330   LDR    r2,[r1,#40]
 2340   ADD    r2,r2,#1
 2350   CMP    r2,#&1000
 2360   BNE    exitevent
 2370   BL     checkshift      ; is shift pressed ?
 2380   BEQ    exitevent       ; if so then exit, 'cos we can't deal with it here
 2390   LDR    r3,[r1,#20]     ; window
 2400   LDR    r4,[r1,#24]     ; icon
 2410   BL     isdragok
 2420   CMP    r0,#0
 2430   BEQ    exitevent
 2440   LDMFD  (sp),{r1}
 2450; end of check
 2460   MVN    r2,#NOT -1
 2470   STR    r2,[r1,#36]   ; data not safe
 2480   MOV    r2,#128
 2490   STR    r2,[r1,#0]    ; length of block
 2500   MOV    r2,#2
 2510   STR    r2,[r1,#16]   ; ok save file message
 2520   LDR    r2,[r1,#8]
 2530   STR    r2,[r1,#12]   ; note message number
 2540 FNLADR("  ",3,`ourfilename)
 2550   ADD    r4,r1,#44     ; start of filename
 2560.__z0_DSfilenameloop
 2570   LDRB   r2,[r3],#1
 2580   STRB   r2,[r4],#1
 2590   CMP    r2,#31
 2600   BGT    __z0_DSfilenameloop
 2610   MOV    r0,#17
 2620   LDR    r2,[r1,#4]
 2630   SWI    "Wimp_SendMessage"
 2640   MOV    r0,#0
 2650   LDMFD  (sp)!,{r1-r2,pc}
 2660:
 2670.isDataLoad
 2680; check for the correct icon
 2690          ; "DataLoad"
 2700   BL     checkctrl
 2710   BEQ    exitevent
 2720   BL     checkshift      ; is shift pressed ?
 2730   BNE    __z1_notshift
 2740   LDREQ  r2,[r1,#36]     ; if so then is this data safe ?
 2750   CMNEQ  r2,#1           ; is it -1 (unsafe ?)
 2760   BEQ    exitevent
 2770   B      __z1_oktoload
 2780.__z1_notshift
 2790   LDR    r2,[r1,#40]
 2800   ADD    r2,r2,#1
 2810   CMP    r2,#&1000
 2820   BNE    exitevent
 2830.__z1_oktoload
 2840   LDR    r3,[r1,#20]   ; window
 2850   LDR    r4,[r1,#24]   ; icon
 2860   BL     isdragok
 2870   CMP    r0,#0
 2880   BEQ    exitevent
 2890; end of check
 2900   LDMFD  (sp),{r1}
 2910   LDR     r3,[r12,#`str]
 2920   LDR     r4,[r12,#`length]
 2930   ADD    r1,r1,#44   ; filename
 2940   BL     checkshift  ; is shift drag ?
 2950   BEQ    doshiftdrag ; if so then only copy filenameTHEN
 2960   MOV    r0,#&40     ; opening file for input
 2970   SWI    "OS_Find"   ; open file
 2980   STR     r0,[r12,#`filehandle]
 2990          ; "Handle %r0"
 3000.__z1_DLreaddataiconloop
 3010   LDR     r3,[r12,#`str]
 3020   LDR     r4,[r12,#`length]
 3030.__z1_DLreaddataloop
 3040   LDR     r1,[r12,#`filehandle]
 3050   MOV    r0,#&7F     ; check EOF
 3060   SWI    "OS_Byte"
 3070   CMP    r1,#0
 3080   BNE    __z1_DLeof
 3090   CMP    r4,#1       ; is this last char
 3100   BEQ    __z1_DLnexticon ; if so, next icon
 3110   LDR     r1,[r12,#`filehandle]
 3120   SWI    "XOS_BGet"
 3130   STRB   r0,[r3],#1
 3140   CMP    r0,#31       ; is this terminator
 3150   BLE    __z1_DLnexticon  ; if so, next icon
 3160   SUB    r4,r4,#1
 3170   B      __z1_DLreaddataloop
 3180.__z1_DLnexticon
 3190   BL     updateicon
 3200   MOV    r0,#0
 3210   STRB   r0,[r3],#1
 3220   LDR     r4,[r12,#`icon]
 3230   ADD    r4,r4,#1
 3240   STR     r4,[r12,#`icon]
 3250          ; next icon
 3260   LDR     r3,[r12,#`window]
 3270   BL     isdragok
 3280   CMP    r0,#0       ; is next icon valid
 3290   BEQ    __z1_DLnomore
 3300   B      __z1_DLreaddataiconloop
 3310.__z1_DLeof
 3320   LDR     r4,[r12,#`str]
 3330   CMP    r4,r3          ; have we stored anything yet ?
 3340   MOVNE  r0,#0
 3350   STRNEB r0,[r3],#1
 3360   BLNE   updateicon     ; and only update if we have changed it...
 3370.__z1_DLnomore
 3380   LDR     r1,[r12,#`filehandle]
 3390   MOV    r0,#0       ; r0=0 close file
 3400   SWI    "OS_Find"
 3410._DLconfirm
 3420   LDMFD  (sp),{r1}
 3430   MOV    r0,#4
 3440   STR    r0,[r1,#16]
 3450   LDR    r0,[r1,#8]
 3460   STR    r0,[r1,#12]
 3470   LDR    r2,[r1,#4]
 3480   MOV    r0,#17
 3490   SWI    "Wimp_SendMessage"
 3500   MOV    r0,#0
 3510   LDMFD  (sp)!,{r1-r2,pc}
 3520:
 3530.doshiftdrag
 3540; > r1=filename
 3550;   r3=store location
 3560;   r4=length of string
 3570.__z2_loop
 3580   CMP    r4,#1         ; how much space left ?
 3590   BLE    __z2_exit         ; is terminator then exit
 3600   LDRB   r0,[r1],#1    ; get byte of filename
 3610   STRB   r0,[r3],#1    ; store in block
 3620   CMP    r0,#31        ; is this terminator
 3630   BLE    __z2_exit         ; if so, then exit
 3640   SUB    r4,r4,#1
 3650   B      __z2_loop
 3660.__z2_exit
 3670   BL     updateicon
 3680   B      _DLconfirm
 3690:
 3700.isdragok
 3710   STMFD  (sp)!,{r1-r4,link}
 3720          ; "Win  = %&3"
 3730          ; "Icon = %&4"
 3740   STR     r3,[r12,#`window]
 3750   STR     r4,[r12,#`icon]
 3760 FNLADD("  ",1,12,`window)
 3770   SWI    "XWimp_GetIconState"
 3780   BVS    __z3_notdragok
 3790   LDR     r2,[r12,#`flags]
 3800   TST    r2,#(1<<8)    ; is it indirected
 3810   BEQ    __z3_notdragok
 3820   AND    r3,r2,#(15<<12)
 3830   CMP    r3,#(14<<12)     ; write/click/drag
 3840   CMPNE  r3,#(15<<12)     ; writeable
 3850   BNE    __z3_notdragok
 3860   MOV    r0,#1
 3870          ; "Icon valid"
 3880   LDMFD  (sp)!,{r1-r4,pc}
 3890.__z3_notdragok
 3900   MOV    r0,#0
 3910          ; "Icon not valid"
 3920   LDMFD  (sp)!,{r1-r4,pc}
 3930:
 3940.updateicon
 3950   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
 3960          ; CHR$4+"%IUpdating icon"
 3970 FNLADD("  ",1,12,`window)
 3980   SWI     "Wimp_GetIconState"
 3990   ADD     r1,r1,#8                      ; remove first two words
 4000   LDMIA   r1,{r1-r4}                    ; read lbrt into r1,r2,r3,r4
 4010   LDR     r0,[r12,#`window]
 4020   SWI     "Wimp_ForceRedraw"
 4030   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
 4040:
 4050; Check if the shift key is pressed
 4060; < EQ if pressed
 4070.checkshift
 4080   STMFD   (sp)!,{r0-r2,link}
 4090   MOV     r0,#&79             ; Keyboard scan OS_Byte code
 4100   MOV     r1,#&80             ; SHIFT key code
 4110   SWI     "XOS_Byte"          ; Call OS_Byte to read status
 4120   TEQ     r1,#&FF             ; is it pressed ?
 4130   LDMFD   (sp)!,{r0-r2,pc}
 4140; Check if the ctrl key is pressed
 4150; < EQ if pressed
 4160.checkctrl
 4170   STMFD   (sp)!,{r0-r2,link}
 4180   MOV     r0,#&79             ; Keyboard scan OS_Byte code
 4190   MOV     r1,#&81             ; CTRL key code
 4200   SWI     "XOS_Byte"          ; Call OS_Byte to read status
 4210   TEQ     r1,#&FF             ; is it pressed ?
 4220   LDMFD   (sp)!,{r0-r2,pc}
 4230:
 4240.`ourfilename:EQUS "<Wimp$Scrap>":EQUB 0:ALIGN
 4250:
 4260.ismouseclick
 4270   STMFD   (sp)!,{r3-r9}    ; Stack registers
 4280   LDR     r0,[r1,#8]
 4290          ; "Button event = %&0"
 4300   BL      checkctrl
 4310   LDRNE   r0,[r1,#8]       ; get buttons if ctrl not pressedTHEN
 4320   TSTNE   r0,#&40          ; THENis this a select drag ?
 4330   BEQ     __z4_exit            ; if either then exit
 4340;    SWI     &104
 4350          ; "Checking drag is ok"
 4360   LDR     r3,[r1,#12]      ; window
 4370   LDR     r4,[r1,#16]      ; icon
 4380   BL      isdragok
 4390   CMP     r0,#0
 4400   BEQ     __z4_exit
 4410.__z4_isdrag
 4420   LDR     r2,[r12,#`window]
 4430   MVN     r3,#NOT -1
 4440   MOV     r0,#19
 4450   SWI     "XWimp_SendMessage"  ; find the task handle
 4460   BVS     __z4_exit
 4470   MOV     r6,r2                ; r6=task handle
 4480   MOV     r8,#0                ; r8=pointer to rma
 4490   MOV     r7,#0                ; r7=length of area (0 bytes)
 4500   ADR     r2,`textfile         ; large text file icon to drag
 4510   BL      setdrag
 4520   BL      addline
 4530;    SWI     &104
 4540          ; "Is one of our drag requests!!!"
 4550   MOV     r0,#1
 4560   STR     r0,[r12,#`dragging]
 4570   STR     r8,[r12,#`saveaddr]
 4580   STR     r7,[r12,#`savelen]
 4590          ; "Data is length %r7, containing %$8"
 4600   B       __z4_noaction
 4610.__z4_noaction
 4620   MOV     r0,#0
 4630   LDMFD   (sp)!,{r3-r9}              ; Restore registers
 4640   LDMFD   (sp)!,{r1-r2,pc}           ; Return from call
 4650.__z4_exit
 4660   MOV     r0,#6
 4670   LDMFD   (sp)!,{r3-r9}              ; Restore registers
 4680   LDMFD   (sp)!,{r1-r2,pc}           ; Return from call
 4690:
 4700.`textfile
 4710   EQUS    "File_FFF"+CHR$0
 4720.`smallfile
 4730   EQUS    "Small_FFF"+CHR$0
 4740   ALIGN
 4750:
 4760; set the drag icon
 4770.setdrag
 4780   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
 4790   CMP     r8,#0                ; is the current pointer set ?
 4800   SWINE   "DragASprite_Stop"   ; if not then stop the current drag
 4810 FNLADD("  ",1,12,`dragbox)
 4820   SWI     "Wimp_GetPointerInfo"
 4830   LDMIA   r1,{r0-r1}
 4840   SUB     r0,r0,#34            ; x0=x-34 (CHR$ width of box)
 4850   SUB     r1,r1,#34            ; y0=y-34 (CHR$ height of box)
 4860   ADD     r2,r0,#34*2          ; x1=x0+64 (width of box)
 4870   ADD     r3,r1,#34*2          ; y1=y0+64 (height of box)
 4880 FNLADD("  ",5,12,`dragbox)
 4890   STMIA   r5,{r0-r3}           ; store drag box in block in WS
 4900   LDR     r2,[sp,#8]           ; r2=sprite name
 4910   MOV     r0,#%11000101        ; centre, constrain pointer, do shadow
 4920   MOV     r1,#1                ; use Wimp sprite area
 4930   MOV     r3,r5                ; r3=dragbox pointer
 4940   SWI     "DragASprite_Start"
 4950          ; "Starting drag"
 4960   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
 4970:
 4980.wait
 4990   STMFD   (sp)!,{r0-r1,link}            ; Stack registers
 5000   SWI     "OS_ReadMonotonicTime"
 5010   ADD     r1,r0,#5         ; r1=time now + delay
 5020.__z5_loop
 5030   SWI     "OS_ReadMonotonicTime"
 5040   CMP     r0,r1            ; have we exceeded delay ?
 5050   BLT     __z5_loop            ; if not then keep checkingTHEN
 5060   LDMFD   (sp)!,{r0-r1,pc}              ; Return from call
 5070:
 5080; Add a line from the icon pointed to by the block
 5090.addline
 5100   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
 5110   LDR     r0,[r12,#`str]
 5120          ; r0=string
 5130   BL      lenctrl                       ; how long is the string
 5140          ; "Checking length = %r1, current block = %&8"
 5150;    REM     "String located at %&0"
 5160;    LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
 5170;
 5180   CMP     r8,#0                         ; is this the first call ?
 5190   MOVEQ   r0,#6                         ; if so then claim new block
 5200   MOVNE   r0,#13                        ; otherwise extend it
 5210   MOVNE   r2,r8
 5220   MOV     r3,r1                         ; r3=amount to claim/extend
 5230   ADD     r3,r1,#1                      ; add extra byte for LF
 5240   SWI     "OS_Module"                   ; claim/extend
 5250   MOV     r8,r2                         ; r8=new area pointer
 5260   ADD     r1,r2,r7                      ; r2=end of previous area
 5270   LDR     r0,[r12,#`str]
 5280          ; r0=pointer to string to copy
 5290          ; "Moving %&0 to %&1"
 5300   BL      movectrl                      ; copy it to the new area
 5310   ADD     r7,r7,r3                      ; increment amount to copy
 5320   MOV     r0,#10                        ; LF to add to end of line!
 5330   SUB     r1,r7,#1                      ; store as last byte
 5340   STRB    r0,[r8,r1]                    ; and store in memory
 5350   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
 5360:
 5370.isdragdone
 5380   STMFD   (sp)!,{r3-r9}                 ; Stack registers
 5390   LDR     r0,[r12,#`dragging]
 5400   CMP     r0,#1
 5410   CMPNE   r0,#3
 5420   BNE     __z6_exit
 5430          ; "%c04Drag done, in state %r0"
 5440   SWI     "DragASprite_Stop"
 5450   SWI     "Wimp_GetPointerInfo"
 5460   LDMIA   r1,{r2,r3,r4,r5,r6}
 5470          ; "%R"
 5480   STR     r5,[r1,#20]      ; store mx
 5490   STR     r6,[r1,#24]      ; store my
 5500   STR     r2,[r1,#28]      ; store mw
 5510   STR     r3,[r1,#32]      ; store mi
 5520   MOV     r2,#56           ; block length
 5530   MOV     r3,#0            ; to
 5540   MOV     r4,#0            ; ref
 5550   MOV     r5,#0            ; ref
 5560   MOV     r6,#1            ; message
 5570   STMIA   r1,{r2-r6}       ; store in block
 5580   ADR     r0,`estlen       ; address of estimated length
 5590   LDMIA   r0,{r2-r6}
 5600   ADD     r0,r1,#36
 5610   STMIA   r0,{r2-r6}       ; copy into block
 5620   MOV     r0,#18           ; send recorded deliveryTHEN
 5630   LDR     r2,[r1,#20]      ; get window to send to
 5640   LDR     r3,[r1,#24]      ; get icon to send to
 5650          ; "Sending to %&2"
 5660   SWI     "XWimp_SendMessage"
 5670   MOVVS   r0,#0            ; not dragging if error
 5680   MOVVC   r0,#2            ; if no error then on to save data message
 5690   STR     r0,[r12,#`dragging]
 5700          ; "Message sent, ok = %r0"
 5710.__z6_noaction
 5720   MOV     r0,#0
 5730   LDMFD   (sp)!,{r1-r9,pc}              ; Return from call
 5740.__z6_exit
 5750   MOV     r0,#7
 5760   LDMFD   (sp)!,{r1-r9,pc}              ; Return from call
 5770:
 5780.`estlen
 5790   EQUD    -1 ; data not safe
 5800.`texttype
 5810   EQUD    &FFF
 5820.`savename
 5830   EQUS    "Icontext"+CHR$0
 5840:
 5850.checknullevent
 5860   LDR     r2,[r12,#`dragging]
 5870          ; "%c04%c30Current state = %r2"
 5880   CMP     r2,#1
 5890   BEQ     isnullevent
 5900   CMP     r2,#3
 5910   LDMNEFD (sp)!,{r1-r2,pc}         ; return if not a small drag
 5920   STMFD   (sp)!,{r3-r9}            ; Stack registers
 5930 FNLADD("  ",1,12,`ptrblock)
 5940   SWI     "Wimp_GetPointerInfo"
 5950   LDR     r0,[r12,#`mouseb]
 5960   TST     r0,#4
 5970   BEQ     __z7_dropped                 ; if you drop, but still hold adjust
 5980   TST     r0,#1                    ; adjust ?
 5990   BNE     __z7_exit                    ; if still pressed then exit
 6000   BL      wait
 6010   LDR     r8,[r12,#`saveaddr]
 6020          ; get save address
 6030   ADR     r2,`textfile             ; swap back to biggy
 6040   BL      setdrag
 6050   MOV     r0,#1
 6060   STR     r0,[r12,#`dragging]
 6070   MOV     r0,#0
 6080.__z7_exit
 6090   LDMFD   (sp)!,{r3-r9}
 6100   LDMFD   (sp)!,{r1-r2,pc}         ; Return from call
 6110.__z7_dropped
 6120   LDMFD   (sp)!,{r3-r9}
 6130   MOV     r0,#0
 6140   B       isdragdone
 6150:
 6160.isnullevent
 6170   STMFD   (sp)!,{r3-r9}            ; Stack registers
 6180   STR     r1,[r12,#`userblock]
 6190 FNLADD("  ",1,12,`ptrblock)
 6200   SWI     "Wimp_GetPointerInfo"
 6210   LDR     r0,[r12,#`mouseb]
 6220   TST     r0,#1                    ; adjust ?
 6230   BEQ     __z8_exit
 6240   LDR     r3,[r12,#`mousew]
 6250   LDR     r4,[r12,#`mousei]
 6260   BL      isdragok
 6270   CMP     r0,#0                    ; is it a valid icon to add ?
 6280   BEQ     __z8_exit
 6290   MOV     r0,#5                    ; read current task handle
 6300   SWI     "Wimp_ReadSysInfo"
 6310   MOV     r9,r0                    ; r9=current task
 6320; read task handle we are over
 6330   LDR     r1,[r12,#`userblock]
 6340   MOV     r2,r3
 6350   MOV     r3,r4
 6360   MOV     r0,#19
 6370   SWI     "XWimp_SendMessage"  ; find the task handle
 6380          ; CHR$4+"%ICurrent = %&9, over = %&2, win = %&3, icon=%&4"
 6390   CMP     r2,r9                ; are they the same task ?
 6400   BEQ     __z8_gotarea             ; if they are then `str is in right place
 6410   MOV     r0,r2                ; r0=source (over)
 6420   LDR     r1,[r12,#`str]
 6430          ; r1=source data (in over)
 6440   MOV     r2,r9                ; r2=dest (current)
 6450   LDR     r3,[r12,#`userblock]
 6460          ; r3=dest data (in current - users block!)
 6470   MOV     r4,#256              ; r4=length
 6480          ; "Move from T%&0 to T%&2, from A%&1 to A%&3"
 6490   SWI     "Wimp_TransferBlock"
 6500   MOV     r0,#0
 6510   STRB    r0,[r3,#255]         ; add a terminator in case the string is long
 6520   STR     r3,[r12,#`str]
 6530          ; store in block so that addline can find it
 6540.__z8_gotarea
 6550   LDR     r3,[r12,#`str]
 6560          ; "Is one of ours, is %$3"
 6570   LDR     r7,[r12,#`savelen]
 6580   LDR     r8,[r12,#`saveaddr]
 6590          ; "Currently says %$8"
 6600   BL      addline
 6610   STR     r8,[r12,#`saveaddr]
 6620   STR     r7,[r12,#`savelen]
 6630 FNLADR("  ",2,`smallfile)
 6640   BL      setdrag
 6650   MOV     r0,#3
 6660   STR     r0,[r12,#`dragging]
 6670          ; mark as currently dragging small
 6680.__z8_exit
 6690   MOV     r0,#0
 6700   LDMFD   (sp)!,{r3-r9}                 ; Restore registers
 6710   LDMFD   (sp)!,{r1-r2,pc}              ; Return from call
 6720:
 6730          ; Installing library 'Strings'
 6740:
 6750          ; Library routine Strings.movectrl
 6760.movectrl
 6770; > r0=input string
 6780;   r1=ouput buffer
 6790; < __z9_r1=$r0
 6800   STMFD   (sp)!,{r0-r1,r5,link}
 6810.__z9_loop
 6820   LDRB    r5,[r0],#1
 6830   STRB    r5,[r1],#1
 6840   CMP     r5,#31
 6850   BGT     __z9_loop
 6860   LDMFD   (sp)!,{r0-r1,r5,pc}^
 6870:
 6880:
 6890          ; Library routine Strings.lenctrl
 6900.lenctrl
 6910; > r0=input string
 6920; < r1=LEN(r0)
 6930   STMFD   (sp)!,{r2,link}
 6940   MOV     r1,#0
 6950.__z10_loop
 6960   LDRB    r2,[r0,r1]
 6970   ADD     r1,r1,#1
 6980   CMP     r2,#32
 6990   BGE     __z10_loop
 7000   SUB     r1,r1,#1
 7010   LDMFD   (sp)!,{r2,pc}^
 7020:
 7030          ; Library 'Strings' ends
 7040]
 7050REM **** End of main code ****
 7060REM Set final pointer to find the length of the code
 7070PROCpatch_setpc(0)
 7080NEXT pass%
 7090PROCpatch_savefile
 7120REM **** Post-assembly user code *****
 7130*Run <TextCopy$Dir>.TextCopy
 7140END
 7150:
 7160:
 7170REM **** Filing procedures ****
 7180:
 7190DEF PROCpatch_loadfile
 7200codelen=0
 7210DIM MC% &1400
 7220endofcode=codelen+&0:max=codelen
 7230L%=endofcode
 7330ENDPROC
 7340:
 7350DEF PROCpatch_savefile
 7360outfile$="<TextCopy$Dir>.TextCopy"
 7370OSCLI("Save "+outfile$+" "+STR$~MC%+" "+STR$~(max+MC%))
 7380OSCLI("Settype "+outfile$+" Module")
 7390patchdir$="<TextCopy$Dir>"
 7430ENDPROC
 7440:
 7450REM **** Error Handler ****
 7460:
 7470DEFPROCError
 7550ERROR EXT ERR,REPORT$+" at line "+STR$ERL
 7560ENDPROC
 7570:
 7580REM **** Utility procedures ****
 7590:
 7600DEFPROCpatch_setpc(n)
 7610IF P%-&0>max THENmax=P%-&0
 7620P%=n:O%=MC%+n-&0
 7630ENDPROC
 7640:
 7650DEFFNfindfreereg(a,b,c,d):LOCAL n:n=0
 7660WHILE n=a OR n=b OR n=c OR n=d
 7670 n+=1
 7680ENDWHILE
 7690=n
 7700:
 7710REM **** Long ADR macro procedure ****
 7720:
 7730REM DESC. : ADR equivalent for long address ranges, in 2 insts
 7740REM ENTRY : cond$ = two char string, containing the ARM condition
 7750REM         reg% = 0..15
 7760REM         pointer% = long range pointer
 7770REM COMM. : pass% = OPT variable in the assembler FOR..NEXT loop
 7780REM         Can only handle 64 KByte ranges
 7790DEFFNLADR(cond$,reg%,pointer%)
 7800LOCAL cc%,diff%,lo%,hi%,op1%,op2%
 7810IF (pass% AND%10)=0 P%+=8:O%+=8:=0
 7820IF ABS(pointer%-P%)>65535 THEN ERROR 1,"LADR can only handle 64 KByte ranges at &"+STR$~P%+" (&"+STR$~(pointer%-P%)+" distant)"
 7830IFcond$="  " OR cond$=""  THENcond$="AL"
 7840cc%=INSTR("EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)
 7850IF cc%=0 ERROR 1,"FATAL ERROR : Unknown condition for LADR at &"+STR$~P%+" (&"+STR$~O%+")" ELSE cc%=(cc%-1)DIV2
 7860diff%=pointer%-P%-8
 7870lo%=ABS(diff%)AND&FF
 7880hi%=ABS(diff%)AND&FF00
 7890IFdiff%>=0THEN
 7900 op1%=(cc%<<28)+&028F0000+(reg%<<12)+lo%
 7910 op2%=(cc%<<28)+&02800C00+(reg%<<16)+(reg%<<12)+(hi%>>8)
 7920ELSE
 7930 op1%=(cc%<<28)+&024F0000+(reg%<<12)+lo%
 7940 op2%=(cc%<<28)+&02400C00+(reg%<<16)+(reg%<<12)+(hi%>>8)
 7950ENDIF
 7960[OPT pass%:EQUD op1%:EQUD op2%:]
 7970=0
 7980:
 7990REM **** Long MOV macro instruction ****
 8000:
 8010DEFFNLMOV(cond$,reg,value)
 8020IF cond$="" OR cond$="  " THENcond$="AL"
 8030cond=(INSTR("EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)-1)/2
 8040mov=(&3A<<20)+(reg<<12)+(cond<<28)
 8050add=(&28<<20)+(reg<<12)+(reg<<16)+(cond<<28)
 8060shift=0
 8070REPEAT
 8080 WHILE (value AND 3)=0
 8090  shift+=1:value=value DIV4
 8100 ENDWHILE
 8110 xshift=16-shift:IF xshift=16 THENxshift=0
 8120 IF mov<>0 THEN
 8130  [OPT pass%:EQUD mov+(xshift<<8)+(value AND 255):]
 8140  mov=0
 8150 ELSE
 8160  [OPT pass%:EQUD add+(xshift<<8)+(value AND 255):]
 8170 ENDIF
 8180 value=value DIV256:shift+=4
 8190UNTILvalue=0
 8200=0
 8210:
 8220REM **** Long ADD macro instruction ****
 8230:
 8240DEFFNLADD(cond$,reg1,reg2,value)
 8250IF cond$="" OR cond$="  " THENcond$="AL"
 8260cond=(INSTR("EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)-1)/2
 8270add1=(&28<<20)+(reg1<<12)+(reg2<<16)+(cond<<28)
 8280add2=(&28<<20)+(reg1<<12)+(reg1<<16)+(cond<<28)
 8290shift=0
 8300REPEAT
 8310 WHILE (value AND 3)=0
 8320  shift+=1:value=value DIV4
 8330 ENDWHILE
 8340 xshift=16-shift:IF xshift=16 THENxshift=0
 8350 IF add1<>0 THEN
 8360  [OPT pass%:EQUDadd1+(xshift<<8)+(value AND 255):]
 8370  add1=0
 8380 ELSE
 8390  [OPT pass%:EQUDadd2+(xshift<<8)+(value AND 255):]
 8400 ENDIF
 8410 value=value DIV256:shift+=4
 8420UNTILvalue=0
 8430=0
 8440:
32639REM JFPatch

$� > Patch for memory compilation
7� Created by JFPatch � Justin Fletcher, 25 Feb 1995
0� Intermediate code file created 20 Aug 1995
(� � �Error:�
2�patch_loadfile
<$� **** Workspace structures ****
F:
P&ptr=0:� Start structure of DragBox
Z`db_left=ptr:ptr+=4
d`db_bottom=ptr:ptr+=4
n`db_right=ptr:ptr+=4
x`db_top=ptr:ptr+=4
�`len_DragBox=ptr
�:
�(ptr=0:� Start structure of workspace
�`filehandle=ptr:ptr+=4
�`window=ptr:ptr+=4
�`icon=ptr:ptr+=4
�`left=ptr:ptr+=4
�`bottom=ptr:ptr+=4
�`right=ptr:ptr+=4
�`top=ptr:ptr+=4
�`flags=ptr:ptr+=4
�`str=ptr:ptr+=4
�`valid=ptr:ptr+=4
`length=ptr:ptr+=4
`eventtype=ptr:ptr+=4
`saveaddr=ptr:ptr+=4
"`savelen=ptr:ptr+=4
,"`dragbox=ptr:ptr+=`len_DragBox
6`userblock=ptr:ptr+=4
@`ptrblock=ptr:ptr+=4
J`mousey=ptr:ptr+=4
T`mouseb=ptr:ptr+=4
^`mousew=ptr:ptr+=4
h`mousei=ptr:ptr+=4
r`dragging=ptr:ptr+=4
|`len_workspace=ptr
�:
�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
&:
0.module_title
:   EQUS "TextCopy"+�0
D   ALIGN
N:
X.module_help
bF   EQUS "Text Copy"+�9+"1.11 ("+��$,5,11)+") � Justin Fletcher"+�0
l   ALIGN
v:
�.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
    MOV     r0,#6
* �LMOV("",3,`len_workspace)
4?   SWI     "XOS_Module"           ; Claim private workspace
>4   ADDVS   sp,sp,#4               ; return error
H4   LDMVSFD (sp)!,{r1-r4,pc}       ; return error
R=   STR     r2,[r12]               ; store in private word
\1   MOV     r12,r2                 ; r12=space
f!   BL      mod_set_PostFilter
p*   SWI     "Filter_RegisterPostFilter"
z9   LDMFD   (sp)!,{r0-r4,link}     ; restore registers
�   B       InitCode
�:
�.module_final
�7   STMFD   (sp)!,{r0-r4,r12,link} ; Stack registers
�   LDR     r12,[r12]
�!   BL      mod_set_PostFilter
�,   SWI     "Filter_DeRegisterPostFilter"
�   MOV     r0,#7
�   MOV     r2,r12
�9   SWI     "XOS_Module"           ; Release workspace
�   ADDVS   sp,sp,#4
�7   LDMVSFD (sp)!,{r1-r4,r12,pc}   ; Return if error
�.   LDMFD   (sp)!,{r0-r4,r12,pc}   ; Return
:
!; ***** Module commands table
.module_commands
$-   EQUS "TextCopy"         ; Command name
.   EQUB 0:ALIGN
8-   EQUD 0                  ; Code to call
B&   EQUD &0                 ; Flags
L/   EQUD 0                  ; Syntax pointer
V-   EQUD help_textcopy      ; Help pointer
`
   EQUB 0
j   ALIGN
t:
~$; ***** Help and Syntax messages
�.help_textcopy
�Q   EQUS "The TextCopy allows you to drag text files directly on to writable "
�L   EQUS "icons. This is done by use of filters, so this may clash with "
�R   EQUS "applications which process text files dragged onto writeable icons. "
�N   EQUS "If multiple writable icons are present, then the text will span "
�   EQUS "these."+�13
�U   EQUS "Holding down Shift when dragging will copy the filename into the icon. "
�X   EQUS �13+�13+"Dragging of writable icons is also possible for type 15 icons and "
�D   EQUS "for all icons if the AllWCD module is present."+�13+�13
�L   EQUS "Holding down Ctrl when dragging will bypass the both patches. "
�
   EQUB 0
�   ALIGN
:

(; ***** Set up registers for filters
.mod_set_PostFilter
   STMFD   (sp)!,{link}
(   MOV     r3,#0
2(   ADR     r0,`module_PostFilterName
< �LADR("",1,filtercode)
F   MOV     r2,r12
P(   LDR     r4,`module_PostFilterMask
Z   LDMFD   (sp)!,{pc}
d:
n.`module_PostFilterMask
x$   EQUD    %00011111111100111110
�.`module_PostFilterName
�   EQUS    "Text Copy"+�0
�   ALIGN
�:
�.          ; **** End of module header ****
�:
�
.InitCode
�   STMFD  (sp)!,{r0,link}
�   MOV    r0,#0
�"   STR     r0,[r12,#`dragging]
�   LDMFD  (sp)!,{r0,pc}
�:
�.filtercode
!   STMFD   (sp)!,{r1-r2,link}
   CMP     r0,#0
   BEQ     checknullevent
"   CMP     r0,#6
,   BEQ     ismouseclick
6   CMP     r0,#7
@   BEQ     isdragdone
J   CMP     r0,#17
T   CMPNE   r0,#18
^   BEQ     ismessage
h   CMP     r0,#19
r   BEQ     ismessageack
|   LDMFD   (sp)!,{r1-r2,pc}
�:
�.ismessageack
�#   STR     r0,[r12,#`eventtype]
�&          ; "%c04%c30Acknowledged"
�   LDR     r2,[r1,#16]
�   CMP     r2,#1
�M   BEQ     isNoDataSaveAck           ; Nobody loves me, so transfer dies�
�   B       exitevent
�.ismessage
�#   STR     r0,[r12,#`eventtype]
�   LDR     r2,[r1,#16]
�%          ; "%c04%c30Message %&2"
�   CMP     r2,#1
O   BEQ     isDataSave                ; Initial message, can I save to you ?
   CMP     r2,#3
I   BEQ     isDataLoad                ; Please load this data from me�
&   CMP     r2,#2
0O   BEQ     isDataSaveAck             ; I want your data, give it to me now�
:.exitevent
D#   LDR     r0,[r12,#`eventtype]
N   LDMFD   (sp)!,{r1-r2,pc}
X:
b.isDataSaveAck
l"   LDR     r0,[r12,#`dragging]
v   CMP     r0,#2
�   BNE     exitevent
�(          ; "Data save initiated..."
�   MOV     r0,#10
�K   ADD     r1,r1,#44                     ; address in block of filename
�*          ; "File name to save as %$1"
� �LMOV("  ",2,&FFF)
�          ; filetype
�"   LDR     r4,[r12,#`saveaddr]
�          ; start address
�!   LDR     r5,[r12,#`savelen]
�          ; length
�:   ADD     r5,r5,r4                      ; end address
�'          ; "Save memory %&4 - %&5"
8   SWI     "OS_File"                     ; save file
D   SUB     r1,r1,#44                     ; restore block pointer
J   MOV     r0,#3                         ; acknowledge sending of data
 =   STR     r0,[r1,#16]                   ; store in block
*<   LDR     r0,[r1,#8]                    ; get their ref
4P   STR     r0,[r1,#12]                   ; store in our ref to mark as reply
>@   LDR     r2,[r1,#4]                    ; task to return to
H   MOV     r0,#17
R;   SWI     "Wimp_SendMessage"            ; tell them...
\   MOV     r0,#0
f"   STR     r0,[r12,#`dragging]
p$          ; mark as not dragging
z?   LDMFD   (sp)!,{r1-r2,pc}              ; Return from call
�:
�.isNoDataSaveAck
�"   LDR     r0,[r12,#`dragging]
�   CMP     r0,#2
�   BNE     exitevent
�   MOV     r0,#0
�"   STR     r0,[r12,#`dragging]
�$          ; mark as not dragging
�?   LDMFD   (sp)!,{r1-r2,pc}              ; Return from call
�:
�.isDataSave
� ; check for the correct icon
�          ; "Check icon"
	   BL     checkctrl
	   BEQ    exitevent
	   LDR    r2,[r1,#40]
	$   ADD    r2,r2,#1
	.   CMP    r2,#&1000
	8   BNE    exitevent
	B2   BL     checkshift      ; is shift pressed ?
	LP   BEQ    exitevent       ; if so then exit, 'cos we can't deal with it here
	V&   LDR    r3,[r1,#20]     ; window
	`$   LDR    r4,[r1,#24]     ; icon
	j   BL     isdragok
	t   CMP    r0,#0
	~   BEQ    exitevent
	�   LDMFD  (sp),{r1}
	�; end of check
	�   MVN    r2,#� -1
	�+   STR    r2,[r1,#36]   ; data not safe
	�   MOV    r2,#128
	�-   STR    r2,[r1,#0]    ; length of block
	�   MOV    r2,#2
	�2   STR    r2,[r1,#16]   ; ok save file message
	�   LDR    r2,[r1,#8]
	�1   STR    r2,[r1,#12]   ; note message number
	� �LADR("  ",3,`ourfilename)
	�/   ADD    r4,r1,#44     ; start of filename
.__z0_DSfilenameloop

   LDRB   r2,[r3],#1
   STRB   r2,[r4],#1
   CMP    r2,#31
(!   BGT    __z0_DSfilenameloop
2   MOV    r0,#17
<   LDR    r2,[r1,#4]
F    SWI    "Wimp_SendMessage"
P   MOV    r0,#0
Z   LDMFD  (sp)!,{r1-r2,pc}
d:
n.isDataLoad
x ; check for the correct icon
�          ; "DataLoad"
�   BL     checkctrl
�   BEQ    exitevent
�2   BL     checkshift      ; is shift pressed ?
�   BNE    __z1_notshift
�>   LDREQ  r2,[r1,#36]     ; if so then is this data safe ?
�3   CMNEQ  r2,#1           ; is it -1 (unsafe ?)
�   BEQ    exitevent
�   B      __z1_oktoload
�.__z1_notshift
�   LDR    r2,[r1,#40]
�   ADD    r2,r2,#1
�   CMP    r2,#&1000
   BNE    exitevent
.__z1_oktoload
$   LDR    r3,[r1,#20]   ; window
""   LDR    r4,[r1,#24]   ; icon
,   BL     isdragok
6   CMP    r0,#0
@   BEQ    exitevent
J; end of check
T   LDMFD  (sp),{r1}
^   LDR     r3,[r12,#`str]
h    LDR     r4,[r12,#`length]
r$   ADD    r1,r1,#44   ; filename
|+   BL     checkshift  ; is shift drag ?
�:   BEQ    doshiftdrag ; if so then only copy filename�
�2   MOV    r0,#&40     ; opening file for input
�%   SWI    "OS_Find"   ; open file
�$   STR     r0,[r12,#`filehandle]
�          ; "Handle %r0"
�.__z1_DLreaddataiconloop
�   LDR     r3,[r12,#`str]
�    LDR     r4,[r12,#`length]
�.__z1_DLreaddataloop
�$   LDR     r1,[r12,#`filehandle]
�#   MOV    r0,#&7F     ; check �
�   SWI    "OS_Byte"
�   CMP    r1,#0
   BNE    __z1_DLeof
-   CMP    r4,#1       ; is this last char
0   BEQ    __z1_DLnexticon ; if so, next icon
&$   LDR     r1,[r12,#`filehandle]
0   SWI    "XOS_BGet"
:   STRB   r0,[r3],#1
D/   CMP    r0,#31       ; is this terminator
N1   BLE    __z1_DLnexticon  ; if so, next icon
X   SUB    r4,r4,#1
b!   B      __z1_DLreaddataloop
l.__z1_DLnexticon
v   BL     updateicon
�   MOV    r0,#0
�   STRB   r0,[r3],#1
�   LDR     r4,[r12,#`icon]
�   ADD    r4,r4,#1
�   STR     r4,[r12,#`icon]
�          ; next icon
�    LDR     r3,[r12,#`window]
�   BL     isdragok
�.   CMP    r0,#0       ; is next icon valid
�   BEQ    __z1_DLnomore
�%   B      __z1_DLreaddataiconloop
�.__z1_DLeof
�   LDR     r4,[r12,#`str]

<   CMP    r4,r3          ; have we stored anything yet ?

   MOVNE  r0,#0

   STRNEB r0,[r3],#1

 G   BLNE   updateicon     ; and only update if we have changed it...

*.__z1_DLnomore

4$   LDR     r1,[r12,#`filehandle]

>+   MOV    r0,#0       ; r0=0 close file

H   SWI    "OS_Find"

R._DLconfirm

\   LDMFD  (sp),{r1}

f   MOV    r0,#4

p   STR    r0,[r1,#16]

z   LDR    r0,[r1,#8]

�   STR    r0,[r1,#12]

�   LDR    r2,[r1,#4]

�   MOV    r0,#17

�    SWI    "Wimp_SendMessage"

�   MOV    r0,#0

�   LDMFD  (sp)!,{r1-r2,pc}

�:

�.doshiftdrag

�; > r1=filename

�;   r3=store location

�;   r4=length of string

�.__z2_loop

�3   CMP    r4,#1         ; how much space left ?
9   BLE    __z2_exit         ; is terminator then exit
2   LDRB   r0,[r1],#1    ; get byte of filename
,   STRB   r0,[r3],#1    ; store in block
$0   CMP    r0,#31        ; is this terminator
.2   BLE    __z2_exit         ; if so, then exit
8   SUB    r4,r4,#1
B   B      __z2_loop
L.__z2_exit
V   BL     updateicon
`   B      _DLconfirm
j:
t
.isdragok
~    STMFD  (sp)!,{r1-r4,link}
�          ; "Win  = %&3"
�          ; "Icon = %&4"
�    STR     r3,[r12,#`window]
�   STR     r4,[r12,#`icon]
� �LADD("  ",1,12,`window)
�"   SWI    "XWimp_GetIconState"
�   BVS    __z3_notdragok
�   LDR     r2,[r12,#`flags]
�.   TST    r2,#(1<<8)    ; is it indirected
�   BEQ    __z3_notdragok
�   �    r3,r2,#(15<<12)
�1   CMP    r3,#(14<<12)     ; write/click/drag
*   CMPNE  r3,#(15<<12)     ; writeable

   BNE    __z3_notdragok
   MOV    r0,#1
          ; "Icon valid"
(   LDMFD  (sp)!,{r1-r4,pc}
2.__z3_notdragok
<   MOV    r0,#0
F           ; "Icon not valid"
P   LDMFD  (sp)!,{r1-r4,pc}
Z:
d.updateicon
n>   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
x$          ; �4+"%IUpdating icon"
� �LADD("  ",1,12,`window)
�"   SWI     "Wimp_GetIconState"
�E   ADD     r1,r1,#8                      ; remove first two words
�I   LDMIA   r1,{r1-r4}                    ; read lbrt into r1,r2,r3,r4
�    LDR     r0,[r12,#`window]
�!   SWI     "Wimp_ForceRedraw"
�?   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
�:
�'; Check if the shift key is pressed
�; < EQ if pressed
�.checkshift
�!   STMFD   (sp)!,{r0-r2,link}
�?   MOV     r0,#&79             ; Keyboard scan OS_Byte code
3   MOV     r1,#&80             ; SHIFT key code
@   SWI     "XOS_Byte"          ; Call OS_Byte to read status
4   TEQ     r1,#&FF             ; is it pressed ?
"   LDMFD   (sp)!,{r0-r2,pc}
,&; Check if the ctrl key is pressed
6; < EQ if pressed
@.checkctrl
J!   STMFD   (sp)!,{r0-r2,link}
T?   MOV     r0,#&79             ; Keyboard scan OS_Byte code
^2   MOV     r1,#&81             ; CTRL key code
h@   SWI     "XOS_Byte"          ; Call OS_Byte to read status
r4   TEQ     r1,#&FF             ; is it pressed ?
|   LDMFD   (sp)!,{r0-r2,pc}
�:
�2.`ourfilename:EQUS "<Wimp$Scrap>":EQUB 0:ALIGN
�:
�.ismouseclick
�1   STMFD   (sp)!,{r3-r9}    ; Stack registers
�   LDR     r0,[r1,#8]
�$          ; "Button event = %&0"
�   BL      checkctrl
�B   LDRNE   r0,[r1,#8]       ; get buttons if ctrl not pressed�
�:   TSTNE   r0,#&40          ; �is this a select drag ?
�9   BEQ     __z4_exit            ; if either then exit
�;    SWI     &104
�%          ; "Checking drag is ok"
(   LDR     r3,[r1,#12]      ; window
&   LDR     r4,[r1,#16]      ; icon
   BL      isdragok
&   CMP     r0,#0
0   BEQ     __z4_exit
:.__z4_isdrag
D    LDR     r2,[r12,#`window]
N   MVN     r3,#� -1
X   MOV     r0,#19
b:   SWI     "XWimp_SendMessage"  ; find the task handle
l   BVS     __z4_exit
v4   MOV     r6,r2                ; r6=task handle
�7   MOV     r8,#0                ; r8=pointer to rma
�A   MOV     r7,#0                ; r7=length of area (0 bytes)
�B   ADR     r2,`textfile         ; large text file icon to drag
�   BL      setdrag
�   BL      addline
�;    SWI     &104
�0          ; "Is one of our drag requests!!!"
�   MOV     r0,#1
�"   STR     r0,[r12,#`dragging]
�"   STR     r8,[r12,#`saveaddr]
�!   STR     r7,[r12,#`savelen]
�4          ; "Data is length %r7, containing %$8"
�   B       __z4_noaction
.__z4_noaction
   MOV     r0,#0
=   LDMFD   (sp)!,{r3-r9}              ; Restore registers
 <   LDMFD   (sp)!,{r1-r2,pc}           ; Return from call
*.__z4_exit
4   MOV     r0,#6
>=   LDMFD   (sp)!,{r3-r9}              ; Restore registers
H<   LDMFD   (sp)!,{r1-r2,pc}           ; Return from call
R:
\.`textfile
f   EQUS    "File_FFF"+�0
p.`smallfile
z   EQUS    "Small_FFF"+�0
�   ALIGN
�:
�; set the drag icon
�.setdrag
�>   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
�B   CMP     r8,#0                ; is the current pointer set ?
�G   SWINE   "DragASprite_Stop"   ; if not then stop the current drag
� �LADD("  ",1,12,`dragbox)
�$   SWI     "Wimp_GetPointerInfo"
�   LDMIA   r1,{r0-r1}
�>   SUB     r0,r0,#34            ; x0=x-34 (� width of box)
�?   SUB     r1,r1,#34            ; y0=y-34 (� height of box)
�=   ADD     r2,r0,#34*2          ; x1=x0+64 (width of box)
>   ADD     r3,r1,#34*2          ; y1=y0+64 (height of box)
 �LADD("  ",5,12,`dragbox)
C   STMIA   r5,{r0-r3}           ; store drag box in block in WS
$4   LDR     r2,[sp,#8]           ; r2=sprite name
.J   MOV     r0,#%11000101        ; centre, constrain pointer, do shadow
8:   MOV     r1,#1                ; use Wimp sprite area
B8   MOV     r3,r5                ; r3=dragbox pointer
L"   SWI     "DragASprite_Start"
V          ; "Starting drag"
`?   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
j:
t	.wait
~>   STMFD   (sp)!,{r0-r1,link}            ; Stack registers
�%   SWI     "OS_ReadMonotonicTime"
�5   ADD     r1,r0,#5         ; r1=time now + delay
�.__z5_loop
�%   SWI     "OS_ReadMonotonicTime"
�:   CMP     r0,r1            ; have we exceeded delay ?
�@   BLT     __z5_loop            ; if not then keep checking�
�?   LDMFD   (sp)!,{r0-r1,pc}              ; Return from call
�:
�6; Add a line from the icon pointed to by the block
�.addline
�>   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
�   LDR     r0,[r12,#`str]
          ; r0=string

E   BL      lenctrl                       ; how long is the string
<          ; "Checking length = %r1, current block = %&8"
&;    �     "String located at %&0"
(A;    LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
2;
<G   CMP     r8,#0                         ; is this the first call ?
FF   �Q   r0,#6                         ; if so then claim new block
PB   MOVNE   r0,#13                        ; otherwise extend it
Z   MOVNE   r2,r8
dH   MOV     r3,r1                         ; r3=amount to claim/extend
nD   ADD     r3,r1,#1                      ; add extra byte for LF
x;   SWI     "OS_Module"                   ; claim/extend
�B   MOV     r8,r2                         ; r8=new area pointer
�F   ADD     r1,r2,r7                      ; r2=end of previous area
�   LDR     r0,[r12,#`str]
�,          ; r0=pointer to string to copy
�#          ; "Moving %&0 to %&1"
�F   BL      movectrl                      ; copy it to the new area
�G   ADD     r7,r7,r3                      ; increment amount to copy
�H   MOV     r0,#10                        ; LF to add to end of line!
�A   SUB     r1,r7,#1                      ; store as last byte
�B   STRB    r0,[r8,r1]                    ; and store in memory
�?   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
�:
�.isdragdone
>   STMFD   (sp)!,{r3-r9}                 ; Stack registers
"   LDR     r0,[r12,#`dragging]
   CMP     r0,#1
"   CMPNE   r0,#3
,   BNE     __z6_exit
6-          ; "%c04Drag done, in state %r0"
@!   SWI     "DragASprite_Stop"
J$   SWI     "Wimp_GetPointerInfo"
T"   LDMIA   r1,{r2,r3,r4,r5,r6}
^          ; "%R"
h*   STR     r5,[r1,#20]      ; store mx
r*   STR     r6,[r1,#24]      ; store my
|*   STR     r2,[r1,#28]      ; store mw
�*   STR     r3,[r1,#32]      ; store mi
�.   MOV     r2,#56           ; block length
�$   MOV     r3,#0            ; to
�%   MOV     r4,#0            ; ref
�%   MOV     r5,#0            ; ref
�)   MOV     r6,#1            ; message
�0   STMIA   r1,{r2-r6}       ; store in block
�=   ADR     r0,`estlen       ; address of estimated length
�   LDMIA   r0,{r2-r6}
�   ADD     r0,r1,#36
�1   STMIA   r0,{r2-r6}       ; copy into block
�9   MOV     r0,#18           ; send recorded delivery�
�7   LDR     r2,[r1,#20]      ; get window to send to
5   LDR     r3,[r1,#24]      ; get icon to send to
           ; "Sending to %&2"
"   SWI     "XWimp_SendMessage"
&7   MOVVS   r0,#0            ; not dragging if error
0J   MOVVC   r0,#2            ; if no error then on to save data message
:"   STR     r0,[r12,#`dragging]
D(          ; "Message sent, ok = %r0"
N.__z6_noaction
X   MOV     r0,#0
b?   LDMFD   (sp)!,{r1-r9,pc}              ; Return from call
l.__z6_exit
v   MOV     r0,#7
�?   LDMFD   (sp)!,{r1-r9,pc}              ; Return from call
�:
�.`estlen
�!   EQUD    -1 ; data not safe
�.`texttype
�   EQUD    &FFF
�.`savename
�   EQUS    "Icontext"+�0
�:
�.checknullevent
�"   LDR     r2,[r12,#`dragging]
�-          ; "%c04%c30Current state = %r2"
�   CMP     r2,#1
   BEQ     isnullevent
   CMP     r2,#3
D   LDMNEFD (sp)!,{r1-r2,pc}         ; return if not a small drag
 9   STMFD   (sp)!,{r3-r9}            ; Stack registers
* �LADD("  ",1,12,`ptrblock)
4$   SWI     "Wimp_GetPointerInfo"
>    LDR     r0,[r12,#`mouseb]
H   TST     r0,#4
RP   BEQ     __z7_dropped                 ; if you drop, but still hold adjust
\2   TST     r0,#1                    ; adjust ?
fH   BNE     __z7_exit                    ; if still pressed then exit
p   BL      wait
z"   LDR     r8,[r12,#`saveaddr]
�           ; get save address
�<   ADR     r2,`textfile             ; swap back to biggy
�   BL      setdrag
�   MOV     r0,#1
�"   STR     r0,[r12,#`dragging]
�   MOV     r0,#0
�.__z7_exit
�   LDMFD   (sp)!,{r3-r9}
�:   LDMFD   (sp)!,{r1-r2,pc}         ; Return from call
�.__z7_dropped
�   LDMFD   (sp)!,{r3-r9}
�   MOV     r0,#0
�   B       isdragdone
:
.isnullevent
9   STMFD   (sp)!,{r3-r9}            ; Stack registers
$#   STR     r1,[r12,#`userblock]
. �LADD("  ",1,12,`ptrblock)
8$   SWI     "Wimp_GetPointerInfo"
B    LDR     r0,[r12,#`mouseb]
L2   TST     r0,#1                    ; adjust ?
V   BEQ     __z8_exit
`    LDR     r3,[r12,#`mousew]
j    LDR     r4,[r12,#`mousei]
t   BL      isdragok
~E   CMP     r0,#0                    ; is it a valid icon to add ?
�   BEQ     __z8_exit
�B   MOV     r0,#5                    ; read current task handle
�!   SWI     "Wimp_ReadSysInfo"
�9   MOV     r9,r0                    ; r9=current task
�"; read task handle we are over
�#   LDR     r1,[r12,#`userblock]
�   MOV     r2,r3
�   MOV     r3,r4
�   MOV     r0,#19
�:   SWI     "XWimp_SendMessage"  ; find the task handle
�E          ; �4+"%ICurrent = %&9, over = %&2, win = %&3, icon=%&4"
�>   CMP     r2,r9                ; are they the same task ?
Q   BEQ     __z8_gotarea             ; if they are then `str is in right place

6   MOV     r0,r2                ; r0=source (over)
   LDR     r1,[r12,#`str]
(          ; r1=source data (in over)
(7   MOV     r2,r9                ; r2=dest (current)
2#   LDR     r3,[r12,#`userblock]
<8          ; r3=dest data (in current - users block!)
F/   MOV     r4,#256              ; r4=length
P;          ; "Move from T%&0 to T%&2, from A%&1 to A%&3"
Z#   SWI     "Wimp_TransferBlock"
d   MOV     r0,#0
nQ   STRB    r0,[r3,#255]         ; add a terminator in case the string is long
x   STR     r3,[r12,#`str]
�:          ; store in block so that addline can find it
�.__z8_gotarea
�   LDR     r3,[r12,#`str]
�(          ; "Is one of ours, is %$3"
�!   LDR     r7,[r12,#`savelen]
�"   LDR     r8,[r12,#`saveaddr]
�$          ; "Currently says %$8"
�   BL      addline
�"   STR     r8,[r12,#`saveaddr]
�!   STR     r7,[r12,#`savelen]
� �LADR("  ",2,`smallfile)
�   BL      setdrag
�   MOV     r0,#3
"   STR     r0,[r12,#`dragging]
0          ; mark as currently dragging small
.__z8_exit
"   MOV     r0,#0
,@   LDMFD   (sp)!,{r3-r9}                 ; Restore registers
6?   LDMFD   (sp)!,{r1-r2,pc}              ; Return from call
@:
J,          ; Installing library 'Strings'
T:
^0          ; Library routine Strings.movectrl
h
.movectrl
r; > r0=input string
|;   r1=ouput buffer
�; < __z9_r1=$r0
�$   STMFD   (sp)!,{r0-r1,r5,link}
�.__z9_loop
�   LDRB    r5,[r0],#1
�   STRB    r5,[r1],#1
�   CMP     r5,#31
�   BGT     __z9_loop
�#   LDMFD   (sp)!,{r0-r1,r5,pc}^
�:
�:
�/          ; Library routine Strings.lenctrl
�.lenctrl
�; > r0=input string
; < r1=�(r0)
   STMFD   (sp)!,{r2,link}
   MOV     r1,#0
&.__z10_loop
0   LDRB    r2,[r0,r1]
:   ADD     r1,r1,#1
D   CMP     r2,#32
N   BGE     __z10_loop
X   SUB     r1,r1,#1
b   LDMFD   (sp)!,{r2,pc}^
l:
v&          ; Library 'Strings' ends
�]
� � **** 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 *****
� *Run <TextCopy$Dir>.TextCopy
��
�:
�:
!� **** Filing procedures ****
:
� �patch_loadfile
 
codelen=0
*� MC% &1400
4$endofcode=codelen+&0:max=codelen
>L%=endofcode
��
�:
�� �patch_savefile
�&outfile$="<TextCopy$Dir>.TextCopy"
�1�("Save "+outfile$+" "+�~MC%+" "+�~(max+MC%))
�$�("Settype "+outfile$+" Module")
�patchdir$="<TextCopy$Dir>"
�
:
� **** Error Handler ****
$:
.��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
�	 n+=1
�

=n
:
(� **** Long ADR macro procedure ****
(:
2@� DESC. : ADR equivalent for long address ranges, in 2 insts
<C� ENTRY : cond$ = two char string, containing the ARM condition
F�         reg% = 0..15
P+�         pointer% = long range pointer
ZB� COMM. : pass% = OPT variable in the assembler FOR..NEXT loop
d-�         Can only handle 64 KByte ranges
nݤLADR(cond$,reg%,pointer%)
x!� 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)
��
�, op1%=(cc%<<28)+&024F0000+(reg%<<12)+lo%
< op2%=(cc%<<28)+&02400C00+(reg%<<16)+(reg%<<12)+(hi%>>8)
�
$[OPT pass%:EQUD op1%:EQUD op2%:]
"=0
,:
6*� **** Long MOV macro instruction ****
@:
JݤLMOV(cond$,reg,value)
T'� cond$="" � cond$="  " �cond$="AL"
^9cond=(�"EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)-1)/2
h&mov=(&3A<<20)+(reg<<12)+(cond<<28)
r0add=(&28<<20)+(reg<<12)+(reg<<16)+(cond<<28)
|shift=0
��
� ȕ (value � 3)=0
�  shift+=1:value=value �4
� �
�* xshift=16-shift:� xshift=16 �xshift=0
� � mov<>0 �
�5  [OPT pass%:EQUD mov+(xshift<<8)+(value � 255):]
�  mov=0
� �
�5  [OPT pass%:EQUD add+(xshift<<8)+(value � 255):]
� �
� value=value �256:shift+=4
��value=0
 =0
 :
 *� **** Long ADD macro instruction ****
 &:
 0!ݤLADD(cond$,reg1,reg2,value)
 :'� cond$="" � cond$="  " �cond$="AL"
 D9cond=(�"EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)-1)/2
 N3add1=(&28<<20)+(reg1<<12)+(reg2<<16)+(cond<<28)
 X3add2=(&28<<20)+(reg1<<12)+(reg1<<16)+(cond<<28)
 bshift=0
 l�
 v ȕ (value � 3)=0
 �  shift+=1:value=value �4
 � �
 �* xshift=16-shift:� xshift=16 �xshift=0
 � � 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  32 35 20 46 65 62 20 31  39 39 35 0d 00 1e 30 f4  |25 Feb 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 30 20 41 75 67 20 31  39 39 35 0d 00 28 10 ee  |20 Aug 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 26 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 44 72  61 67 42 6f 78 0d 00 5a  |re of DragBox..Z|
00000100  17 60 64 62 5f 6c 65 66  74 3d 70 74 72 3a 70 74  |.`db_left=ptr:pt|
00000110  72 2b 3d 34 0d 00 64 19  60 64 62 5f 62 6f 74 74  |r+=4..d.`db_bott|
00000120  6f 6d 3d 70 74 72 3a 70  74 72 2b 3d 34 0d 00 6e  |om=ptr:ptr+=4..n|
00000130  18 60 64 62 5f 72 69 67  68 74 3d 70 74 72 3a 70  |.`db_right=ptr:p|
00000140  74 72 2b 3d 34 0d 00 78  16 60 64 62 5f 74 6f 70  |tr+=4..x.`db_top|
00000150  3d 70 74 72 3a 70 74 72  2b 3d 34 0d 00 82 14 60  |=ptr:ptr+=4....`|
00000160  6c 65 6e 5f 44 72 61 67  42 6f 78 3d 70 74 72 0d  |len_DragBox=ptr.|
00000170  00 8c 05 3a 0d 00 96 28  70 74 72 3d 30 3a f4 20  |...:...(ptr=0:. |
00000180  53 74 61 72 74 20 73 74  72 75 63 74 75 72 65 20  |Start structure |
00000190  6f 66 20 77 6f 72 6b 73  70 61 63 65 0d 00 a0 1a  |of workspace....|
000001a0  60 66 69 6c 65 68 61 6e  64 6c 65 3d 70 74 72 3a  |`filehandle=ptr:|
000001b0  70 74 72 2b 3d 34 0d 00  aa 16 60 77 69 6e 64 6f  |ptr+=4....`windo|
000001c0  77 3d 70 74 72 3a 70 74  72 2b 3d 34 0d 00 b4 14  |w=ptr:ptr+=4....|
000001d0  60 69 63 6f 6e 3d 70 74  72 3a 70 74 72 2b 3d 34  |`icon=ptr:ptr+=4|
000001e0  0d 00 be 14 60 6c 65 66  74 3d 70 74 72 3a 70 74  |....`left=ptr:pt|
000001f0  72 2b 3d 34 0d 00 c8 16  60 62 6f 74 74 6f 6d 3d  |r+=4....`bottom=|
00000200  70 74 72 3a 70 74 72 2b  3d 34 0d 00 d2 15 60 72  |ptr:ptr+=4....`r|
00000210  69 67 68 74 3d 70 74 72  3a 70 74 72 2b 3d 34 0d  |ight=ptr:ptr+=4.|
00000220  00 dc 13 60 74 6f 70 3d  70 74 72 3a 70 74 72 2b  |...`top=ptr:ptr+|
00000230  3d 34 0d 00 e6 15 60 66  6c 61 67 73 3d 70 74 72  |=4....`flags=ptr|
00000240  3a 70 74 72 2b 3d 34 0d  00 f0 13 60 73 74 72 3d  |:ptr+=4....`str=|
00000250  70 74 72 3a 70 74 72 2b  3d 34 0d 00 fa 15 60 76  |ptr:ptr+=4....`v|
00000260  61 6c 69 64 3d 70 74 72  3a 70 74 72 2b 3d 34 0d  |alid=ptr:ptr+=4.|
00000270  01 04 16 60 6c 65 6e 67  74 68 3d 70 74 72 3a 70  |...`length=ptr:p|
00000280  74 72 2b 3d 34 0d 01 0e  19 60 65 76 65 6e 74 74  |tr+=4....`eventt|
00000290  79 70 65 3d 70 74 72 3a  70 74 72 2b 3d 34 0d 01  |ype=ptr:ptr+=4..|
000002a0  18 18 60 73 61 76 65 61  64 64 72 3d 70 74 72 3a  |..`saveaddr=ptr:|
000002b0  70 74 72 2b 3d 34 0d 01  22 17 60 73 61 76 65 6c  |ptr+=4..".`savel|
000002c0  65 6e 3d 70 74 72 3a 70  74 72 2b 3d 34 0d 01 2c  |en=ptr:ptr+=4..,|
000002d0  22 60 64 72 61 67 62 6f  78 3d 70 74 72 3a 70 74  |"`dragbox=ptr:pt|
000002e0  72 2b 3d 60 6c 65 6e 5f  44 72 61 67 42 6f 78 0d  |r+=`len_DragBox.|
000002f0  01 36 19 60 75 73 65 72  62 6c 6f 63 6b 3d 70 74  |.6.`userblock=pt|
00000300  72 3a 70 74 72 2b 3d 34  0d 01 40 18 60 70 74 72  |r:ptr+=4..@.`ptr|
00000310  62 6c 6f 63 6b 3d 70 74  72 3a 70 74 72 2b 3d 34  |block=ptr:ptr+=4|
00000320  0d 01 4a 16 60 6d 6f 75  73 65 79 3d 70 74 72 3a  |..J.`mousey=ptr:|
00000330  70 74 72 2b 3d 34 0d 01  54 16 60 6d 6f 75 73 65  |ptr+=4..T.`mouse|
00000340  62 3d 70 74 72 3a 70 74  72 2b 3d 34 0d 01 5e 16  |b=ptr:ptr+=4..^.|
00000350  60 6d 6f 75 73 65 77 3d  70 74 72 3a 70 74 72 2b  |`mousew=ptr:ptr+|
00000360  3d 34 0d 01 68 16 60 6d  6f 75 73 65 69 3d 70 74  |=4..h.`mousei=pt|
00000370  72 3a 70 74 72 2b 3d 34  0d 01 72 18 60 64 72 61  |r:ptr+=4..r.`dra|
00000380  67 67 69 6e 67 3d 70 74  72 3a 70 74 72 2b 3d 34  |gging=ptr:ptr+=4|
00000390  0d 01 7c 16 60 6c 65 6e  5f 77 6f 72 6b 73 70 61  |..|.`len_workspa|
000003a0  63 65 3d 70 74 72 0d 01  86 05 3a 0d 01 90 17 73  |ce=ptr....:....s|
000003b0  70 3d 31 33 3a 6c 69 6e  6b 3d 31 34 3a 70 63 3d  |p=13:link=14:pc=|
000003c0  31 35 0d 01 9a 2f 76 62  69 74 3d 31 3c 3c 32 38  |15.../vbit=1<<28|
000003d0  3a 63 62 69 74 3d 31 3c  3c 32 39 3a 7a 62 69 74  |:cbit=1<<29:zbit|
000003e0  3d 31 3c 3c 33 30 3a 6e  62 69 74 3d 31 3c 3c 33  |=1<<30:nbit=1<<3|
000003f0  31 0d 01 a4 10 50 25 3d  26 30 3a 4f 25 3d 4d 43  |1....P%=&0:O%=MC|
00000400  25 0d 01 ae 14 e3 20 70  61 73 73 25 3d 34 20 b8  |%..... pass%=4 .|
00000410  20 36 20 88 32 0d 01 b8  22 f4 20 2a 2a 2a 2a 20  | 6 .2...". **** |
00000420  53 74 61 72 74 20 6f 66  20 6d 61 69 6e 20 63 6f  |Start of main co|
00000430  64 65 20 2a 2a 2a 2a 0d  01 c2 13 f2 70 61 74 63  |de ****.....patc|
00000440  68 5f 73 65 74 70 63 28  30 29 0d 01 cc 0e 5b 4f  |h_setpc(0)....[O|
00000450  50 54 20 70 61 73 73 25  0d 01 d6 2b 20 20 20 20  |PT pass%...+    |
00000460  20 20 20 20 20 20 3b 20  2a 2a 2a 2a 20 41 64 64  |      ; **** Add|
00000470  20 6d 6f 64 75 6c 65 20  68 65 61 64 65 72 20 2a  | module header *|
00000480  2a 2a 2a 0d 01 e0 2d 20  20 20 45 51 55 44 20 30  |***...-   EQUD 0|
00000490  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000004a0  20 20 3b 20 53 74 61 72  74 20 6f 66 66 73 65 74  |  ; Start offset|
000004b0  0d 01 ea 36 20 20 20 45  51 55 44 20 6d 6f 64 75  |...6   EQUD modu|
000004c0  6c 65 5f 69 6e 69 74 20  20 20 20 20 20 20 20 3b  |le_init        ;|
000004d0  20 49 6e 69 74 69 61 6c  69 73 61 74 69 6f 6e 20  | Initialisation |
000004e0  6f 66 66 73 65 74 0d 01  f4 34 20 20 20 45 51 55  |offset...4   EQU|
000004f0  44 20 6d 6f 64 75 6c 65  5f 66 69 6e 61 6c 20 20  |D module_final  |
00000500  20 20 20 20 20 3b 20 46  69 6e 61 6c 69 73 61 74  |     ; Finalisat|
00000510  69 6f 6e 20 6f 66 66 73  65 74 0d 01 fe 37 20 20  |ion offset...7  |
00000520  20 45 51 55 44 20 6d 6f  64 75 6c 65 5f 73 65 72  | EQUD module_ser|
00000530  76 69 63 65 20 20 20 20  20 3b 20 53 65 72 76 69  |vice     ; Servi|
00000540  63 65 20 72 65 71 75 65  73 74 20 6f 66 66 73 65  |ce request offse|
00000550  74 0d 02 08 34 20 20 20  45 51 55 44 20 6d 6f 64  |t...4   EQUD mod|
00000560  75 6c 65 5f 74 69 74 6c  65 20 20 20 20 20 20 20  |ule_title       |
00000570  3b 20 54 69 74 6c 65 20  73 74 72 69 6e 67 20 6f  |; Title string o|
00000580  66 66 73 65 74 0d 02 12  33 20 20 20 45 51 55 44  |ffset...3   EQUD|
00000590  20 6d 6f 64 75 6c 65 5f  68 65 6c 70 20 20 20 20  | module_help    |
000005a0  20 20 20 20 3b 20 48 65  6c 70 20 73 74 72 69 6e  |    ; Help strin|
000005b0  67 20 6f 66 66 73 65 74  0d 02 1c 46 20 20 20 45  |g offset...F   E|
000005c0  51 55 44 20 6d 6f 64 75  6c 65 5f 63 6f 6d 6d 61  |QUD module_comma|
000005d0  6e 64 73 20 20 20 20 3b  20 48 65 6c 70 20 61 6e  |nds    ; Help an|
000005e0  64 20 63 6f 6d 6d 61 6e  64 20 6b 65 79 77 6f 72  |d command keywor|
000005f0  64 20 74 61 62 6c 65 20  6f 66 66 73 65 74 0d 02  |d table offset..|
00000600  26 05 3a 0d 02 30 11 2e  6d 6f 64 75 6c 65 5f 74  |&.:..0..module_t|
00000610  69 74 6c 65 0d 02 3a 19  20 20 20 45 51 55 53 20  |itle..:.   EQUS |
00000620  22 54 65 78 74 43 6f 70  79 22 2b bd 30 0d 02 44  |"TextCopy"+.0..D|
00000630  0c 20 20 20 41 4c 49 47  4e 0d 02 4e 05 3a 0d 02  |.   ALIGN..N.:..|
00000640  58 10 2e 6d 6f 64 75 6c  65 5f 68 65 6c 70 0d 02  |X..module_help..|
00000650  62 46 20 20 20 45 51 55  53 20 22 54 65 78 74 20  |bF   EQUS "Text |
00000660  43 6f 70 79 22 2b bd 39  2b 22 31 2e 31 31 20 28  |Copy"+.9+"1.11 (|
00000670  22 2b c1 91 24 2c 35 2c  31 31 29 2b 22 29 20 a9  |"+..$,5,11)+") .|
00000680  20 4a 75 73 74 69 6e 20  46 6c 65 74 63 68 65 72  | Justin Fletcher|
00000690  22 2b bd 30 0d 02 6c 0c  20 20 20 41 4c 49 47 4e  |"+.0..l.   ALIGN|
000006a0  0d 02 76 05 3a 0d 02 80  13 2e 6d 6f 64 75 6c 65  |..v.:.....module|
000006b0  5f 73 65 72 76 69 63 65  0d 02 8a 18 20 20 20 4c  |_service....   L|
000006c0  44 52 20 20 20 20 20 72  31 32 2c 5b 72 31 32 5d  |DR     r12,[r12]|
000006d0  0d 02 94 16 20 20 20 43  4d 50 20 20 20 20 20 72  |....   CMP     r|
000006e0  31 2c 23 26 38 37 0d 02  9e 23 20 20 20 42 45 51  |1,#&87...#   BEQ|
000006f0  20 20 20 20 20 6d 6f 64  5f 73 76 63 5f 6e 65 77  |     mod_svc_new|
00000700  66 69 6c 74 65 72 6d 67  72 0d 02 a8 14 2e 5f 6d  |filtermgr....._m|
00000710  6f 64 5f 73 76 63 5f 72  65 74 75 72 6e 0d 02 b2  |od_svc_return...|
00000720  16 20 20 20 4d 4f 56 53  20 20 20 20 70 63 2c 6c  |.   MOVS    pc,l|
00000730  69 6e 6b 0d 02 bc 05 3a  0d 02 c6 19 2e 6d 6f 64  |ink....:.....mod|
00000740  5f 73 76 63 5f 6e 65 77  66 69 6c 74 65 72 6d 67  |_svc_newfiltermg|
00000750  72 0d 02 d0 37 20 20 20  53 54 4d 46 44 20 20 20  |r...7   STMFD   |
00000760  28 73 70 29 21 2c 7b 72  30 2d 72 34 2c 6c 69 6e  |(sp)!,{r0-r4,lin|
00000770  6b 7d 20 20 20 20 20 3b  20 53 74 61 63 6b 20 72  |k}     ; Stack r|
00000780  65 67 69 73 74 65 72 73  0d 02 da 21 20 20 20 42  |egisters...!   B|
00000790  4c 20 20 20 20 20 20 6d  6f 64 5f 73 65 74 5f 50  |L      mod_set_P|
000007a0  6f 73 74 46 69 6c 74 65  72 0d 02 e4 2a 20 20 20  |ostFilter...*   |
000007b0  53 57 49 20 20 20 20 20  22 46 69 6c 74 65 72 5f  |SWI     "Filter_|
000007c0  52 65 67 69 73 74 65 72  50 6f 73 74 46 69 6c 74  |RegisterPostFilt|
000007d0  65 72 22 0d 02 ee 21 20  20 20 4c 44 4d 46 44 20  |er"...!   LDMFD |
000007e0  20 20 28 73 70 29 21 2c  7b 72 30 2d 72 34 2c 6c  |  (sp)!,{r0-r4,l|
000007f0  69 6e 6b 7d 0d 02 f8 1e  20 20 20 42 20 20 20 20  |ink}....   B    |
00000800  20 20 20 5f 6d 6f 64 5f  73 76 63 5f 72 65 74 75  |   _mod_svc_retu|
00000810  72 6e 0d 03 02 05 3a 0d  03 0c 10 2e 6d 6f 64 75  |rn....:.....modu|
00000820  6c 65 5f 69 6e 69 74 0d  03 16 37 20 20 20 53 54  |le_init...7   ST|
00000830  4d 46 44 20 20 20 28 73  70 29 21 2c 7b 72 30 2d  |MFD   (sp)!,{r0-|
00000840  72 34 2c 6c 69 6e 6b 7d  20 20 20 20 20 3b 20 53  |r4,link}     ; S|
00000850  74 61 63 6b 20 72 65 67  69 73 74 65 72 73 0d 03  |tack registers..|
00000860  20 14 20 20 20 4d 4f 56  20 20 20 20 20 72 30 2c  | .   MOV     r0,|
00000870  23 36 0d 03 2a 1f 20 a4  4c 4d 4f 56 28 22 22 2c  |#6..*. .LMOV("",|
00000880  33 2c 60 6c 65 6e 5f 77  6f 72 6b 73 70 61 63 65  |3,`len_workspace|
00000890  29 0d 03 34 3f 20 20 20  53 57 49 20 20 20 20 20  |)..4?   SWI     |
000008a0  22 58 4f 53 5f 4d 6f 64  75 6c 65 22 20 20 20 20  |"XOS_Module"    |
000008b0  20 20 20 20 20 20 20 3b  20 43 6c 61 69 6d 20 70  |       ; Claim p|
000008c0  72 69 76 61 74 65 20 77  6f 72 6b 73 70 61 63 65  |rivate workspace|
000008d0  0d 03 3e 34 20 20 20 41  44 44 56 53 20 20 20 73  |..>4   ADDVS   s|
000008e0  70 2c 73 70 2c 23 34 20  20 20 20 20 20 20 20 20  |p,sp,#4         |
000008f0  20 20 20 20 20 20 3b 20  72 65 74 75 72 6e 20 65  |      ; return e|
00000900  72 72 6f 72 0d 03 48 34  20 20 20 4c 44 4d 56 53  |rror..H4   LDMVS|
00000910  46 44 20 28 73 70 29 21  2c 7b 72 31 2d 72 34 2c  |FD (sp)!,{r1-r4,|
00000920  70 63 7d 20 20 20 20 20  20 20 3b 20 72 65 74 75  |pc}       ; retu|
00000930  72 6e 20 65 72 72 6f 72  0d 03 52 3d 20 20 20 53  |rn error..R=   S|
00000940  54 52 20 20 20 20 20 72  32 2c 5b 72 31 32 5d 20  |TR     r2,[r12] |
00000950  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00000960  73 74 6f 72 65 20 69 6e  20 70 72 69 76 61 74 65  |store in private|
00000970  20 77 6f 72 64 0d 03 5c  31 20 20 20 4d 4f 56 20  | word..\1   MOV |
00000980  20 20 20 20 72 31 32 2c  72 32 20 20 20 20 20 20  |    r12,r2      |
00000990  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 31 32  |           ; r12|
000009a0  3d 73 70 61 63 65 0d 03  66 21 20 20 20 42 4c 20  |=space..f!   BL |
000009b0  20 20 20 20 20 6d 6f 64  5f 73 65 74 5f 50 6f 73  |     mod_set_Pos|
000009c0  74 46 69 6c 74 65 72 0d  03 70 2a 20 20 20 53 57  |tFilter..p*   SW|
000009d0  49 20 20 20 20 20 22 46  69 6c 74 65 72 5f 52 65  |I     "Filter_Re|
000009e0  67 69 73 74 65 72 50 6f  73 74 46 69 6c 74 65 72  |gisterPostFilter|
000009f0  22 0d 03 7a 39 20 20 20  4c 44 4d 46 44 20 20 20  |"..z9   LDMFD   |
00000a00  28 73 70 29 21 2c 7b 72  30 2d 72 34 2c 6c 69 6e  |(sp)!,{r0-r4,lin|
00000a10  6b 7d 20 20 20 20 20 3b  20 72 65 73 74 6f 72 65  |k}     ; restore|
00000a20  20 72 65 67 69 73 74 65  72 73 0d 03 84 17 20 20  | registers....  |
00000a30  20 42 20 20 20 20 20 20  20 49 6e 69 74 43 6f 64  | B       InitCod|
00000a40  65 0d 03 8e 05 3a 0d 03  98 11 2e 6d 6f 64 75 6c  |e....:.....modul|
00000a50  65 5f 66 69 6e 61 6c 0d  03 a2 37 20 20 20 53 54  |e_final...7   ST|
00000a60  4d 46 44 20 20 20 28 73  70 29 21 2c 7b 72 30 2d  |MFD   (sp)!,{r0-|
00000a70  72 34 2c 72 31 32 2c 6c  69 6e 6b 7d 20 3b 20 53  |r4,r12,link} ; S|
00000a80  74 61 63 6b 20 72 65 67  69 73 74 65 72 73 0d 03  |tack registers..|
00000a90  ac 18 20 20 20 4c 44 52  20 20 20 20 20 72 31 32  |..   LDR     r12|
00000aa0  2c 5b 72 31 32 5d 0d 03  b6 21 20 20 20 42 4c 20  |,[r12]...!   BL |
00000ab0  20 20 20 20 20 6d 6f 64  5f 73 65 74 5f 50 6f 73  |     mod_set_Pos|
00000ac0  74 46 69 6c 74 65 72 0d  03 c0 2c 20 20 20 53 57  |tFilter...,   SW|
00000ad0  49 20 20 20 20 20 22 46  69 6c 74 65 72 5f 44 65  |I     "Filter_De|
00000ae0  52 65 67 69 73 74 65 72  50 6f 73 74 46 69 6c 74  |RegisterPostFilt|
00000af0  65 72 22 0d 03 ca 14 20  20 20 4d 4f 56 20 20 20  |er"....   MOV   |
00000b00  20 20 72 30 2c 23 37 0d  03 d4 15 20 20 20 4d 4f  |  r0,#7....   MO|
00000b10  56 20 20 20 20 20 72 32  2c 72 31 32 0d 03 de 39  |V     r2,r12...9|
00000b20  20 20 20 53 57 49 20 20  20 20 20 22 58 4f 53 5f  |   SWI     "XOS_|
00000b30  4d 6f 64 75 6c 65 22 20  20 20 20 20 20 20 20 20  |Module"         |
00000b40  20 20 3b 20 52 65 6c 65  61 73 65 20 77 6f 72 6b  |  ; Release work|
00000b50  73 70 61 63 65 0d 03 e8  17 20 20 20 41 44 44 56  |space....   ADDV|
00000b60  53 20 20 20 73 70 2c 73  70 2c 23 34 0d 03 f2 37  |S   sp,sp,#4...7|
00000b70  20 20 20 4c 44 4d 56 53  46 44 20 28 73 70 29 21  |   LDMVSFD (sp)!|
00000b80  2c 7b 72 31 2d 72 34 2c  72 31 32 2c 70 63 7d 20  |,{r1-r4,r12,pc} |
00000b90  20 20 3b 20 52 65 74 75  72 6e 20 69 66 20 65 72  |  ; Return if er|
00000ba0  72 6f 72 0d 03 fc 2e 20  20 20 4c 44 4d 46 44 20  |ror....   LDMFD |
00000bb0  20 20 28 73 70 29 21 2c  7b 72 30 2d 72 34 2c 72  |  (sp)!,{r0-r4,r|
00000bc0  31 32 2c 70 63 7d 20 20  20 3b 20 52 65 74 75 72  |12,pc}   ; Retur|
00000bd0  6e 0d 04 06 05 3a 0d 04  10 21 3b 20 2a 2a 2a 2a  |n....:...!; ****|
00000be0  2a 20 4d 6f 64 75 6c 65  20 63 6f 6d 6d 61 6e 64  |* Module command|
00000bf0  73 20 74 61 62 6c 65 0d  04 1a 14 2e 6d 6f 64 75  |s table.....modu|
00000c00  6c 65 5f 63 6f 6d 6d 61  6e 64 73 0d 04 24 2d 20  |le_commands..$- |
00000c10  20 20 45 51 55 53 20 22  54 65 78 74 43 6f 70 79  |  EQUS "TextCopy|
00000c20  22 20 20 20 20 20 20 20  20 20 3b 20 43 6f 6d 6d  |"         ; Comm|
00000c30  61 6e 64 20 6e 61 6d 65  0d 04 2e 13 20 20 20 45  |and name....   E|
00000c40  51 55 42 20 30 3a 41 4c  49 47 4e 0d 04 38 2d 20  |QUB 0:ALIGN..8- |
00000c50  20 20 45 51 55 44 20 30  20 20 20 20 20 20 20 20  |  EQUD 0        |
00000c60  20 20 20 20 20 20 20 20  20 20 3b 20 43 6f 64 65  |          ; Code|
00000c70  20 74 6f 20 63 61 6c 6c  0d 04 42 26 20 20 20 45  | to call..B&   E|
00000c80  51 55 44 20 26 30 20 20  20 20 20 20 20 20 20 20  |QUD &0          |
00000c90  20 20 20 20 20 20 20 3b  20 46 6c 61 67 73 0d 04  |       ; Flags..|
00000ca0  4c 2f 20 20 20 45 51 55  44 20 30 20 20 20 20 20  |L/   EQUD 0     |
00000cb0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 53  |             ; S|
00000cc0  79 6e 74 61 78 20 70 6f  69 6e 74 65 72 0d 04 56  |yntax pointer..V|
00000cd0  2d 20 20 20 45 51 55 44  20 68 65 6c 70 5f 74 65  |-   EQUD help_te|
00000ce0  78 74 63 6f 70 79 20 20  20 20 20 20 3b 20 48 65  |xtcopy      ; He|
00000cf0  6c 70 20 70 6f 69 6e 74  65 72 0d 04 60 0d 20 20  |lp pointer..`.  |
00000d00  20 45 51 55 42 20 30 0d  04 6a 0c 20 20 20 41 4c  | EQUB 0..j.   AL|
00000d10  49 47 4e 0d 04 74 05 3a  0d 04 7e 24 3b 20 2a 2a  |IGN..t.:..~$; **|
00000d20  2a 2a 2a 20 48 65 6c 70  20 61 6e 64 20 53 79 6e  |*** Help and Syn|
00000d30  74 61 78 20 6d 65 73 73  61 67 65 73 0d 04 88 12  |tax messages....|
00000d40  2e 68 65 6c 70 5f 74 65  78 74 63 6f 70 79 0d 04  |.help_textcopy..|
00000d50  92 51 20 20 20 45 51 55  53 20 22 54 68 65 20 54  |.Q   EQUS "The T|
00000d60  65 78 74 43 6f 70 79 20  61 6c 6c 6f 77 73 20 79  |extCopy allows y|
00000d70  6f 75 20 74 6f 20 64 72  61 67 20 74 65 78 74 20  |ou to drag text |
00000d80  66 69 6c 65 73 20 64 69  72 65 63 74 6c 79 20 6f  |files directly o|
00000d90  6e 20 74 6f 20 77 72 69  74 61 62 6c 65 20 22 0d  |n to writable ".|
00000da0  04 9c 4c 20 20 20 45 51  55 53 20 22 69 63 6f 6e  |..L   EQUS "icon|
00000db0  73 2e 20 54 68 69 73 20  69 73 20 64 6f 6e 65 20  |s. This is done |
00000dc0  62 79 20 75 73 65 20 6f  66 20 66 69 6c 74 65 72  |by use of filter|
00000dd0  73 2c 20 73 6f 20 74 68  69 73 20 6d 61 79 20 63  |s, so this may c|
00000de0  6c 61 73 68 20 77 69 74  68 20 22 0d 04 a6 52 20  |lash with "...R |
00000df0  20 20 45 51 55 53 20 22  61 70 70 6c 69 63 61 74  |  EQUS "applicat|
00000e00  69 6f 6e 73 20 77 68 69  63 68 20 70 72 6f 63 65  |ions which proce|
00000e10  73 73 20 74 65 78 74 20  66 69 6c 65 73 20 64 72  |ss text files dr|
00000e20  61 67 67 65 64 20 6f 6e  74 6f 20 77 72 69 74 65  |agged onto write|
00000e30  61 62 6c 65 20 69 63 6f  6e 73 2e 20 22 0d 04 b0  |able icons. "...|
00000e40  4e 20 20 20 45 51 55 53  20 22 49 66 20 6d 75 6c  |N   EQUS "If mul|
00000e50  74 69 70 6c 65 20 77 72  69 74 61 62 6c 65 20 69  |tiple writable i|
00000e60  63 6f 6e 73 20 61 72 65  20 70 72 65 73 65 6e 74  |cons are present|
00000e70  2c 20 74 68 65 6e 20 74  68 65 20 74 65 78 74 20  |, then the text |
00000e80  77 69 6c 6c 20 73 70 61  6e 20 22 0d 04 ba 18 20  |will span ".... |
00000e90  20 20 45 51 55 53 20 22  74 68 65 73 65 2e 22 2b  |  EQUS "these."+|
00000ea0  bd 31 33 0d 04 c4 55 20  20 20 45 51 55 53 20 22  |.13...U   EQUS "|
00000eb0  48 6f 6c 64 69 6e 67 20  64 6f 77 6e 20 53 68 69  |Holding down Shi|
00000ec0  66 74 20 77 68 65 6e 20  64 72 61 67 67 69 6e 67  |ft when dragging|
00000ed0  20 77 69 6c 6c 20 63 6f  70 79 20 74 68 65 20 66  | will copy the f|
00000ee0  69 6c 65 6e 61 6d 65 20  69 6e 74 6f 20 74 68 65  |ilename into the|
00000ef0  20 69 63 6f 6e 2e 20 22  0d 04 ce 58 20 20 20 45  | icon. "...X   E|
00000f00  51 55 53 20 bd 31 33 2b  bd 31 33 2b 22 44 72 61  |QUS .13+.13+"Dra|
00000f10  67 67 69 6e 67 20 6f 66  20 77 72 69 74 61 62 6c  |gging of writabl|
00000f20  65 20 69 63 6f 6e 73 20  69 73 20 61 6c 73 6f 20  |e icons is also |
00000f30  70 6f 73 73 69 62 6c 65  20 66 6f 72 20 74 79 70  |possible for typ|
00000f40  65 20 31 35 20 69 63 6f  6e 73 20 61 6e 64 20 22  |e 15 icons and "|
00000f50  0d 04 d8 44 20 20 20 45  51 55 53 20 22 66 6f 72  |...D   EQUS "for|
00000f60  20 61 6c 6c 20 69 63 6f  6e 73 20 69 66 20 74 68  | all icons if th|
00000f70  65 20 41 6c 6c 57 43 44  20 6d 6f 64 75 6c 65 20  |e AllWCD module |
00000f80  69 73 20 70 72 65 73 65  6e 74 2e 22 2b bd 31 33  |is present."+.13|
00000f90  2b bd 31 33 0d 04 e2 4c  20 20 20 45 51 55 53 20  |+.13...L   EQUS |
00000fa0  22 48 6f 6c 64 69 6e 67  20 64 6f 77 6e 20 43 74  |"Holding down Ct|
00000fb0  72 6c 20 77 68 65 6e 20  64 72 61 67 67 69 6e 67  |rl when dragging|
00000fc0  20 77 69 6c 6c 20 62 79  70 61 73 73 20 74 68 65  | will bypass the|
00000fd0  20 62 6f 74 68 20 70 61  74 63 68 65 73 2e 20 22  | both patches. "|
00000fe0  0d 04 ec 0d 20 20 20 45  51 55 42 20 30 0d 04 f6  |....   EQUB 0...|
00000ff0  0c 20 20 20 41 4c 49 47  4e 0d 05 00 05 3a 0d 05  |.   ALIGN....:..|
00001000  0a 28 3b 20 2a 2a 2a 2a  2a 20 53 65 74 20 75 70  |.(; ***** Set up|
00001010  20 72 65 67 69 73 74 65  72 73 20 66 6f 72 20 66  | registers for f|
00001020  69 6c 74 65 72 73 0d 05  14 17 2e 6d 6f 64 5f 73  |ilters.....mod_s|
00001030  65 74 5f 50 6f 73 74 46  69 6c 74 65 72 0d 05 1e  |et_PostFilter...|
00001040  1b 20 20 20 53 54 4d 46  44 20 20 20 28 73 70 29  |.   STMFD   (sp)|
00001050  21 2c 7b 6c 69 6e 6b 7d  0d 05 28 14 20 20 20 4d  |!,{link}..(.   M|
00001060  4f 56 20 20 20 20 20 72  33 2c 23 30 0d 05 32 28  |OV     r3,#0..2(|
00001070  20 20 20 41 44 52 20 20  20 20 20 72 30 2c 60 6d  |   ADR     r0,`m|
00001080  6f 64 75 6c 65 5f 50 6f  73 74 46 69 6c 74 65 72  |odule_PostFilter|
00001090  4e 61 6d 65 0d 05 3c 1b  20 a4 4c 41 44 52 28 22  |Name..<. .LADR("|
000010a0  22 2c 31 2c 66 69 6c 74  65 72 63 6f 64 65 29 0d  |",1,filtercode).|
000010b0  05 46 15 20 20 20 4d 4f  56 20 20 20 20 20 72 32  |.F.   MOV     r2|
000010c0  2c 72 31 32 0d 05 50 28  20 20 20 4c 44 52 20 20  |,r12..P(   LDR  |
000010d0  20 20 20 72 34 2c 60 6d  6f 64 75 6c 65 5f 50 6f  |   r4,`module_Po|
000010e0  73 74 46 69 6c 74 65 72  4d 61 73 6b 0d 05 5a 19  |stFilterMask..Z.|
000010f0  20 20 20 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |   LDMFD   (sp)!|
00001100  2c 7b 70 63 7d 0d 05 64  05 3a 0d 05 6e 1b 2e 60  |,{pc}..d.:..n..`|
00001110  6d 6f 64 75 6c 65 5f 50  6f 73 74 46 69 6c 74 65  |module_PostFilte|
00001120  72 4d 61 73 6b 0d 05 78  24 20 20 20 45 51 55 44  |rMask..x$   EQUD|
00001130  20 20 20 20 25 30 30 30  31 31 31 31 31 31 31 31  |    %00011111111|
00001140  31 30 30 31 31 31 31 31  30 0d 05 82 1b 2e 60 6d  |100111110.....`m|
00001150  6f 64 75 6c 65 5f 50 6f  73 74 46 69 6c 74 65 72  |odule_PostFilter|
00001160  4e 61 6d 65 0d 05 8c 1d  20 20 20 45 51 55 53 20  |Name....   EQUS |
00001170  20 20 20 22 54 65 78 74  20 43 6f 70 79 22 2b bd  |   "Text Copy"+.|
00001180  30 0d 05 96 0c 20 20 20  41 4c 49 47 4e 0d 05 a0  |0....   ALIGN...|
00001190  05 3a 0d 05 aa 2e 20 20  20 20 20 20 20 20 20 20  |.:....          |
000011a0  3b 20 2a 2a 2a 2a 20 45  6e 64 20 6f 66 20 6d 6f  |; **** End of mo|
000011b0  64 75 6c 65 20 68 65 61  64 65 72 20 2a 2a 2a 2a  |dule header ****|
000011c0  0d 05 b4 05 3a 0d 05 be  0d 2e 49 6e 69 74 43 6f  |....:.....InitCo|
000011d0  64 65 0d 05 c8 1d 20 20  20 53 54 4d 46 44 20 20  |de....   STMFD  |
000011e0  28 73 70 29 21 2c 7b 72  30 2c 6c 69 6e 6b 7d 0d  |(sp)!,{r0,link}.|
000011f0  05 d2 13 20 20 20 4d 4f  56 20 20 20 20 72 30 2c  |...   MOV    r0,|
00001200  23 30 0d 05 dc 22 20 20  20 53 54 52 20 20 20 20  |#0..."   STR    |
00001210  20 72 30 2c 5b 72 31 32  2c 23 60 64 72 61 67 67  | r0,[r12,#`dragg|
00001220  69 6e 67 5d 0d 05 e6 1b  20 20 20 4c 44 4d 46 44  |ing]....   LDMFD|
00001230  20 20 28 73 70 29 21 2c  7b 72 30 2c 70 63 7d 0d  |  (sp)!,{r0,pc}.|
00001240  05 f0 05 3a 0d 05 fa 0f  2e 66 69 6c 74 65 72 63  |...:.....filterc|
00001250  6f 64 65 0d 06 04 21 20  20 20 53 54 4d 46 44 20  |ode...!   STMFD |
00001260  20 20 28 73 70 29 21 2c  7b 72 31 2d 72 32 2c 6c  |  (sp)!,{r1-r2,l|
00001270  69 6e 6b 7d 0d 06 0e 14  20 20 20 43 4d 50 20 20  |ink}....   CMP  |
00001280  20 20 20 72 30 2c 23 30  0d 06 18 1d 20 20 20 42  |   r0,#0....   B|
00001290  45 51 20 20 20 20 20 63  68 65 63 6b 6e 75 6c 6c  |EQ     checknull|
000012a0  65 76 65 6e 74 0d 06 22  14 20 20 20 43 4d 50 20  |event..".   CMP |
000012b0  20 20 20 20 72 30 2c 23  36 0d 06 2c 1b 20 20 20  |    r0,#6..,.   |
000012c0  42 45 51 20 20 20 20 20  69 73 6d 6f 75 73 65 63  |BEQ     ismousec|
000012d0  6c 69 63 6b 0d 06 36 14  20 20 20 43 4d 50 20 20  |lick..6.   CMP  |
000012e0  20 20 20 72 30 2c 23 37  0d 06 40 19 20 20 20 42  |   r0,#7..@.   B|
000012f0  45 51 20 20 20 20 20 69  73 64 72 61 67 64 6f 6e  |EQ     isdragdon|
00001300  65 0d 06 4a 15 20 20 20  43 4d 50 20 20 20 20 20  |e..J.   CMP     |
00001310  72 30 2c 23 31 37 0d 06  54 15 20 20 20 43 4d 50  |r0,#17..T.   CMP|
00001320  4e 45 20 20 20 72 30 2c  23 31 38 0d 06 5e 18 20  |NE   r0,#18..^. |
00001330  20 20 42 45 51 20 20 20  20 20 69 73 6d 65 73 73  |  BEQ     ismess|
00001340  61 67 65 0d 06 68 15 20  20 20 43 4d 50 20 20 20  |age..h.   CMP   |
00001350  20 20 72 30 2c 23 31 39  0d 06 72 1b 20 20 20 42  |  r0,#19..r.   B|
00001360  45 51 20 20 20 20 20 69  73 6d 65 73 73 61 67 65  |EQ     ismessage|
00001370  61 63 6b 0d 06 7c 1f 20  20 20 4c 44 4d 46 44 20  |ack..|.   LDMFD |
00001380  20 20 28 73 70 29 21 2c  7b 72 31 2d 72 32 2c 70  |  (sp)!,{r1-r2,p|
00001390  63 7d 0d 06 86 05 3a 0d  06 90 11 2e 69 73 6d 65  |c}....:.....isme|
000013a0  73 73 61 67 65 61 63 6b  0d 06 9a 23 20 20 20 53  |ssageack...#   S|
000013b0  54 52 20 20 20 20 20 72  30 2c 5b 72 31 32 2c 23  |TR     r0,[r12,#|
000013c0  60 65 76 65 6e 74 74 79  70 65 5d 0d 06 a4 26 20  |`eventtype]...& |
000013d0  20 20 20 20 20 20 20 20  20 3b 20 22 25 63 30 34  |         ; "%c04|
000013e0  25 63 33 30 41 63 6b 6e  6f 77 6c 65 64 67 65 64  |%c30Acknowledged|
000013f0  22 0d 06 ae 1a 20 20 20  4c 44 52 20 20 20 20 20  |"....   LDR     |
00001400  72 32 2c 5b 72 31 2c 23  31 36 5d 0d 06 b8 14 20  |r2,[r1,#16].... |
00001410  20 20 43 4d 50 20 20 20  20 20 72 32 2c 23 31 0d  |  CMP     r2,#1.|
00001420  06 c2 4d 20 20 20 42 45  51 20 20 20 20 20 69 73  |..M   BEQ     is|
00001430  4e 6f 44 61 74 61 53 61  76 65 41 63 6b 20 20 20  |NoDataSaveAck   |
00001440  20 20 20 20 20 20 20 20  3b 20 4e 6f 62 6f 64 79  |        ; Nobody|
00001450  20 6c 6f 76 65 73 20 6d  65 2c 20 73 6f 20 74 72  | loves me, so tr|
00001460  61 6e 73 66 65 72 20 64  69 65 73 8c 0d 06 cc 18  |ansfer dies.....|
00001470  20 20 20 42 20 20 20 20  20 20 20 65 78 69 74 65  |   B       exite|
00001480  76 65 6e 74 0d 06 d6 0e  2e 69 73 6d 65 73 73 61  |vent.....ismessa|
00001490  67 65 0d 06 e0 23 20 20  20 53 54 52 20 20 20 20  |ge...#   STR    |
000014a0  20 72 30 2c 5b 72 31 32  2c 23 60 65 76 65 6e 74  | r0,[r12,#`event|
000014b0  74 79 70 65 5d 0d 06 ea  1a 20 20 20 4c 44 52 20  |type]....   LDR |
000014c0  20 20 20 20 72 32 2c 5b  72 31 2c 23 31 36 5d 0d  |    r2,[r1,#16].|
000014d0  06 f4 25 20 20 20 20 20  20 20 20 20 20 3b 20 22  |..%          ; "|
000014e0  25 63 30 34 25 63 33 30  4d 65 73 73 61 67 65 20  |%c04%c30Message |
000014f0  25 26 32 22 0d 06 fe 14  20 20 20 43 4d 50 20 20  |%&2"....   CMP  |
00001500  20 20 20 72 32 2c 23 31  0d 07 08 4f 20 20 20 42  |   r2,#1...O   B|
00001510  45 51 20 20 20 20 20 69  73 44 61 74 61 53 61 76  |EQ     isDataSav|
00001520  65 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |e               |
00001530  20 3b 20 49 6e 69 74 69  61 6c 20 6d 65 73 73 61  | ; Initial messa|
00001540  67 65 2c 20 63 61 6e 20  49 20 73 61 76 65 20 74  |ge, can I save t|
00001550  6f 20 79 6f 75 20 3f 0d  07 12 14 20 20 20 43 4d  |o you ?....   CM|
00001560  50 20 20 20 20 20 72 32  2c 23 33 0d 07 1c 49 20  |P     r2,#3...I |
00001570  20 20 42 45 51 20 20 20  20 20 69 73 44 61 74 61  |  BEQ     isData|
00001580  4c 6f 61 64 20 20 20 20  20 20 20 20 20 20 20 20  |Load            |
00001590  20 20 20 20 3b 20 50 6c  65 61 73 65 20 6c 6f 61  |    ; Please loa|
000015a0  64 20 74 68 69 73 20 64  61 74 61 20 66 72 6f 6d  |d this data from|
000015b0  20 6d 65 8c 0d 07 26 14  20 20 20 43 4d 50 20 20  | me...&.   CMP  |
000015c0  20 20 20 72 32 2c 23 32  0d 07 30 4f 20 20 20 42  |   r2,#2..0O   B|
000015d0  45 51 20 20 20 20 20 69  73 44 61 74 61 53 61 76  |EQ     isDataSav|
000015e0  65 41 63 6b 20 20 20 20  20 20 20 20 20 20 20 20  |eAck            |
000015f0  20 3b 20 49 20 77 61 6e  74 20 79 6f 75 72 20 64  | ; I want your d|
00001600  61 74 61 2c 20 67 69 76  65 20 69 74 20 74 6f 20  |ata, give it to |
00001610  6d 65 20 6e 6f 77 8c 0d  07 3a 0e 2e 65 78 69 74  |me now...:..exit|
00001620  65 76 65 6e 74 0d 07 44  23 20 20 20 4c 44 52 20  |event..D#   LDR |
00001630  20 20 20 20 72 30 2c 5b  72 31 32 2c 23 60 65 76  |    r0,[r12,#`ev|
00001640  65 6e 74 74 79 70 65 5d  0d 07 4e 1f 20 20 20 4c  |enttype]..N.   L|
00001650  44 4d 46 44 20 20 20 28  73 70 29 21 2c 7b 72 31  |DMFD   (sp)!,{r1|
00001660  2d 72 32 2c 70 63 7d 0d  07 58 05 3a 0d 07 62 12  |-r2,pc}..X.:..b.|
00001670  2e 69 73 44 61 74 61 53  61 76 65 41 63 6b 0d 07  |.isDataSaveAck..|
00001680  6c 22 20 20 20 4c 44 52  20 20 20 20 20 72 30 2c  |l"   LDR     r0,|
00001690  5b 72 31 32 2c 23 60 64  72 61 67 67 69 6e 67 5d  |[r12,#`dragging]|
000016a0  0d 07 76 14 20 20 20 43  4d 50 20 20 20 20 20 72  |..v.   CMP     r|
000016b0  30 2c 23 32 0d 07 80 18  20 20 20 42 4e 45 20 20  |0,#2....   BNE  |
000016c0  20 20 20 65 78 69 74 65  76 65 6e 74 0d 07 8a 28  |   exitevent...(|
000016d0  20 20 20 20 20 20 20 20  20 20 3b 20 22 44 61 74  |          ; "Dat|
000016e0  61 20 73 61 76 65 20 69  6e 69 74 69 61 74 65 64  |a save initiated|
000016f0  2e 2e 2e 22 0d 07 94 15  20 20 20 4d 4f 56 20 20  |..."....   MOV  |
00001700  20 20 20 72 30 2c 23 31  30 0d 07 9e 4b 20 20 20  |   r0,#10...K   |
00001710  41 44 44 20 20 20 20 20  72 31 2c 72 31 2c 23 34  |ADD     r1,r1,#4|
00001720  34 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4               |
00001730  20 20 20 20 20 20 3b 20  61 64 64 72 65 73 73 20  |      ; address |
00001740  69 6e 20 62 6c 6f 63 6b  20 6f 66 20 66 69 6c 65  |in block of file|
00001750  6e 61 6d 65 0d 07 a8 2a  20 20 20 20 20 20 20 20  |name...*        |
00001760  20 20 3b 20 22 46 69 6c  65 20 6e 61 6d 65 20 74  |  ; "File name t|
00001770  6f 20 73 61 76 65 20 61  73 20 25 24 31 22 0d 07  |o save as %$1"..|
00001780  b2 17 20 a4 4c 4d 4f 56  28 22 20 20 22 2c 32 2c  |.. .LMOV("  ",2,|
00001790  26 46 46 46 29 0d 07 bc  18 20 20 20 20 20 20 20  |&FFF)....       |
000017a0  20 20 20 3b 20 66 69 6c  65 74 79 70 65 0d 07 c6  |   ; filetype...|
000017b0  22 20 20 20 4c 44 52 20  20 20 20 20 72 34 2c 5b  |"   LDR     r4,[|
000017c0  72 31 32 2c 23 60 73 61  76 65 61 64 64 72 5d 0d  |r12,#`saveaddr].|
000017d0  07 d0 1d 20 20 20 20 20  20 20 20 20 20 3b 20 73  |...          ; s|
000017e0  74 61 72 74 20 61 64 64  72 65 73 73 0d 07 da 21  |tart address...!|
000017f0  20 20 20 4c 44 52 20 20  20 20 20 72 35 2c 5b 72  |   LDR     r5,[r|
00001800  31 32 2c 23 60 73 61 76  65 6c 65 6e 5d 0d 07 e4  |12,#`savelen]...|
00001810  16 20 20 20 20 20 20 20  20 20 20 3b 20 6c 65 6e  |.          ; len|
00001820  67 74 68 0d 07 ee 3a 20  20 20 41 44 44 20 20 20  |gth...:   ADD   |
00001830  20 20 72 35 2c 72 35 2c  72 34 20 20 20 20 20 20  |  r5,r5,r4      |
00001840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001850  3b 20 65 6e 64 20 61 64  64 72 65 73 73 0d 07 f8  |; end address...|
00001860  27 20 20 20 20 20 20 20  20 20 20 3b 20 22 53 61  |'          ; "Sa|
00001870  76 65 20 6d 65 6d 6f 72  79 20 25 26 34 20 2d 20  |ve memory %&4 - |
00001880  25 26 35 22 0d 08 02 38  20 20 20 53 57 49 20 20  |%&5"...8   SWI  |
00001890  20 20 20 22 4f 53 5f 46  69 6c 65 22 20 20 20 20  |   "OS_File"    |
000018a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000018b0  20 3b 20 73 61 76 65 20  66 69 6c 65 0d 08 0c 44  | ; save file...D|
000018c0  20 20 20 53 55 42 20 20  20 20 20 72 31 2c 72 31  |   SUB     r1,r1|
000018d0  2c 23 34 34 20 20 20 20  20 20 20 20 20 20 20 20  |,#44            |
000018e0  20 20 20 20 20 20 20 20  20 3b 20 72 65 73 74 6f  |         ; resto|
000018f0  72 65 20 62 6c 6f 63 6b  20 70 6f 69 6e 74 65 72  |re block pointer|
00001900  0d 08 16 4a 20 20 20 4d  4f 56 20 20 20 20 20 72  |...J   MOV     r|
00001910  30 2c 23 33 20 20 20 20  20 20 20 20 20 20 20 20  |0,#3            |
00001920  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 61  |             ; a|
00001930  63 6b 6e 6f 77 6c 65 64  67 65 20 73 65 6e 64 69  |cknowledge sendi|
00001940  6e 67 20 6f 66 20 64 61  74 61 0d 08 20 3d 20 20  |ng of data.. =  |
00001950  20 53 54 52 20 20 20 20  20 72 30 2c 5b 72 31 2c  | STR     r0,[r1,|
00001960  23 31 36 5d 20 20 20 20  20 20 20 20 20 20 20 20  |#16]            |
00001970  20 20 20 20 20 20 20 3b  20 73 74 6f 72 65 20 69  |       ; store i|
00001980  6e 20 62 6c 6f 63 6b 0d  08 2a 3c 20 20 20 4c 44  |n block..*<   LD|
00001990  52 20 20 20 20 20 72 30  2c 5b 72 31 2c 23 38 5d  |R     r0,[r1,#8]|
000019a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000019b0  20 20 20 20 3b 20 67 65  74 20 74 68 65 69 72 20  |    ; get their |
000019c0  72 65 66 0d 08 34 50 20  20 20 53 54 52 20 20 20  |ref..4P   STR   |
000019d0  20 20 72 30 2c 5b 72 31  2c 23 31 32 5d 20 20 20  |  r0,[r1,#12]   |
000019e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000019f0  3b 20 73 74 6f 72 65 20  69 6e 20 6f 75 72 20 72  |; store in our r|
00001a00  65 66 20 74 6f 20 6d 61  72 6b 20 61 73 20 72 65  |ef to mark as re|
00001a10  70 6c 79 0d 08 3e 40 20  20 20 4c 44 52 20 20 20  |ply..>@   LDR   |
00001a20  20 20 72 32 2c 5b 72 31  2c 23 34 5d 20 20 20 20  |  r2,[r1,#4]    |
00001a30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001a40  3b 20 74 61 73 6b 20 74  6f 20 72 65 74 75 72 6e  |; task to return|
00001a50  20 74 6f 0d 08 48 15 20  20 20 4d 4f 56 20 20 20  | to..H.   MOV   |
00001a60  20 20 72 30 2c 23 31 37  0d 08 52 3b 20 20 20 53  |  r0,#17..R;   S|
00001a70  57 49 20 20 20 20 20 22  57 69 6d 70 5f 53 65 6e  |WI     "Wimp_Sen|
00001a80  64 4d 65 73 73 61 67 65  22 20 20 20 20 20 20 20  |dMessage"       |
00001a90  20 20 20 20 20 3b 20 74  65 6c 6c 20 74 68 65 6d  |     ; tell them|
00001aa0  2e 2e 2e 0d 08 5c 14 20  20 20 4d 4f 56 20 20 20  |.....\.   MOV   |
00001ab0  20 20 72 30 2c 23 30 0d  08 66 22 20 20 20 53 54  |  r0,#0..f"   ST|
00001ac0  52 20 20 20 20 20 72 30  2c 5b 72 31 32 2c 23 60  |R     r0,[r12,#`|
00001ad0  64 72 61 67 67 69 6e 67  5d 0d 08 70 24 20 20 20  |dragging]..p$   |
00001ae0  20 20 20 20 20 20 20 3b  20 6d 61 72 6b 20 61 73  |       ; mark as|
00001af0  20 6e 6f 74 20 64 72 61  67 67 69 6e 67 0d 08 7a  | not dragging..z|
00001b00  3f 20 20 20 4c 44 4d 46  44 20 20 20 28 73 70 29  |?   LDMFD   (sp)|
00001b10  21 2c 7b 72 31 2d 72 32  2c 70 63 7d 20 20 20 20  |!,{r1-r2,pc}    |
00001b20  20 20 20 20 20 20 20 20  20 20 3b 20 52 65 74 75  |          ; Retu|
00001b30  72 6e 20 66 72 6f 6d 20  63 61 6c 6c 0d 08 84 05  |rn from call....|
00001b40  3a 0d 08 8e 14 2e 69 73  4e 6f 44 61 74 61 53 61  |:.....isNoDataSa|
00001b50  76 65 41 63 6b 0d 08 98  22 20 20 20 4c 44 52 20  |veAck..."   LDR |
00001b60  20 20 20 20 72 30 2c 5b  72 31 32 2c 23 60 64 72  |    r0,[r12,#`dr|
00001b70  61 67 67 69 6e 67 5d 0d  08 a2 14 20 20 20 43 4d  |agging]....   CM|
00001b80  50 20 20 20 20 20 72 30  2c 23 32 0d 08 ac 18 20  |P     r0,#2.... |
00001b90  20 20 42 4e 45 20 20 20  20 20 65 78 69 74 65 76  |  BNE     exitev|
00001ba0  65 6e 74 0d 08 b6 14 20  20 20 4d 4f 56 20 20 20  |ent....   MOV   |
00001bb0  20 20 72 30 2c 23 30 0d  08 c0 22 20 20 20 53 54  |  r0,#0..."   ST|
00001bc0  52 20 20 20 20 20 72 30  2c 5b 72 31 32 2c 23 60  |R     r0,[r12,#`|
00001bd0  64 72 61 67 67 69 6e 67  5d 0d 08 ca 24 20 20 20  |dragging]...$   |
00001be0  20 20 20 20 20 20 20 3b  20 6d 61 72 6b 20 61 73  |       ; mark as|
00001bf0  20 6e 6f 74 20 64 72 61  67 67 69 6e 67 0d 08 d4  | not dragging...|
00001c00  3f 20 20 20 4c 44 4d 46  44 20 20 20 28 73 70 29  |?   LDMFD   (sp)|
00001c10  21 2c 7b 72 31 2d 72 32  2c 70 63 7d 20 20 20 20  |!,{r1-r2,pc}    |
00001c20  20 20 20 20 20 20 20 20  20 20 3b 20 52 65 74 75  |          ; Retu|
00001c30  72 6e 20 66 72 6f 6d 20  63 61 6c 6c 0d 08 de 05  |rn from call....|
00001c40  3a 0d 08 e8 0f 2e 69 73  44 61 74 61 53 61 76 65  |:.....isDataSave|
00001c50  0d 08 f2 20 3b 20 63 68  65 63 6b 20 66 6f 72 20  |... ; check for |
00001c60  74 68 65 20 63 6f 72 72  65 63 74 20 69 63 6f 6e  |the correct icon|
00001c70  0d 08 fc 1c 20 20 20 20  20 20 20 20 20 20 3b 20  |....          ; |
00001c80  22 43 68 65 63 6b 20 69  63 6f 6e 22 0d 09 06 17  |"Check icon"....|
00001c90  20 20 20 42 4c 20 20 20  20 20 63 68 65 63 6b 63  |   BL     checkc|
00001ca0  74 72 6c 0d 09 10 17 20  20 20 42 45 51 20 20 20  |trl....   BEQ   |
00001cb0  20 65 78 69 74 65 76 65  6e 74 0d 09 1a 19 20 20  | exitevent....  |
00001cc0  20 4c 44 52 20 20 20 20  72 32 2c 5b 72 31 2c 23  | LDR    r2,[r1,#|
00001cd0  34 30 5d 0d 09 24 16 20  20 20 41 44 44 20 20 20  |40]..$.   ADD   |
00001ce0  20 72 32 2c 72 32 2c 23  31 0d 09 2e 17 20 20 20  | r2,r2,#1....   |
00001cf0  43 4d 50 20 20 20 20 72  32 2c 23 26 31 30 30 30  |CMP    r2,#&1000|
00001d00  0d 09 38 17 20 20 20 42  4e 45 20 20 20 20 65 78  |..8.   BNE    ex|
00001d10  69 74 65 76 65 6e 74 0d  09 42 32 20 20 20 42 4c  |itevent..B2   BL|
00001d20  20 20 20 20 20 63 68 65  63 6b 73 68 69 66 74 20  |     checkshift |
00001d30  20 20 20 20 20 3b 20 69  73 20 73 68 69 66 74 20  |     ; is shift |
00001d40  70 72 65 73 73 65 64 20  3f 0d 09 4c 50 20 20 20  |pressed ?..LP   |
00001d50  42 45 51 20 20 20 20 65  78 69 74 65 76 65 6e 74  |BEQ    exitevent|
00001d60  20 20 20 20 20 20 20 3b  20 69 66 20 73 6f 20 74  |       ; if so t|
00001d70  68 65 6e 20 65 78 69 74  2c 20 27 63 6f 73 20 77  |hen exit, 'cos w|
00001d80  65 20 63 61 6e 27 74 20  64 65 61 6c 20 77 69 74  |e can't deal wit|
00001d90  68 20 69 74 20 68 65 72  65 0d 09 56 26 20 20 20  |h it here..V&   |
00001da0  4c 44 52 20 20 20 20 72  33 2c 5b 72 31 2c 23 32  |LDR    r3,[r1,#2|
00001db0  30 5d 20 20 20 20 20 3b  20 77 69 6e 64 6f 77 0d  |0]     ; window.|
00001dc0  09 60 24 20 20 20 4c 44  52 20 20 20 20 72 34 2c  |.`$   LDR    r4,|
00001dd0  5b 72 31 2c 23 32 34 5d  20 20 20 20 20 3b 20 69  |[r1,#24]     ; i|
00001de0  63 6f 6e 0d 09 6a 16 20  20 20 42 4c 20 20 20 20  |con..j.   BL    |
00001df0  20 69 73 64 72 61 67 6f  6b 0d 09 74 13 20 20 20  | isdragok..t.   |
00001e00  43 4d 50 20 20 20 20 72  30 2c 23 30 0d 09 7e 17  |CMP    r0,#0..~.|
00001e10  20 20 20 42 45 51 20 20  20 20 65 78 69 74 65 76  |   BEQ    exitev|
00001e20  65 6e 74 0d 09 88 17 20  20 20 4c 44 4d 46 44 20  |ent....   LDMFD |
00001e30  20 28 73 70 29 2c 7b 72  31 7d 0d 09 92 12 3b 20  | (sp),{r1}....; |
00001e40  65 6e 64 20 6f 66 20 63  68 65 63 6b 0d 09 9c 16  |end of check....|
00001e50  20 20 20 4d 56 4e 20 20  20 20 72 32 2c 23 ac 20  |   MVN    r2,#. |
00001e60  2d 31 0d 09 a6 2b 20 20  20 53 54 52 20 20 20 20  |-1...+   STR    |
00001e70  72 32 2c 5b 72 31 2c 23  33 36 5d 20 20 20 3b 20  |r2,[r1,#36]   ; |
00001e80  64 61 74 61 20 6e 6f 74  20 73 61 66 65 0d 09 b0  |data not safe...|
00001e90  15 20 20 20 4d 4f 56 20  20 20 20 72 32 2c 23 31  |.   MOV    r2,#1|
00001ea0  32 38 0d 09 ba 2d 20 20  20 53 54 52 20 20 20 20  |28...-   STR    |
00001eb0  72 32 2c 5b 72 31 2c 23  30 5d 20 20 20 20 3b 20  |r2,[r1,#0]    ; |
00001ec0  6c 65 6e 67 74 68 20 6f  66 20 62 6c 6f 63 6b 0d  |length of block.|
00001ed0  09 c4 13 20 20 20 4d 4f  56 20 20 20 20 72 32 2c  |...   MOV    r2,|
00001ee0  23 32 0d 09 ce 32 20 20  20 53 54 52 20 20 20 20  |#2...2   STR    |
00001ef0  72 32 2c 5b 72 31 2c 23  31 36 5d 20 20 20 3b 20  |r2,[r1,#16]   ; |
00001f00  6f 6b 20 73 61 76 65 20  66 69 6c 65 20 6d 65 73  |ok save file mes|
00001f10  73 61 67 65 0d 09 d8 18  20 20 20 4c 44 52 20 20  |sage....   LDR  |
00001f20  20 20 72 32 2c 5b 72 31  2c 23 38 5d 0d 09 e2 31  |  r2,[r1,#8]...1|
00001f30  20 20 20 53 54 52 20 20  20 20 72 32 2c 5b 72 31  |   STR    r2,[r1|
00001f40  2c 23 31 32 5d 20 20 20  3b 20 6e 6f 74 65 20 6d  |,#12]   ; note m|
00001f50  65 73 73 61 67 65 20 6e  75 6d 62 65 72 0d 09 ec  |essage number...|
00001f60  1f 20 a4 4c 41 44 52 28  22 20 20 22 2c 33 2c 60  |. .LADR("  ",3,`|
00001f70  6f 75 72 66 69 6c 65 6e  61 6d 65 29 0d 09 f6 2f  |ourfilename).../|
00001f80  20 20 20 41 44 44 20 20  20 20 72 34 2c 72 31 2c  |   ADD    r4,r1,|
00001f90  23 34 34 20 20 20 20 20  3b 20 73 74 61 72 74 20  |#44     ; start |
00001fa0  6f 66 20 66 69 6c 65 6e  61 6d 65 0d 0a 00 18 2e  |of filename.....|
00001fb0  5f 5f 7a 30 5f 44 53 66  69 6c 65 6e 61 6d 65 6c  |__z0_DSfilenamel|
00001fc0  6f 6f 70 0d 0a 0a 18 20  20 20 4c 44 52 42 20 20  |oop....   LDRB  |
00001fd0  20 72 32 2c 5b 72 33 5d  2c 23 31 0d 0a 14 18 20  | r2,[r3],#1.... |
00001fe0  20 20 53 54 52 42 20 20  20 72 32 2c 5b 72 34 5d  |  STRB   r2,[r4]|
00001ff0  2c 23 31 0d 0a 1e 14 20  20 20 43 4d 50 20 20 20  |,#1....   CMP   |
00002000  20 72 32 2c 23 33 31 0d  0a 28 21 20 20 20 42 47  | r2,#31..(!   BG|
00002010  54 20 20 20 20 5f 5f 7a  30 5f 44 53 66 69 6c 65  |T    __z0_DSfile|
00002020  6e 61 6d 65 6c 6f 6f 70  0d 0a 32 14 20 20 20 4d  |nameloop..2.   M|
00002030  4f 56 20 20 20 20 72 30  2c 23 31 37 0d 0a 3c 18  |OV    r0,#17..<.|
00002040  20 20 20 4c 44 52 20 20  20 20 72 32 2c 5b 72 31  |   LDR    r2,[r1|
00002050  2c 23 34 5d 0d 0a 46 20  20 20 20 53 57 49 20 20  |,#4]..F    SWI  |
00002060  20 20 22 57 69 6d 70 5f  53 65 6e 64 4d 65 73 73  |  "Wimp_SendMess|
00002070  61 67 65 22 0d 0a 50 13  20 20 20 4d 4f 56 20 20  |age"..P.   MOV  |
00002080  20 20 72 30 2c 23 30 0d  0a 5a 1e 20 20 20 4c 44  |  r0,#0..Z.   LD|
00002090  4d 46 44 20 20 28 73 70  29 21 2c 7b 72 31 2d 72  |MFD  (sp)!,{r1-r|
000020a0  32 2c 70 63 7d 0d 0a 64  05 3a 0d 0a 6e 0f 2e 69  |2,pc}..d.:..n..i|
000020b0  73 44 61 74 61 4c 6f 61  64 0d 0a 78 20 3b 20 63  |sDataLoad..x ; c|
000020c0  68 65 63 6b 20 66 6f 72  20 74 68 65 20 63 6f 72  |heck for the cor|
000020d0  72 65 63 74 20 69 63 6f  6e 0d 0a 82 1a 20 20 20  |rect icon....   |
000020e0  20 20 20 20 20 20 20 3b  20 22 44 61 74 61 4c 6f  |       ; "DataLo|
000020f0  61 64 22 0d 0a 8c 17 20  20 20 42 4c 20 20 20 20  |ad"....   BL    |
00002100  20 63 68 65 63 6b 63 74  72 6c 0d 0a 96 17 20 20  | checkctrl....  |
00002110  20 42 45 51 20 20 20 20  65 78 69 74 65 76 65 6e  | BEQ    exiteven|
00002120  74 0d 0a a0 32 20 20 20  42 4c 20 20 20 20 20 63  |t...2   BL     c|
00002130  68 65 63 6b 73 68 69 66  74 20 20 20 20 20 20 3b  |heckshift      ;|
00002140  20 69 73 20 73 68 69 66  74 20 70 72 65 73 73 65  | is shift presse|
00002150  64 20 3f 0d 0a aa 1b 20  20 20 42 4e 45 20 20 20  |d ?....   BNE   |
00002160  20 5f 5f 7a 31 5f 6e 6f  74 73 68 69 66 74 0d 0a  | __z1_notshift..|
00002170  b4 3e 20 20 20 4c 44 52  45 51 20 20 72 32 2c 5b  |.>   LDREQ  r2,[|
00002180  72 31 2c 23 33 36 5d 20  20 20 20 20 3b 20 69 66  |r1,#36]     ; if|
00002190  20 73 6f 20 74 68 65 6e  20 69 73 20 74 68 69 73  | so then is this|
000021a0  20 64 61 74 61 20 73 61  66 65 20 3f 0d 0a be 33  | data safe ?...3|
000021b0  20 20 20 43 4d 4e 45 51  20 20 72 32 2c 23 31 20  |   CMNEQ  r2,#1 |
000021c0  20 20 20 20 20 20 20 20  20 20 3b 20 69 73 20 69  |          ; is i|
000021d0  74 20 2d 31 20 28 75 6e  73 61 66 65 20 3f 29 0d  |t -1 (unsafe ?).|
000021e0  0a c8 17 20 20 20 42 45  51 20 20 20 20 65 78 69  |...   BEQ    exi|
000021f0  74 65 76 65 6e 74 0d 0a  d2 1b 20 20 20 42 20 20  |tevent....   B  |
00002200  20 20 20 20 5f 5f 7a 31  5f 6f 6b 74 6f 6c 6f 61  |    __z1_oktoloa|
00002210  64 0d 0a dc 12 2e 5f 5f  7a 31 5f 6e 6f 74 73 68  |d.....__z1_notsh|
00002220  69 66 74 0d 0a e6 19 20  20 20 4c 44 52 20 20 20  |ift....   LDR   |
00002230  20 72 32 2c 5b 72 31 2c  23 34 30 5d 0d 0a f0 16  | r2,[r1,#40]....|
00002240  20 20 20 41 44 44 20 20  20 20 72 32 2c 72 32 2c  |   ADD    r2,r2,|
00002250  23 31 0d 0a fa 17 20 20  20 43 4d 50 20 20 20 20  |#1....   CMP    |
00002260  72 32 2c 23 26 31 30 30  30 0d 0b 04 17 20 20 20  |r2,#&1000....   |
00002270  42 4e 45 20 20 20 20 65  78 69 74 65 76 65 6e 74  |BNE    exitevent|
00002280  0d 0b 0e 12 2e 5f 5f 7a  31 5f 6f 6b 74 6f 6c 6f  |.....__z1_oktolo|
00002290  61 64 0d 0b 18 24 20 20  20 4c 44 52 20 20 20 20  |ad...$   LDR    |
000022a0  72 33 2c 5b 72 31 2c 23  32 30 5d 20 20 20 3b 20  |r3,[r1,#20]   ; |
000022b0  77 69 6e 64 6f 77 0d 0b  22 22 20 20 20 4c 44 52  |window..""   LDR|
000022c0  20 20 20 20 72 34 2c 5b  72 31 2c 23 32 34 5d 20  |    r4,[r1,#24] |
000022d0  20 20 3b 20 69 63 6f 6e  0d 0b 2c 16 20 20 20 42  |  ; icon..,.   B|
000022e0  4c 20 20 20 20 20 69 73  64 72 61 67 6f 6b 0d 0b  |L     isdragok..|
000022f0  36 13 20 20 20 43 4d 50  20 20 20 20 72 30 2c 23  |6.   CMP    r0,#|
00002300  30 0d 0b 40 17 20 20 20  42 45 51 20 20 20 20 65  |0..@.   BEQ    e|
00002310  78 69 74 65 76 65 6e 74  0d 0b 4a 12 3b 20 65 6e  |xitevent..J.; en|
00002320  64 20 6f 66 20 63 68 65  63 6b 0d 0b 54 17 20 20  |d of check..T.  |
00002330  20 4c 44 4d 46 44 20 20  28 73 70 29 2c 7b 72 31  | LDMFD  (sp),{r1|
00002340  7d 0d 0b 5e 1d 20 20 20  4c 44 52 20 20 20 20 20  |}..^.   LDR     |
00002350  72 33 2c 5b 72 31 32 2c  23 60 73 74 72 5d 0d 0b  |r3,[r12,#`str]..|
00002360  68 20 20 20 20 4c 44 52  20 20 20 20 20 72 34 2c  |h    LDR     r4,|
00002370  5b 72 31 32 2c 23 60 6c  65 6e 67 74 68 5d 0d 0b  |[r12,#`length]..|
00002380  72 24 20 20 20 41 44 44  20 20 20 20 72 31 2c 72  |r$   ADD    r1,r|
00002390  31 2c 23 34 34 20 20 20  3b 20 66 69 6c 65 6e 61  |1,#44   ; filena|
000023a0  6d 65 0d 0b 7c 2b 20 20  20 42 4c 20 20 20 20 20  |me..|+   BL     |
000023b0  63 68 65 63 6b 73 68 69  66 74 20 20 3b 20 69 73  |checkshift  ; is|
000023c0  20 73 68 69 66 74 20 64  72 61 67 20 3f 0d 0b 86  | shift drag ?...|
000023d0  3a 20 20 20 42 45 51 20  20 20 20 64 6f 73 68 69  |:   BEQ    doshi|
000023e0  66 74 64 72 61 67 20 3b  20 69 66 20 73 6f 20 74  |ftdrag ; if so t|
000023f0  68 65 6e 20 6f 6e 6c 79  20 63 6f 70 79 20 66 69  |hen only copy fi|
00002400  6c 65 6e 61 6d 65 8c 0d  0b 90 32 20 20 20 4d 4f  |lename....2   MO|
00002410  56 20 20 20 20 72 30 2c  23 26 34 30 20 20 20 20  |V    r0,#&40    |
00002420  20 3b 20 6f 70 65 6e 69  6e 67 20 66 69 6c 65 20  | ; opening file |
00002430  66 6f 72 20 69 6e 70 75  74 0d 0b 9a 25 20 20 20  |for input...%   |
00002440  53 57 49 20 20 20 20 22  4f 53 5f 46 69 6e 64 22  |SWI    "OS_Find"|
00002450  20 20 20 3b 20 6f 70 65  6e 20 66 69 6c 65 0d 0b  |   ; open file..|
00002460  a4 24 20 20 20 53 54 52  20 20 20 20 20 72 30 2c  |.$   STR     r0,|
00002470  5b 72 31 32 2c 23 60 66  69 6c 65 68 61 6e 64 6c  |[r12,#`filehandl|
00002480  65 5d 0d 0b ae 1c 20 20  20 20 20 20 20 20 20 20  |e]....          |
00002490  3b 20 22 48 61 6e 64 6c  65 20 25 72 30 22 0d 0b  |; "Handle %r0"..|
000024a0  b8 1c 2e 5f 5f 7a 31 5f  44 4c 72 65 61 64 64 61  |...__z1_DLreadda|
000024b0  74 61 69 63 6f 6e 6c 6f  6f 70 0d 0b c2 1d 20 20  |taiconloop....  |
000024c0  20 4c 44 52 20 20 20 20  20 72 33 2c 5b 72 31 32  | LDR     r3,[r12|
000024d0  2c 23 60 73 74 72 5d 0d  0b cc 20 20 20 20 4c 44  |,#`str]...    LD|
000024e0  52 20 20 20 20 20 72 34  2c 5b 72 31 32 2c 23 60  |R     r4,[r12,#`|
000024f0  6c 65 6e 67 74 68 5d 0d  0b d6 18 2e 5f 5f 7a 31  |length].....__z1|
00002500  5f 44 4c 72 65 61 64 64  61 74 61 6c 6f 6f 70 0d  |_DLreaddataloop.|
00002510  0b e0 24 20 20 20 4c 44  52 20 20 20 20 20 72 31  |..$   LDR     r1|
00002520  2c 5b 72 31 32 2c 23 60  66 69 6c 65 68 61 6e 64  |,[r12,#`filehand|
00002530  6c 65 5d 0d 0b ea 23 20  20 20 4d 4f 56 20 20 20  |le]...#   MOV   |
00002540  20 72 30 2c 23 26 37 46  20 20 20 20 20 3b 20 63  | r0,#&7F     ; c|
00002550  68 65 63 6b 20 c5 0d 0b  f4 17 20 20 20 53 57 49  |heck .....   SWI|
00002560  20 20 20 20 22 4f 53 5f  42 79 74 65 22 0d 0b fe  |    "OS_Byte"...|
00002570  13 20 20 20 43 4d 50 20  20 20 20 72 31 2c 23 30  |.   CMP    r1,#0|
00002580  0d 0c 08 18 20 20 20 42  4e 45 20 20 20 20 5f 5f  |....   BNE    __|
00002590  7a 31 5f 44 4c 65 6f 66  0d 0c 12 2d 20 20 20 43  |z1_DLeof...-   C|
000025a0  4d 50 20 20 20 20 72 34  2c 23 31 20 20 20 20 20  |MP    r4,#1     |
000025b0  20 20 3b 20 69 73 20 74  68 69 73 20 6c 61 73 74  |  ; is this last|
000025c0  20 63 68 61 72 0d 0c 1c  30 20 20 20 42 45 51 20  | char...0   BEQ |
000025d0  20 20 20 5f 5f 7a 31 5f  44 4c 6e 65 78 74 69 63  |   __z1_DLnextic|
000025e0  6f 6e 20 3b 20 69 66 20  73 6f 2c 20 6e 65 78 74  |on ; if so, next|
000025f0  20 69 63 6f 6e 0d 0c 26  24 20 20 20 4c 44 52 20  | icon..&$   LDR |
00002600  20 20 20 20 72 31 2c 5b  72 31 32 2c 23 60 66 69  |    r1,[r12,#`fi|
00002610  6c 65 68 61 6e 64 6c 65  5d 0d 0c 30 18 20 20 20  |lehandle]..0.   |
00002620  53 57 49 20 20 20 20 22  58 4f 53 5f 42 47 65 74  |SWI    "XOS_BGet|
00002630  22 0d 0c 3a 18 20 20 20  53 54 52 42 20 20 20 72  |"..:.   STRB   r|
00002640  30 2c 5b 72 33 5d 2c 23  31 0d 0c 44 2f 20 20 20  |0,[r3],#1..D/   |
00002650  43 4d 50 20 20 20 20 72  30 2c 23 33 31 20 20 20  |CMP    r0,#31   |
00002660  20 20 20 20 3b 20 69 73  20 74 68 69 73 20 74 65  |    ; is this te|
00002670  72 6d 69 6e 61 74 6f 72  0d 0c 4e 31 20 20 20 42  |rminator..N1   B|
00002680  4c 45 20 20 20 20 5f 5f  7a 31 5f 44 4c 6e 65 78  |LE    __z1_DLnex|
00002690  74 69 63 6f 6e 20 20 3b  20 69 66 20 73 6f 2c 20  |ticon  ; if so, |
000026a0  6e 65 78 74 20 69 63 6f  6e 0d 0c 58 16 20 20 20  |next icon..X.   |
000026b0  53 55 42 20 20 20 20 72  34 2c 72 34 2c 23 31 0d  |SUB    r4,r4,#1.|
000026c0  0c 62 21 20 20 20 42 20  20 20 20 20 20 5f 5f 7a  |.b!   B      __z|
000026d0  31 5f 44 4c 72 65 61 64  64 61 74 61 6c 6f 6f 70  |1_DLreaddataloop|
000026e0  0d 0c 6c 14 2e 5f 5f 7a  31 5f 44 4c 6e 65 78 74  |..l..__z1_DLnext|
000026f0  69 63 6f 6e 0d 0c 76 18  20 20 20 42 4c 20 20 20  |icon..v.   BL   |
00002700  20 20 75 70 64 61 74 65  69 63 6f 6e 0d 0c 80 13  |  updateicon....|
00002710  20 20 20 4d 4f 56 20 20  20 20 72 30 2c 23 30 0d  |   MOV    r0,#0.|
00002720  0c 8a 18 20 20 20 53 54  52 42 20 20 20 72 30 2c  |...   STRB   r0,|
00002730  5b 72 33 5d 2c 23 31 0d  0c 94 1e 20 20 20 4c 44  |[r3],#1....   LD|
00002740  52 20 20 20 20 20 72 34  2c 5b 72 31 32 2c 23 60  |R     r4,[r12,#`|
00002750  69 63 6f 6e 5d 0d 0c 9e  16 20 20 20 41 44 44 20  |icon]....   ADD |
00002760  20 20 20 72 34 2c 72 34  2c 23 31 0d 0c a8 1e 20  |   r4,r4,#1.... |
00002770  20 20 53 54 52 20 20 20  20 20 72 34 2c 5b 72 31  |  STR     r4,[r1|
00002780  32 2c 23 60 69 63 6f 6e  5d 0d 0c b2 19 20 20 20  |2,#`icon]....   |
00002790  20 20 20 20 20 20 20 3b  20 6e 65 78 74 20 69 63  |       ; next ic|
000027a0  6f 6e 0d 0c bc 20 20 20  20 4c 44 52 20 20 20 20  |on...    LDR    |
000027b0  20 72 33 2c 5b 72 31 32  2c 23 60 77 69 6e 64 6f  | r3,[r12,#`windo|
000027c0  77 5d 0d 0c c6 16 20 20  20 42 4c 20 20 20 20 20  |w]....   BL     |
000027d0  69 73 64 72 61 67 6f 6b  0d 0c d0 2e 20 20 20 43  |isdragok....   C|
000027e0  4d 50 20 20 20 20 72 30  2c 23 30 20 20 20 20 20  |MP    r0,#0     |
000027f0  20 20 3b 20 69 73 20 6e  65 78 74 20 69 63 6f 6e  |  ; is next icon|
00002800  20 76 61 6c 69 64 0d 0c  da 1b 20 20 20 42 45 51  | valid....   BEQ|
00002810  20 20 20 20 5f 5f 7a 31  5f 44 4c 6e 6f 6d 6f 72  |    __z1_DLnomor|
00002820  65 0d 0c e4 25 20 20 20  42 20 20 20 20 20 20 5f  |e...%   B      _|
00002830  5f 7a 31 5f 44 4c 72 65  61 64 64 61 74 61 69 63  |_z1_DLreaddataic|
00002840  6f 6e 6c 6f 6f 70 0d 0c  ee 0f 2e 5f 5f 7a 31 5f  |onloop.....__z1_|
00002850  44 4c 65 6f 66 0d 0c f8  1d 20 20 20 4c 44 52 20  |DLeof....   LDR |
00002860  20 20 20 20 72 34 2c 5b  72 31 32 2c 23 60 73 74  |    r4,[r12,#`st|
00002870  72 5d 0d 0d 02 3c 20 20  20 43 4d 50 20 20 20 20  |r]...<   CMP    |
00002880  72 34 2c 72 33 20 20 20  20 20 20 20 20 20 20 3b  |r4,r3          ;|
00002890  20 68 61 76 65 20 77 65  20 73 74 6f 72 65 64 20  | have we stored |
000028a0  61 6e 79 74 68 69 6e 67  20 79 65 74 20 3f 0d 0d  |anything yet ?..|
000028b0  0c 13 20 20 20 4d 4f 56  4e 45 20 20 72 30 2c 23  |..   MOVNE  r0,#|
000028c0  30 0d 0d 16 18 20 20 20  53 54 52 4e 45 42 20 72  |0....   STRNEB r|
000028d0  30 2c 5b 72 33 5d 2c 23  31 0d 0d 20 47 20 20 20  |0,[r3],#1.. G   |
000028e0  42 4c 4e 45 20 20 20 75  70 64 61 74 65 69 63 6f  |BLNE   updateico|
000028f0  6e 20 20 20 20 20 3b 20  61 6e 64 20 6f 6e 6c 79  |n     ; and only|
00002900  20 75 70 64 61 74 65 20  69 66 20 77 65 20 68 61  | update if we ha|
00002910  76 65 20 63 68 61 6e 67  65 64 20 69 74 2e 2e 2e  |ve changed it...|
00002920  0d 0d 2a 12 2e 5f 5f 7a  31 5f 44 4c 6e 6f 6d 6f  |..*..__z1_DLnomo|
00002930  72 65 0d 0d 34 24 20 20  20 4c 44 52 20 20 20 20  |re..4$   LDR    |
00002940  20 72 31 2c 5b 72 31 32  2c 23 60 66 69 6c 65 68  | r1,[r12,#`fileh|
00002950  61 6e 64 6c 65 5d 0d 0d  3e 2b 20 20 20 4d 4f 56  |andle]..>+   MOV|
00002960  20 20 20 20 72 30 2c 23  30 20 20 20 20 20 20 20  |    r0,#0       |
00002970  3b 20 72 30 3d 30 20 63  6c 6f 73 65 20 66 69 6c  |; r0=0 close fil|
00002980  65 0d 0d 48 17 20 20 20  53 57 49 20 20 20 20 22  |e..H.   SWI    "|
00002990  4f 53 5f 46 69 6e 64 22  0d 0d 52 0f 2e 5f 44 4c  |OS_Find"..R.._DL|
000029a0  63 6f 6e 66 69 72 6d 0d  0d 5c 17 20 20 20 4c 44  |confirm..\.   LD|
000029b0  4d 46 44 20 20 28 73 70  29 2c 7b 72 31 7d 0d 0d  |MFD  (sp),{r1}..|
000029c0  66 13 20 20 20 4d 4f 56  20 20 20 20 72 30 2c 23  |f.   MOV    r0,#|
000029d0  34 0d 0d 70 19 20 20 20  53 54 52 20 20 20 20 72  |4..p.   STR    r|
000029e0  30 2c 5b 72 31 2c 23 31  36 5d 0d 0d 7a 18 20 20  |0,[r1,#16]..z.  |
000029f0  20 4c 44 52 20 20 20 20  72 30 2c 5b 72 31 2c 23  | LDR    r0,[r1,#|
00002a00  38 5d 0d 0d 84 19 20 20  20 53 54 52 20 20 20 20  |8]....   STR    |
00002a10  72 30 2c 5b 72 31 2c 23  31 32 5d 0d 0d 8e 18 20  |r0,[r1,#12].... |
00002a20  20 20 4c 44 52 20 20 20  20 72 32 2c 5b 72 31 2c  |  LDR    r2,[r1,|
00002a30  23 34 5d 0d 0d 98 14 20  20 20 4d 4f 56 20 20 20  |#4]....   MOV   |
00002a40  20 72 30 2c 23 31 37 0d  0d a2 20 20 20 20 53 57  | r0,#17...    SW|
00002a50  49 20 20 20 20 22 57 69  6d 70 5f 53 65 6e 64 4d  |I    "Wimp_SendM|
00002a60  65 73 73 61 67 65 22 0d  0d ac 13 20 20 20 4d 4f  |essage"....   MO|
00002a70  56 20 20 20 20 72 30 2c  23 30 0d 0d b6 1e 20 20  |V    r0,#0....  |
00002a80  20 4c 44 4d 46 44 20 20  28 73 70 29 21 2c 7b 72  | LDMFD  (sp)!,{r|
00002a90  31 2d 72 32 2c 70 63 7d  0d 0d c0 05 3a 0d 0d ca  |1-r2,pc}....:...|
00002aa0  10 2e 64 6f 73 68 69 66  74 64 72 61 67 0d 0d d4  |..doshiftdrag...|
00002ab0  13 3b 20 3e 20 72 31 3d  66 69 6c 65 6e 61 6d 65  |.; > r1=filename|
00002ac0  0d 0d de 19 3b 20 20 20  72 33 3d 73 74 6f 72 65  |....;   r3=store|
00002ad0  20 6c 6f 63 61 74 69 6f  6e 0d 0d e8 1b 3b 20 20  | location....;  |
00002ae0  20 72 34 3d 6c 65 6e 67  74 68 20 6f 66 20 73 74  | r4=length of st|
00002af0  72 69 6e 67 0d 0d f2 0e  2e 5f 5f 7a 32 5f 6c 6f  |ring.....__z2_lo|
00002b00  6f 70 0d 0d fc 33 20 20  20 43 4d 50 20 20 20 20  |op...3   CMP    |
00002b10  72 34 2c 23 31 20 20 20  20 20 20 20 20 20 3b 20  |r4,#1         ; |
00002b20  68 6f 77 20 6d 75 63 68  20 73 70 61 63 65 20 6c  |how much space l|
00002b30  65 66 74 20 3f 0d 0e 06  39 20 20 20 42 4c 45 20  |eft ?...9   BLE |
00002b40  20 20 20 5f 5f 7a 32 5f  65 78 69 74 20 20 20 20  |   __z2_exit    |
00002b50  20 20 20 20 20 3b 20 69  73 20 74 65 72 6d 69 6e  |     ; is termin|
00002b60  61 74 6f 72 20 74 68 65  6e 20 65 78 69 74 0d 0e  |ator then exit..|
00002b70  10 32 20 20 20 4c 44 52  42 20 20 20 72 30 2c 5b  |.2   LDRB   r0,[|
00002b80  72 31 5d 2c 23 31 20 20  20 20 3b 20 67 65 74 20  |r1],#1    ; get |
00002b90  62 79 74 65 20 6f 66 20  66 69 6c 65 6e 61 6d 65  |byte of filename|
00002ba0  0d 0e 1a 2c 20 20 20 53  54 52 42 20 20 20 72 30  |...,   STRB   r0|
00002bb0  2c 5b 72 33 5d 2c 23 31  20 20 20 20 3b 20 73 74  |,[r3],#1    ; st|
00002bc0  6f 72 65 20 69 6e 20 62  6c 6f 63 6b 0d 0e 24 30  |ore in block..$0|
00002bd0  20 20 20 43 4d 50 20 20  20 20 72 30 2c 23 33 31  |   CMP    r0,#31|
00002be0  20 20 20 20 20 20 20 20  3b 20 69 73 20 74 68 69  |        ; is thi|
00002bf0  73 20 74 65 72 6d 69 6e  61 74 6f 72 0d 0e 2e 32  |s terminator...2|
00002c00  20 20 20 42 4c 45 20 20  20 20 5f 5f 7a 32 5f 65  |   BLE    __z2_e|
00002c10  78 69 74 20 20 20 20 20  20 20 20 20 3b 20 69 66  |xit         ; if|
00002c20  20 73 6f 2c 20 74 68 65  6e 20 65 78 69 74 0d 0e  | so, then exit..|
00002c30  38 16 20 20 20 53 55 42  20 20 20 20 72 34 2c 72  |8.   SUB    r4,r|
00002c40  34 2c 23 31 0d 0e 42 17  20 20 20 42 20 20 20 20  |4,#1..B.   B    |
00002c50  20 20 5f 5f 7a 32 5f 6c  6f 6f 70 0d 0e 4c 0e 2e  |  __z2_loop..L..|
00002c60  5f 5f 7a 32 5f 65 78 69  74 0d 0e 56 18 20 20 20  |__z2_exit..V.   |
00002c70  42 4c 20 20 20 20 20 75  70 64 61 74 65 69 63 6f  |BL     updateico|
00002c80  6e 0d 0e 60 18 20 20 20  42 20 20 20 20 20 20 5f  |n..`.   B      _|
00002c90  44 4c 63 6f 6e 66 69 72  6d 0d 0e 6a 05 3a 0d 0e  |DLconfirm..j.:..|
00002ca0  74 0d 2e 69 73 64 72 61  67 6f 6b 0d 0e 7e 20 20  |t..isdragok..~  |
00002cb0  20 20 53 54 4d 46 44 20  20 28 73 70 29 21 2c 7b  |  STMFD  (sp)!,{|
00002cc0  72 31 2d 72 34 2c 6c 69  6e 6b 7d 0d 0e 88 1c 20  |r1-r4,link}.... |
00002cd0  20 20 20 20 20 20 20 20  20 3b 20 22 57 69 6e 20  |         ; "Win |
00002ce0  20 3d 20 25 26 33 22 0d  0e 92 1c 20 20 20 20 20  | = %&3"....     |
00002cf0  20 20 20 20 20 3b 20 22  49 63 6f 6e 20 3d 20 25  |     ; "Icon = %|
00002d00  26 34 22 0d 0e 9c 20 20  20 20 53 54 52 20 20 20  |&4"...    STR   |
00002d10  20 20 72 33 2c 5b 72 31  32 2c 23 60 77 69 6e 64  |  r3,[r12,#`wind|
00002d20  6f 77 5d 0d 0e a6 1e 20  20 20 53 54 52 20 20 20  |ow]....   STR   |
00002d30  20 20 72 34 2c 5b 72 31  32 2c 23 60 69 63 6f 6e  |  r4,[r12,#`icon|
00002d40  5d 0d 0e b0 1d 20 a4 4c  41 44 44 28 22 20 20 22  |].... .LADD("  "|
00002d50  2c 31 2c 31 32 2c 60 77  69 6e 64 6f 77 29 0d 0e  |,1,12,`window)..|
00002d60  ba 22 20 20 20 53 57 49  20 20 20 20 22 58 57 69  |."   SWI    "XWi|
00002d70  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00002d80  0d 0e c4 1c 20 20 20 42  56 53 20 20 20 20 5f 5f  |....   BVS    __|
00002d90  7a 33 5f 6e 6f 74 64 72  61 67 6f 6b 0d 0e ce 1f  |z3_notdragok....|
00002da0  20 20 20 4c 44 52 20 20  20 20 20 72 32 2c 5b 72  |   LDR     r2,[r|
00002db0  31 32 2c 23 60 66 6c 61  67 73 5d 0d 0e d8 2e 20  |12,#`flags].... |
00002dc0  20 20 54 53 54 20 20 20  20 72 32 2c 23 28 31 3c  |  TST    r2,#(1<|
00002dd0  3c 38 29 20 20 20 20 3b  20 69 73 20 69 74 20 69  |<8)    ; is it i|
00002de0  6e 64 69 72 65 63 74 65  64 0d 0e e2 1c 20 20 20  |ndirected....   |
00002df0  42 45 51 20 20 20 20 5f  5f 7a 33 5f 6e 6f 74 64  |BEQ    __z3_notd|
00002e00  72 61 67 6f 6b 0d 0e ec  1b 20 20 20 80 20 20 20  |ragok....   .   |
00002e10  20 72 33 2c 72 32 2c 23  28 31 35 3c 3c 31 32 29  | r3,r2,#(15<<12)|
00002e20  0d 0e f6 31 20 20 20 43  4d 50 20 20 20 20 72 33  |...1   CMP    r3|
00002e30  2c 23 28 31 34 3c 3c 31  32 29 20 20 20 20 20 3b  |,#(14<<12)     ;|
00002e40  20 77 72 69 74 65 2f 63  6c 69 63 6b 2f 64 72 61  | write/click/dra|
00002e50  67 0d 0f 00 2a 20 20 20  43 4d 50 4e 45 20 20 72  |g...*   CMPNE  r|
00002e60  33 2c 23 28 31 35 3c 3c  31 32 29 20 20 20 20 20  |3,#(15<<12)     |
00002e70  3b 20 77 72 69 74 65 61  62 6c 65 0d 0f 0a 1c 20  |; writeable.... |
00002e80  20 20 42 4e 45 20 20 20  20 5f 5f 7a 33 5f 6e 6f  |  BNE    __z3_no|
00002e90  74 64 72 61 67 6f 6b 0d  0f 14 13 20 20 20 4d 4f  |tdragok....   MO|
00002ea0  56 20 20 20 20 72 30 2c  23 31 0d 0f 1e 1c 20 20  |V    r0,#1....  |
00002eb0  20 20 20 20 20 20 20 20  3b 20 22 49 63 6f 6e 20  |        ; "Icon |
00002ec0  76 61 6c 69 64 22 0d 0f  28 1e 20 20 20 4c 44 4d  |valid"..(.   LDM|
00002ed0  46 44 20 20 28 73 70 29  21 2c 7b 72 31 2d 72 34  |FD  (sp)!,{r1-r4|
00002ee0  2c 70 63 7d 0d 0f 32 13  2e 5f 5f 7a 33 5f 6e 6f  |,pc}..2..__z3_no|
00002ef0  74 64 72 61 67 6f 6b 0d  0f 3c 13 20 20 20 4d 4f  |tdragok..<.   MO|
00002f00  56 20 20 20 20 72 30 2c  23 30 0d 0f 46 20 20 20  |V    r0,#0..F   |
00002f10  20 20 20 20 20 20 20 20  3b 20 22 49 63 6f 6e 20  |        ; "Icon |
00002f20  6e 6f 74 20 76 61 6c 69  64 22 0d 0f 50 1e 20 20  |not valid"..P.  |
00002f30  20 4c 44 4d 46 44 20 20  28 73 70 29 21 2c 7b 72  | LDMFD  (sp)!,{r|
00002f40  31 2d 72 34 2c 70 63 7d  0d 0f 5a 05 3a 0d 0f 64  |1-r4,pc}..Z.:..d|
00002f50  0f 2e 75 70 64 61 74 65  69 63 6f 6e 0d 0f 6e 3e  |..updateicon..n>|
00002f60  20 20 20 53 54 4d 46 44  20 20 20 28 73 70 29 21  |   STMFD   (sp)!|
00002f70  2c 7b 72 30 2d 72 35 2c  6c 69 6e 6b 7d 20 20 20  |,{r0-r5,link}   |
00002f80  20 20 20 20 20 20 20 20  20 3b 20 53 74 61 63 6b  |         ; Stack|
00002f90  20 72 65 67 69 73 74 65  72 73 0d 0f 78 24 20 20  | registers..x$  |
00002fa0  20 20 20 20 20 20 20 20  3b 20 bd 34 2b 22 25 49  |        ; .4+"%I|
00002fb0  55 70 64 61 74 69 6e 67  20 69 63 6f 6e 22 0d 0f  |Updating icon"..|
00002fc0  82 1d 20 a4 4c 41 44 44  28 22 20 20 22 2c 31 2c  |.. .LADD("  ",1,|
00002fd0  31 32 2c 60 77 69 6e 64  6f 77 29 0d 0f 8c 22 20  |12,`window)..." |
00002fe0  20 20 53 57 49 20 20 20  20 20 22 57 69 6d 70 5f  |  SWI     "Wimp_|
00002ff0  47 65 74 49 63 6f 6e 53  74 61 74 65 22 0d 0f 96  |GetIconState"...|
00003000  45 20 20 20 41 44 44 20  20 20 20 20 72 31 2c 72  |E   ADD     r1,r|
00003010  31 2c 23 38 20 20 20 20  20 20 20 20 20 20 20 20  |1,#8            |
00003020  20 20 20 20 20 20 20 20  20 20 3b 20 72 65 6d 6f  |          ; remo|
00003030  76 65 20 66 69 72 73 74  20 74 77 6f 20 77 6f 72  |ve first two wor|
00003040  64 73 0d 0f a0 49 20 20  20 4c 44 4d 49 41 20 20  |ds...I   LDMIA  |
00003050  20 72 31 2c 7b 72 31 2d  72 34 7d 20 20 20 20 20  | r1,{r1-r4}     |
00003060  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00003070  20 72 65 61 64 20 6c 62  72 74 20 69 6e 74 6f 20  | read lbrt into |
00003080  72 31 2c 72 32 2c 72 33  2c 72 34 0d 0f aa 20 20  |r1,r2,r3,r4...  |
00003090  20 20 4c 44 52 20 20 20  20 20 72 30 2c 5b 72 31  |  LDR     r0,[r1|
000030a0  32 2c 23 60 77 69 6e 64  6f 77 5d 0d 0f b4 21 20  |2,#`window]...! |
000030b0  20 20 53 57 49 20 20 20  20 20 22 57 69 6d 70 5f  |  SWI     "Wimp_|
000030c0  46 6f 72 63 65 52 65 64  72 61 77 22 0d 0f be 3f  |ForceRedraw"...?|
000030d0  20 20 20 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |   LDMFD   (sp)!|
000030e0  2c 7b 72 30 2d 72 35 2c  70 63 7d 20 20 20 20 20  |,{r0-r5,pc}     |
000030f0  20 20 20 20 20 20 20 20  20 3b 20 52 65 74 75 72  |         ; Retur|
00003100  6e 20 66 72 6f 6d 20 63  61 6c 6c 0d 0f c8 05 3a  |n from call....:|
00003110  0d 0f d2 27 3b 20 43 68  65 63 6b 20 69 66 20 74  |...'; Check if t|
00003120  68 65 20 73 68 69 66 74  20 6b 65 79 20 69 73 20  |he shift key is |
00003130  70 72 65 73 73 65 64 0d  0f dc 15 3b 20 3c 20 45  |pressed....; < E|
00003140  51 20 69 66 20 70 72 65  73 73 65 64 0d 0f e6 0f  |Q if pressed....|
00003150  2e 63 68 65 63 6b 73 68  69 66 74 0d 0f f0 21 20  |.checkshift...! |
00003160  20 20 53 54 4d 46 44 20  20 20 28 73 70 29 21 2c  |  STMFD   (sp)!,|
00003170  7b 72 30 2d 72 32 2c 6c  69 6e 6b 7d 0d 0f fa 3f  |{r0-r2,link}...?|
00003180  20 20 20 4d 4f 56 20 20  20 20 20 72 30 2c 23 26  |   MOV     r0,#&|
00003190  37 39 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |79             ;|
000031a0  20 4b 65 79 62 6f 61 72  64 20 73 63 61 6e 20 4f  | Keyboard scan O|
000031b0  53 5f 42 79 74 65 20 63  6f 64 65 0d 10 04 33 20  |S_Byte code...3 |
000031c0  20 20 4d 4f 56 20 20 20  20 20 72 31 2c 23 26 38  |  MOV     r1,#&8|
000031d0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |0             ; |
000031e0  53 48 49 46 54 20 6b 65  79 20 63 6f 64 65 0d 10  |SHIFT key code..|
000031f0  0e 40 20 20 20 53 57 49  20 20 20 20 20 22 58 4f  |.@   SWI     "XO|
00003200  53 5f 42 79 74 65 22 20  20 20 20 20 20 20 20 20  |S_Byte"         |
00003210  20 3b 20 43 61 6c 6c 20  4f 53 5f 42 79 74 65 20  | ; Call OS_Byte |
00003220  74 6f 20 72 65 61 64 20  73 74 61 74 75 73 0d 10  |to read status..|
00003230  18 34 20 20 20 54 45 51  20 20 20 20 20 72 31 2c  |.4   TEQ     r1,|
00003240  23 26 46 46 20 20 20 20  20 20 20 20 20 20 20 20  |#&FF            |
00003250  20 3b 20 69 73 20 69 74  20 70 72 65 73 73 65 64  | ; is it pressed|
00003260  20 3f 0d 10 22 1f 20 20  20 4c 44 4d 46 44 20 20  | ?..".   LDMFD  |
00003270  20 28 73 70 29 21 2c 7b  72 30 2d 72 32 2c 70 63  | (sp)!,{r0-r2,pc|
00003280  7d 0d 10 2c 26 3b 20 43  68 65 63 6b 20 69 66 20  |}..,&; Check if |
00003290  74 68 65 20 63 74 72 6c  20 6b 65 79 20 69 73 20  |the ctrl key is |
000032a0  70 72 65 73 73 65 64 0d  10 36 15 3b 20 3c 20 45  |pressed..6.; < E|
000032b0  51 20 69 66 20 70 72 65  73 73 65 64 0d 10 40 0e  |Q if pressed..@.|
000032c0  2e 63 68 65 63 6b 63 74  72 6c 0d 10 4a 21 20 20  |.checkctrl..J!  |
000032d0  20 53 54 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  | STMFD   (sp)!,{|
000032e0  72 30 2d 72 32 2c 6c 69  6e 6b 7d 0d 10 54 3f 20  |r0-r2,link}..T? |
000032f0  20 20 4d 4f 56 20 20 20  20 20 72 30 2c 23 26 37  |  MOV     r0,#&7|
00003300  39 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |9             ; |
00003310  4b 65 79 62 6f 61 72 64  20 73 63 61 6e 20 4f 53  |Keyboard scan OS|
00003320  5f 42 79 74 65 20 63 6f  64 65 0d 10 5e 32 20 20  |_Byte code..^2  |
00003330  20 4d 4f 56 20 20 20 20  20 72 31 2c 23 26 38 31  | MOV     r1,#&81|
00003340  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 43  |             ; C|
00003350  54 52 4c 20 6b 65 79 20  63 6f 64 65 0d 10 68 40  |TRL key code..h@|
00003360  20 20 20 53 57 49 20 20  20 20 20 22 58 4f 53 5f  |   SWI     "XOS_|
00003370  42 79 74 65 22 20 20 20  20 20 20 20 20 20 20 3b  |Byte"          ;|
00003380  20 43 61 6c 6c 20 4f 53  5f 42 79 74 65 20 74 6f  | Call OS_Byte to|
00003390  20 72 65 61 64 20 73 74  61 74 75 73 0d 10 72 34  | read status..r4|
000033a0  20 20 20 54 45 51 20 20  20 20 20 72 31 2c 23 26  |   TEQ     r1,#&|
000033b0  46 46 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |FF             ;|
000033c0  20 69 73 20 69 74 20 70  72 65 73 73 65 64 20 3f  | is it pressed ?|
000033d0  0d 10 7c 1f 20 20 20 4c  44 4d 46 44 20 20 20 28  |..|.   LDMFD   (|
000033e0  73 70 29 21 2c 7b 72 30  2d 72 32 2c 70 63 7d 0d  |sp)!,{r0-r2,pc}.|
000033f0  10 86 05 3a 0d 10 90 32  2e 60 6f 75 72 66 69 6c  |...:...2.`ourfil|
00003400  65 6e 61 6d 65 3a 45 51  55 53 20 22 3c 57 69 6d  |ename:EQUS "<Wim|
00003410  70 24 53 63 72 61 70 3e  22 3a 45 51 55 42 20 30  |p$Scrap>":EQUB 0|
00003420  3a 41 4c 49 47 4e 0d 10  9a 05 3a 0d 10 a4 11 2e  |:ALIGN....:.....|
00003430  69 73 6d 6f 75 73 65 63  6c 69 63 6b 0d 10 ae 31  |ismouseclick...1|
00003440  20 20 20 53 54 4d 46 44  20 20 20 28 73 70 29 21  |   STMFD   (sp)!|
00003450  2c 7b 72 33 2d 72 39 7d  20 20 20 20 3b 20 53 74  |,{r3-r9}    ; St|
00003460  61 63 6b 20 72 65 67 69  73 74 65 72 73 0d 10 b8  |ack registers...|
00003470  19 20 20 20 4c 44 52 20  20 20 20 20 72 30 2c 5b  |.   LDR     r0,[|
00003480  72 31 2c 23 38 5d 0d 10  c2 24 20 20 20 20 20 20  |r1,#8]...$      |
00003490  20 20 20 20 3b 20 22 42  75 74 74 6f 6e 20 65 76  |    ; "Button ev|
000034a0  65 6e 74 20 3d 20 25 26  30 22 0d 10 cc 18 20 20  |ent = %&0"....  |
000034b0  20 42 4c 20 20 20 20 20  20 63 68 65 63 6b 63 74  | BL      checkct|
000034c0  72 6c 0d 10 d6 42 20 20  20 4c 44 52 4e 45 20 20  |rl...B   LDRNE  |
000034d0  20 72 30 2c 5b 72 31 2c  23 38 5d 20 20 20 20 20  | r0,[r1,#8]     |
000034e0  20 20 3b 20 67 65 74 20  62 75 74 74 6f 6e 73 20  |  ; get buttons |
000034f0  69 66 20 63 74 72 6c 20  6e 6f 74 20 70 72 65 73  |if ctrl not pres|
00003500  73 65 64 8c 0d 10 e0 3a  20 20 20 54 53 54 4e 45  |sed....:   TSTNE|
00003510  20 20 20 72 30 2c 23 26  34 30 20 20 20 20 20 20  |   r0,#&40      |
00003520  20 20 20 20 3b 20 8c 69  73 20 74 68 69 73 20 61  |    ; .is this a|
00003530  20 73 65 6c 65 63 74 20  64 72 61 67 20 3f 0d 10  | select drag ?..|
00003540  ea 39 20 20 20 42 45 51  20 20 20 20 20 5f 5f 7a  |.9   BEQ     __z|
00003550  34 5f 65 78 69 74 20 20  20 20 20 20 20 20 20 20  |4_exit          |
00003560  20 20 3b 20 69 66 20 65  69 74 68 65 72 20 74 68  |  ; if either th|
00003570  65 6e 20 65 78 69 74 0d  10 f4 15 3b 20 20 20 20  |en exit....;    |
00003580  53 57 49 20 20 20 20 20  26 31 30 34 0d 10 fe 25  |SWI     &104...%|
00003590  20 20 20 20 20 20 20 20  20 20 3b 20 22 43 68 65  |          ; "Che|
000035a0  63 6b 69 6e 67 20 64 72  61 67 20 69 73 20 6f 6b  |cking drag is ok|
000035b0  22 0d 11 08 28 20 20 20  4c 44 52 20 20 20 20 20  |"...(   LDR     |
000035c0  72 33 2c 5b 72 31 2c 23  31 32 5d 20 20 20 20 20  |r3,[r1,#12]     |
000035d0  20 3b 20 77 69 6e 64 6f  77 0d 11 12 26 20 20 20  | ; window...&   |
000035e0  4c 44 52 20 20 20 20 20  72 34 2c 5b 72 31 2c 23  |LDR     r4,[r1,#|
000035f0  31 36 5d 20 20 20 20 20  20 3b 20 69 63 6f 6e 0d  |16]      ; icon.|
00003600  11 1c 17 20 20 20 42 4c  20 20 20 20 20 20 69 73  |...   BL      is|
00003610  64 72 61 67 6f 6b 0d 11  26 14 20 20 20 43 4d 50  |dragok..&.   CMP|
00003620  20 20 20 20 20 72 30 2c  23 30 0d 11 30 18 20 20  |     r0,#0..0.  |
00003630  20 42 45 51 20 20 20 20  20 5f 5f 7a 34 5f 65 78  | BEQ     __z4_ex|
00003640  69 74 0d 11 3a 10 2e 5f  5f 7a 34 5f 69 73 64 72  |it..:..__z4_isdr|
00003650  61 67 0d 11 44 20 20 20  20 4c 44 52 20 20 20 20  |ag..D    LDR    |
00003660  20 72 32 2c 5b 72 31 32  2c 23 60 77 69 6e 64 6f  | r2,[r12,#`windo|
00003670  77 5d 0d 11 4e 17 20 20  20 4d 56 4e 20 20 20 20  |w]..N.   MVN    |
00003680  20 72 33 2c 23 ac 20 2d  31 0d 11 58 15 20 20 20  | r3,#. -1..X.   |
00003690  4d 4f 56 20 20 20 20 20  72 30 2c 23 31 39 0d 11  |MOV     r0,#19..|
000036a0  62 3a 20 20 20 53 57 49  20 20 20 20 20 22 58 57  |b:   SWI     "XW|
000036b0  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
000036c0  20 20 3b 20 66 69 6e 64  20 74 68 65 20 74 61 73  |  ; find the tas|
000036d0  6b 20 68 61 6e 64 6c 65  0d 11 6c 18 20 20 20 42  |k handle..l.   B|
000036e0  56 53 20 20 20 20 20 5f  5f 7a 34 5f 65 78 69 74  |VS     __z4_exit|
000036f0  0d 11 76 34 20 20 20 4d  4f 56 20 20 20 20 20 72  |..v4   MOV     r|
00003700  36 2c 72 32 20 20 20 20  20 20 20 20 20 20 20 20  |6,r2            |
00003710  20 20 20 20 3b 20 72 36  3d 74 61 73 6b 20 68 61  |    ; r6=task ha|
00003720  6e 64 6c 65 0d 11 80 37  20 20 20 4d 4f 56 20 20  |ndle...7   MOV  |
00003730  20 20 20 72 38 2c 23 30  20 20 20 20 20 20 20 20  |   r8,#0        |
00003740  20 20 20 20 20 20 20 20  3b 20 72 38 3d 70 6f 69  |        ; r8=poi|
00003750  6e 74 65 72 20 74 6f 20  72 6d 61 0d 11 8a 41 20  |nter to rma...A |
00003760  20 20 4d 4f 56 20 20 20  20 20 72 37 2c 23 30 20  |  MOV     r7,#0 |
00003770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00003780  20 72 37 3d 6c 65 6e 67  74 68 20 6f 66 20 61 72  | r7=length of ar|
00003790  65 61 20 28 30 20 62 79  74 65 73 29 0d 11 94 42  |ea (0 bytes)...B|
000037a0  20 20 20 41 44 52 20 20  20 20 20 72 32 2c 60 74  |   ADR     r2,`t|
000037b0  65 78 74 66 69 6c 65 20  20 20 20 20 20 20 20 20  |extfile         |
000037c0  3b 20 6c 61 72 67 65 20  74 65 78 74 20 66 69 6c  |; large text fil|
000037d0  65 20 69 63 6f 6e 20 74  6f 20 64 72 61 67 0d 11  |e icon to drag..|
000037e0  9e 16 20 20 20 42 4c 20  20 20 20 20 20 73 65 74  |..   BL      set|
000037f0  64 72 61 67 0d 11 a8 16  20 20 20 42 4c 20 20 20  |drag....   BL   |
00003800  20 20 20 61 64 64 6c 69  6e 65 0d 11 b2 15 3b 20  |   addline....; |
00003810  20 20 20 53 57 49 20 20  20 20 20 26 31 30 34 0d  |   SWI     &104.|
00003820  11 bc 30 20 20 20 20 20  20 20 20 20 20 3b 20 22  |..0          ; "|
00003830  49 73 20 6f 6e 65 20 6f  66 20 6f 75 72 20 64 72  |Is one of our dr|
00003840  61 67 20 72 65 71 75 65  73 74 73 21 21 21 22 0d  |ag requests!!!".|
00003850  11 c6 14 20 20 20 4d 4f  56 20 20 20 20 20 72 30  |...   MOV     r0|
00003860  2c 23 31 0d 11 d0 22 20  20 20 53 54 52 20 20 20  |,#1..."   STR   |
00003870  20 20 72 30 2c 5b 72 31  32 2c 23 60 64 72 61 67  |  r0,[r12,#`drag|
00003880  67 69 6e 67 5d 0d 11 da  22 20 20 20 53 54 52 20  |ging]..."   STR |
00003890  20 20 20 20 72 38 2c 5b  72 31 32 2c 23 60 73 61  |    r8,[r12,#`sa|
000038a0  76 65 61 64 64 72 5d 0d  11 e4 21 20 20 20 53 54  |veaddr]...!   ST|
000038b0  52 20 20 20 20 20 72 37  2c 5b 72 31 32 2c 23 60  |R     r7,[r12,#`|
000038c0  73 61 76 65 6c 65 6e 5d  0d 11 ee 34 20 20 20 20  |savelen]...4    |
000038d0  20 20 20 20 20 20 3b 20  22 44 61 74 61 20 69 73  |      ; "Data is|
000038e0  20 6c 65 6e 67 74 68 20  25 72 37 2c 20 63 6f 6e  | length %r7, con|
000038f0  74 61 69 6e 69 6e 67 20  25 24 38 22 0d 11 f8 1c  |taining %$8"....|
00003900  20 20 20 42 20 20 20 20  20 20 20 5f 5f 7a 34 5f  |   B       __z4_|
00003910  6e 6f 61 63 74 69 6f 6e  0d 12 02 12 2e 5f 5f 7a  |noaction.....__z|
00003920  34 5f 6e 6f 61 63 74 69  6f 6e 0d 12 0c 14 20 20  |4_noaction....  |
00003930  20 4d 4f 56 20 20 20 20  20 72 30 2c 23 30 0d 12  | MOV     r0,#0..|
00003940  16 3d 20 20 20 4c 44 4d  46 44 20 20 20 28 73 70  |.=   LDMFD   (sp|
00003950  29 21 2c 7b 72 33 2d 72  39 7d 20 20 20 20 20 20  |)!,{r3-r9}      |
00003960  20 20 20 20 20 20 20 20  3b 20 52 65 73 74 6f 72  |        ; Restor|
00003970  65 20 72 65 67 69 73 74  65 72 73 0d 12 20 3c 20  |e registers.. < |
00003980  20 20 4c 44 4d 46 44 20  20 20 28 73 70 29 21 2c  |  LDMFD   (sp)!,|
00003990  7b 72 31 2d 72 32 2c 70  63 7d 20 20 20 20 20 20  |{r1-r2,pc}      |
000039a0  20 20 20 20 20 3b 20 52  65 74 75 72 6e 20 66 72  |     ; Return fr|
000039b0  6f 6d 20 63 61 6c 6c 0d  12 2a 0e 2e 5f 5f 7a 34  |om call..*..__z4|
000039c0  5f 65 78 69 74 0d 12 34  14 20 20 20 4d 4f 56 20  |_exit..4.   MOV |
000039d0  20 20 20 20 72 30 2c 23  36 0d 12 3e 3d 20 20 20  |    r0,#6..>=   |
000039e0  4c 44 4d 46 44 20 20 20  28 73 70 29 21 2c 7b 72  |LDMFD   (sp)!,{r|
000039f0  33 2d 72 39 7d 20 20 20  20 20 20 20 20 20 20 20  |3-r9}           |
00003a00  20 20 20 3b 20 52 65 73  74 6f 72 65 20 72 65 67  |   ; Restore reg|
00003a10  69 73 74 65 72 73 0d 12  48 3c 20 20 20 4c 44 4d  |isters..H<   LDM|
00003a20  46 44 20 20 20 28 73 70  29 21 2c 7b 72 31 2d 72  |FD   (sp)!,{r1-r|
00003a30  32 2c 70 63 7d 20 20 20  20 20 20 20 20 20 20 20  |2,pc}           |
00003a40  3b 20 52 65 74 75 72 6e  20 66 72 6f 6d 20 63 61  |; Return from ca|
00003a50  6c 6c 0d 12 52 05 3a 0d  12 5c 0e 2e 60 74 65 78  |ll..R.:..\..`tex|
00003a60  74 66 69 6c 65 0d 12 66  1c 20 20 20 45 51 55 53  |tfile..f.   EQUS|
00003a70  20 20 20 20 22 46 69 6c  65 5f 46 46 46 22 2b bd  |    "File_FFF"+.|
00003a80  30 0d 12 70 0f 2e 60 73  6d 61 6c 6c 66 69 6c 65  |0..p..`smallfile|
00003a90  0d 12 7a 1d 20 20 20 45  51 55 53 20 20 20 20 22  |..z.   EQUS    "|
00003aa0  53 6d 61 6c 6c 5f 46 46  46 22 2b bd 30 0d 12 84  |Small_FFF"+.0...|
00003ab0  0c 20 20 20 41 4c 49 47  4e 0d 12 8e 05 3a 0d 12  |.   ALIGN....:..|
00003ac0  98 17 3b 20 73 65 74 20  74 68 65 20 64 72 61 67  |..; set the drag|
00003ad0  20 69 63 6f 6e 0d 12 a2  0c 2e 73 65 74 64 72 61  | icon.....setdra|
00003ae0  67 0d 12 ac 3e 20 20 20  53 54 4d 46 44 20 20 20  |g...>   STMFD   |
00003af0  28 73 70 29 21 2c 7b 72  30 2d 72 35 2c 6c 69 6e  |(sp)!,{r0-r5,lin|
00003b00  6b 7d 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |k}            ; |
00003b10  53 74 61 63 6b 20 72 65  67 69 73 74 65 72 73 0d  |Stack registers.|
00003b20  12 b6 42 20 20 20 43 4d  50 20 20 20 20 20 72 38  |..B   CMP     r8|
00003b30  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
00003b40  20 20 20 3b 20 69 73 20  74 68 65 20 63 75 72 72  |   ; is the curr|
00003b50  65 6e 74 20 70 6f 69 6e  74 65 72 20 73 65 74 20  |ent pointer set |
00003b60  3f 0d 12 c0 47 20 20 20  53 57 49 4e 45 20 20 20  |?...G   SWINE   |
00003b70  22 44 72 61 67 41 53 70  72 69 74 65 5f 53 74 6f  |"DragASprite_Sto|
00003b80  70 22 20 20 20 3b 20 69  66 20 6e 6f 74 20 74 68  |p"   ; if not th|
00003b90  65 6e 20 73 74 6f 70 20  74 68 65 20 63 75 72 72  |en stop the curr|
00003ba0  65 6e 74 20 64 72 61 67  0d 12 ca 1e 20 a4 4c 41  |ent drag.... .LA|
00003bb0  44 44 28 22 20 20 22 2c  31 2c 31 32 2c 60 64 72  |DD("  ",1,12,`dr|
00003bc0  61 67 62 6f 78 29 0d 12  d4 24 20 20 20 53 57 49  |agbox)...$   SWI|
00003bd0  20 20 20 20 20 22 57 69  6d 70 5f 47 65 74 50 6f  |     "Wimp_GetPo|
00003be0  69 6e 74 65 72 49 6e 66  6f 22 0d 12 de 19 20 20  |interInfo"....  |
00003bf0  20 4c 44 4d 49 41 20 20  20 72 31 2c 7b 72 30 2d  | LDMIA   r1,{r0-|
00003c00  72 31 7d 0d 12 e8 3e 20  20 20 53 55 42 20 20 20  |r1}...>   SUB   |
00003c10  20 20 72 30 2c 72 30 2c  23 33 34 20 20 20 20 20  |  r0,r0,#34     |
00003c20  20 20 20 20 20 20 20 3b  20 78 30 3d 78 2d 33 34  |       ; x0=x-34|
00003c30  20 28 bd 20 77 69 64 74  68 20 6f 66 20 62 6f 78  | (. width of box|
00003c40  29 0d 12 f2 3f 20 20 20  53 55 42 20 20 20 20 20  |)...?   SUB     |
00003c50  72 31 2c 72 31 2c 23 33  34 20 20 20 20 20 20 20  |r1,r1,#34       |
00003c60  20 20 20 20 20 3b 20 79  30 3d 79 2d 33 34 20 28  |     ; y0=y-34 (|
00003c70  bd 20 68 65 69 67 68 74  20 6f 66 20 62 6f 78 29  |. height of box)|
00003c80  0d 12 fc 3d 20 20 20 41  44 44 20 20 20 20 20 72  |...=   ADD     r|
00003c90  32 2c 72 30 2c 23 33 34  2a 32 20 20 20 20 20 20  |2,r0,#34*2      |
00003ca0  20 20 20 20 3b 20 78 31  3d 78 30 2b 36 34 20 28  |    ; x1=x0+64 (|
00003cb0  77 69 64 74 68 20 6f 66  20 62 6f 78 29 0d 13 06  |width of box)...|
00003cc0  3e 20 20 20 41 44 44 20  20 20 20 20 72 33 2c 72  |>   ADD     r3,r|
00003cd0  31 2c 23 33 34 2a 32 20  20 20 20 20 20 20 20 20  |1,#34*2         |
00003ce0  20 3b 20 79 31 3d 79 30  2b 36 34 20 28 68 65 69  | ; y1=y0+64 (hei|
00003cf0  67 68 74 20 6f 66 20 62  6f 78 29 0d 13 10 1e 20  |ght of box).... |
00003d00  a4 4c 41 44 44 28 22 20  20 22 2c 35 2c 31 32 2c  |.LADD("  ",5,12,|
00003d10  60 64 72 61 67 62 6f 78  29 0d 13 1a 43 20 20 20  |`dragbox)...C   |
00003d20  53 54 4d 49 41 20 20 20  72 35 2c 7b 72 30 2d 72  |STMIA   r5,{r0-r|
00003d30  33 7d 20 20 20 20 20 20  20 20 20 20 20 3b 20 73  |3}           ; s|
00003d40  74 6f 72 65 20 64 72 61  67 20 62 6f 78 20 69 6e  |tore drag box in|
00003d50  20 62 6c 6f 63 6b 20 69  6e 20 57 53 0d 13 24 34  | block in WS..$4|
00003d60  20 20 20 4c 44 52 20 20  20 20 20 72 32 2c 5b 73  |   LDR     r2,[s|
00003d70  70 2c 23 38 5d 20 20 20  20 20 20 20 20 20 20 20  |p,#8]           |
00003d80  3b 20 72 32 3d 73 70 72  69 74 65 20 6e 61 6d 65  |; r2=sprite name|
00003d90  0d 13 2e 4a 20 20 20 4d  4f 56 20 20 20 20 20 72  |...J   MOV     r|
00003da0  30 2c 23 25 31 31 30 30  30 31 30 31 20 20 20 20  |0,#%11000101    |
00003db0  20 20 20 20 3b 20 63 65  6e 74 72 65 2c 20 63 6f  |    ; centre, co|
00003dc0  6e 73 74 72 61 69 6e 20  70 6f 69 6e 74 65 72 2c  |nstrain pointer,|
00003dd0  20 64 6f 20 73 68 61 64  6f 77 0d 13 38 3a 20 20  | do shadow..8:  |
00003de0  20 4d 4f 56 20 20 20 20  20 72 31 2c 23 31 20 20  | MOV     r1,#1  |
00003df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00003e00  75 73 65 20 57 69 6d 70  20 73 70 72 69 74 65 20  |use Wimp sprite |
00003e10  61 72 65 61 0d 13 42 38  20 20 20 4d 4f 56 20 20  |area..B8   MOV  |
00003e20  20 20 20 72 33 2c 72 35  20 20 20 20 20 20 20 20  |   r3,r5        |
00003e30  20 20 20 20 20 20 20 20  3b 20 72 33 3d 64 72 61  |        ; r3=dra|
00003e40  67 62 6f 78 20 70 6f 69  6e 74 65 72 0d 13 4c 22  |gbox pointer..L"|
00003e50  20 20 20 53 57 49 20 20  20 20 20 22 44 72 61 67  |   SWI     "Drag|
00003e60  41 53 70 72 69 74 65 5f  53 74 61 72 74 22 0d 13  |ASprite_Start"..|
00003e70  56 1f 20 20 20 20 20 20  20 20 20 20 3b 20 22 53  |V.          ; "S|
00003e80  74 61 72 74 69 6e 67 20  64 72 61 67 22 0d 13 60  |tarting drag"..`|
00003e90  3f 20 20 20 4c 44 4d 46  44 20 20 20 28 73 70 29  |?   LDMFD   (sp)|
00003ea0  21 2c 7b 72 30 2d 72 35  2c 70 63 7d 20 20 20 20  |!,{r0-r5,pc}    |
00003eb0  20 20 20 20 20 20 20 20  20 20 3b 20 52 65 74 75  |          ; Retu|
00003ec0  72 6e 20 66 72 6f 6d 20  63 61 6c 6c 0d 13 6a 05  |rn from call..j.|
00003ed0  3a 0d 13 74 09 2e 77 61  69 74 0d 13 7e 3e 20 20  |:..t..wait..~>  |
00003ee0  20 53 54 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  | STMFD   (sp)!,{|
00003ef0  72 30 2d 72 31 2c 6c 69  6e 6b 7d 20 20 20 20 20  |r0-r1,link}     |
00003f00  20 20 20 20 20 20 20 3b  20 53 74 61 63 6b 20 72  |       ; Stack r|
00003f10  65 67 69 73 74 65 72 73  0d 13 88 25 20 20 20 53  |egisters...%   S|
00003f20  57 49 20 20 20 20 20 22  4f 53 5f 52 65 61 64 4d  |WI     "OS_ReadM|
00003f30  6f 6e 6f 74 6f 6e 69 63  54 69 6d 65 22 0d 13 92  |onotonicTime"...|
00003f40  35 20 20 20 41 44 44 20  20 20 20 20 72 31 2c 72  |5   ADD     r1,r|
00003f50  30 2c 23 35 20 20 20 20  20 20 20 20 20 3b 20 72  |0,#5         ; r|
00003f60  31 3d 74 69 6d 65 20 6e  6f 77 20 2b 20 64 65 6c  |1=time now + del|
00003f70  61 79 0d 13 9c 0e 2e 5f  5f 7a 35 5f 6c 6f 6f 70  |ay.....__z5_loop|
00003f80  0d 13 a6 25 20 20 20 53  57 49 20 20 20 20 20 22  |...%   SWI     "|
00003f90  4f 53 5f 52 65 61 64 4d  6f 6e 6f 74 6f 6e 69 63  |OS_ReadMonotonic|
00003fa0  54 69 6d 65 22 0d 13 b0  3a 20 20 20 43 4d 50 20  |Time"...:   CMP |
00003fb0  20 20 20 20 72 30 2c 72  31 20 20 20 20 20 20 20  |    r0,r1       |
00003fc0  20 20 20 20 20 3b 20 68  61 76 65 20 77 65 20 65  |     ; have we e|
00003fd0  78 63 65 65 64 65 64 20  64 65 6c 61 79 20 3f 0d  |xceeded delay ?.|
00003fe0  13 ba 40 20 20 20 42 4c  54 20 20 20 20 20 5f 5f  |..@   BLT     __|
00003ff0  7a 35 5f 6c 6f 6f 70 20  20 20 20 20 20 20 20 20  |z5_loop         |
00004000  20 20 20 3b 20 69 66 20  6e 6f 74 20 74 68 65 6e  |   ; if not then|
00004010  20 6b 65 65 70 20 63 68  65 63 6b 69 6e 67 8c 0d  | keep checking..|
00004020  13 c4 3f 20 20 20 4c 44  4d 46 44 20 20 20 28 73  |..?   LDMFD   (s|
00004030  70 29 21 2c 7b 72 30 2d  72 31 2c 70 63 7d 20 20  |p)!,{r0-r1,pc}  |
00004040  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 52 65  |            ; Re|
00004050  74 75 72 6e 20 66 72 6f  6d 20 63 61 6c 6c 0d 13  |turn from call..|
00004060  ce 05 3a 0d 13 d8 36 3b  20 41 64 64 20 61 20 6c  |..:...6; Add a l|
00004070  69 6e 65 20 66 72 6f 6d  20 74 68 65 20 69 63 6f  |ine from the ico|
00004080  6e 20 70 6f 69 6e 74 65  64 20 74 6f 20 62 79 20  |n pointed to by |
00004090  74 68 65 20 62 6c 6f 63  6b 0d 13 e2 0c 2e 61 64  |the block.....ad|
000040a0  64 6c 69 6e 65 0d 13 ec  3e 20 20 20 53 54 4d 46  |dline...>   STMF|
000040b0  44 20 20 20 28 73 70 29  21 2c 7b 72 30 2d 72 35  |D   (sp)!,{r0-r5|
000040c0  2c 6c 69 6e 6b 7d 20 20  20 20 20 20 20 20 20 20  |,link}          |
000040d0  20 20 3b 20 53 74 61 63  6b 20 72 65 67 69 73 74  |  ; Stack regist|
000040e0  65 72 73 0d 13 f6 1d 20  20 20 4c 44 52 20 20 20  |ers....   LDR   |
000040f0  20 20 72 30 2c 5b 72 31  32 2c 23 60 73 74 72 5d  |  r0,[r12,#`str]|
00004100  0d 14 00 19 20 20 20 20  20 20 20 20 20 20 3b 20  |....          ; |
00004110  72 30 3d 73 74 72 69 6e  67 0d 14 0a 45 20 20 20  |r0=string...E   |
00004120  42 4c 20 20 20 20 20 20  6c 65 6e 63 74 72 6c 20  |BL      lenctrl |
00004130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004140  20 20 20 20 20 20 3b 20  68 6f 77 20 6c 6f 6e 67  |      ; how long|
00004150  20 69 73 20 74 68 65 20  73 74 72 69 6e 67 0d 14  | is the string..|
00004160  14 3c 20 20 20 20 20 20  20 20 20 20 3b 20 22 43  |.<          ; "C|
00004170  68 65 63 6b 69 6e 67 20  6c 65 6e 67 74 68 20 3d  |hecking length =|
00004180  20 25 72 31 2c 20 63 75  72 72 65 6e 74 20 62 6c  | %r1, current bl|
00004190  6f 63 6b 20 3d 20 25 26  38 22 0d 14 1e 26 3b 20  |ock = %&8"...&; |
000041a0  20 20 20 f4 20 20 20 20  20 22 53 74 72 69 6e 67  |   .     "String|
000041b0  20 6c 6f 63 61 74 65 64  20 61 74 20 25 26 30 22  | located at %&0"|
000041c0  0d 14 28 41 3b 20 20 20  20 4c 44 4d 46 44 20 20  |..(A;    LDMFD  |
000041d0  20 28 73 70 29 21 2c 7b  72 30 2d 72 35 2c 70 63  | (sp)!,{r0-r5,pc|
000041e0  7d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |}              ;|
000041f0  20 52 65 74 75 72 6e 20  66 72 6f 6d 20 63 61 6c  | Return from cal|
00004200  6c 0d 14 32 05 3b 0d 14  3c 47 20 20 20 43 4d 50  |l..2.;..<G   CMP|
00004210  20 20 20 20 20 72 38 2c  23 30 20 20 20 20 20 20  |     r8,#0      |
00004220  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004230  20 20 20 3b 20 69 73 20  74 68 69 73 20 74 68 65  |   ; is this the|
00004240  20 66 69 72 73 74 20 63  61 6c 6c 20 3f 0d 14 46  | first call ?..F|
00004250  46 20 20 20 ec 51 20 20  20 72 30 2c 23 36 20 20  |F   .Q   r0,#6  |
00004260  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004270  20 20 20 20 20 20 20 3b  20 69 66 20 73 6f 20 74  |       ; if so t|
00004280  68 65 6e 20 63 6c 61 69  6d 20 6e 65 77 20 62 6c  |hen claim new bl|
00004290  6f 63 6b 0d 14 50 42 20  20 20 4d 4f 56 4e 45 20  |ock..PB   MOVNE |
000042a0  20 20 72 30 2c 23 31 33  20 20 20 20 20 20 20 20  |  r0,#13        |
000042b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000042c0  3b 20 6f 74 68 65 72 77  69 73 65 20 65 78 74 65  |; otherwise exte|
000042d0  6e 64 20 69 74 0d 14 5a  14 20 20 20 4d 4f 56 4e  |nd it..Z.   MOVN|
000042e0  45 20 20 20 72 32 2c 72  38 0d 14 64 48 20 20 20  |E   r2,r8..dH   |
000042f0  4d 4f 56 20 20 20 20 20  72 33 2c 72 31 20 20 20  |MOV     r3,r1   |
00004300  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004310  20 20 20 20 20 20 3b 20  72 33 3d 61 6d 6f 75 6e  |      ; r3=amoun|
00004320  74 20 74 6f 20 63 6c 61  69 6d 2f 65 78 74 65 6e  |t to claim/exten|
00004330  64 0d 14 6e 44 20 20 20  41 44 44 20 20 20 20 20  |d..nD   ADD     |
00004340  72 33 2c 72 31 2c 23 31  20 20 20 20 20 20 20 20  |r3,r1,#1        |
00004350  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00004360  61 64 64 20 65 78 74 72  61 20 62 79 74 65 20 66  |add extra byte f|
00004370  6f 72 20 4c 46 0d 14 78  3b 20 20 20 53 57 49 20  |or LF..x;   SWI |
00004380  20 20 20 20 22 4f 53 5f  4d 6f 64 75 6c 65 22 20  |    "OS_Module" |
00004390  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000043a0  20 20 3b 20 63 6c 61 69  6d 2f 65 78 74 65 6e 64  |  ; claim/extend|
000043b0  0d 14 82 42 20 20 20 4d  4f 56 20 20 20 20 20 72  |...B   MOV     r|
000043c0  38 2c 72 32 20 20 20 20  20 20 20 20 20 20 20 20  |8,r2            |
000043d0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 72  |             ; r|
000043e0  38 3d 6e 65 77 20 61 72  65 61 20 70 6f 69 6e 74  |8=new area point|
000043f0  65 72 0d 14 8c 46 20 20  20 41 44 44 20 20 20 20  |er...F   ADD    |
00004400  20 72 31 2c 72 32 2c 72  37 20 20 20 20 20 20 20  | r1,r2,r7       |
00004410  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00004420  20 72 32 3d 65 6e 64 20  6f 66 20 70 72 65 76 69  | r2=end of previ|
00004430  6f 75 73 20 61 72 65 61  0d 14 96 1d 20 20 20 4c  |ous area....   L|
00004440  44 52 20 20 20 20 20 72  30 2c 5b 72 31 32 2c 23  |DR     r0,[r12,#|
00004450  60 73 74 72 5d 0d 14 a0  2c 20 20 20 20 20 20 20  |`str]...,       |
00004460  20 20 20 3b 20 72 30 3d  70 6f 69 6e 74 65 72 20  |   ; r0=pointer |
00004470  74 6f 20 73 74 72 69 6e  67 20 74 6f 20 63 6f 70  |to string to cop|
00004480  79 0d 14 aa 23 20 20 20  20 20 20 20 20 20 20 3b  |y...#          ;|
00004490  20 22 4d 6f 76 69 6e 67  20 25 26 30 20 74 6f 20  | "Moving %&0 to |
000044a0  25 26 31 22 0d 14 b4 46  20 20 20 42 4c 20 20 20  |%&1"...F   BL   |
000044b0  20 20 20 6d 6f 76 65 63  74 72 6c 20 20 20 20 20  |   movectrl     |
000044c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000044d0  20 3b 20 63 6f 70 79 20  69 74 20 74 6f 20 74 68  | ; copy it to th|
000044e0  65 20 6e 65 77 20 61 72  65 61 0d 14 be 47 20 20  |e new area...G  |
000044f0  20 41 44 44 20 20 20 20  20 72 37 2c 72 37 2c 72  | ADD     r7,r7,r|
00004500  33 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |3               |
00004510  20 20 20 20 20 20 20 3b  20 69 6e 63 72 65 6d 65  |       ; increme|
00004520  6e 74 20 61 6d 6f 75 6e  74 20 74 6f 20 63 6f 70  |nt amount to cop|
00004530  79 0d 14 c8 48 20 20 20  4d 4f 56 20 20 20 20 20  |y...H   MOV     |
00004540  72 30 2c 23 31 30 20 20  20 20 20 20 20 20 20 20  |r0,#10          |
00004550  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00004560  4c 46 20 74 6f 20 61 64  64 20 74 6f 20 65 6e 64  |LF to add to end|
00004570  20 6f 66 20 6c 69 6e 65  21 0d 14 d2 41 20 20 20  | of line!...A   |
00004580  53 55 42 20 20 20 20 20  72 31 2c 72 37 2c 23 31  |SUB     r1,r7,#1|
00004590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000045a0  20 20 20 20 20 20 3b 20  73 74 6f 72 65 20 61 73  |      ; store as|
000045b0  20 6c 61 73 74 20 62 79  74 65 0d 14 dc 42 20 20  | last byte...B  |
000045c0  20 53 54 52 42 20 20 20  20 72 30 2c 5b 72 38 2c  | STRB    r0,[r8,|
000045d0  72 31 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |r1]             |
000045e0  20 20 20 20 20 20 20 3b  20 61 6e 64 20 73 74 6f  |       ; and sto|
000045f0  72 65 20 69 6e 20 6d 65  6d 6f 72 79 0d 14 e6 3f  |re in memory...?|
00004600  20 20 20 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |   LDMFD   (sp)!|
00004610  2c 7b 72 30 2d 72 35 2c  70 63 7d 20 20 20 20 20  |,{r0-r5,pc}     |
00004620  20 20 20 20 20 20 20 20  20 3b 20 52 65 74 75 72  |         ; Retur|
00004630  6e 20 66 72 6f 6d 20 63  61 6c 6c 0d 14 f0 05 3a  |n from call....:|
00004640  0d 14 fa 0f 2e 69 73 64  72 61 67 64 6f 6e 65 0d  |.....isdragdone.|
00004650  15 04 3e 20 20 20 53 54  4d 46 44 20 20 20 28 73  |..>   STMFD   (s|
00004660  70 29 21 2c 7b 72 33 2d  72 39 7d 20 20 20 20 20  |p)!,{r3-r9}     |
00004670  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 53 74  |            ; St|
00004680  61 63 6b 20 72 65 67 69  73 74 65 72 73 0d 15 0e  |ack registers...|
00004690  22 20 20 20 4c 44 52 20  20 20 20 20 72 30 2c 5b  |"   LDR     r0,[|
000046a0  72 31 32 2c 23 60 64 72  61 67 67 69 6e 67 5d 0d  |r12,#`dragging].|
000046b0  15 18 14 20 20 20 43 4d  50 20 20 20 20 20 72 30  |...   CMP     r0|
000046c0  2c 23 31 0d 15 22 14 20  20 20 43 4d 50 4e 45 20  |,#1..".   CMPNE |
000046d0  20 20 72 30 2c 23 33 0d  15 2c 18 20 20 20 42 4e  |  r0,#3..,.   BN|
000046e0  45 20 20 20 20 20 5f 5f  7a 36 5f 65 78 69 74 0d  |E     __z6_exit.|
000046f0  15 36 2d 20 20 20 20 20  20 20 20 20 20 3b 20 22  |.6-          ; "|
00004700  25 63 30 34 44 72 61 67  20 64 6f 6e 65 2c 20 69  |%c04Drag done, i|
00004710  6e 20 73 74 61 74 65 20  25 72 30 22 0d 15 40 21  |n state %r0"..@!|
00004720  20 20 20 53 57 49 20 20  20 20 20 22 44 72 61 67  |   SWI     "Drag|
00004730  41 53 70 72 69 74 65 5f  53 74 6f 70 22 0d 15 4a  |ASprite_Stop"..J|
00004740  24 20 20 20 53 57 49 20  20 20 20 20 22 57 69 6d  |$   SWI     "Wim|
00004750  70 5f 47 65 74 50 6f 69  6e 74 65 72 49 6e 66 6f  |p_GetPointerInfo|
00004760  22 0d 15 54 22 20 20 20  4c 44 4d 49 41 20 20 20  |"..T"   LDMIA   |
00004770  72 31 2c 7b 72 32 2c 72  33 2c 72 34 2c 72 35 2c  |r1,{r2,r3,r4,r5,|
00004780  72 36 7d 0d 15 5e 14 20  20 20 20 20 20 20 20 20  |r6}..^.         |
00004790  20 3b 20 22 25 52 22 0d  15 68 2a 20 20 20 53 54  | ; "%R"..h*   ST|
000047a0  52 20 20 20 20 20 72 35  2c 5b 72 31 2c 23 32 30  |R     r5,[r1,#20|
000047b0  5d 20 20 20 20 20 20 3b  20 73 74 6f 72 65 20 6d  |]      ; store m|
000047c0  78 0d 15 72 2a 20 20 20  53 54 52 20 20 20 20 20  |x..r*   STR     |
000047d0  72 36 2c 5b 72 31 2c 23  32 34 5d 20 20 20 20 20  |r6,[r1,#24]     |
000047e0  20 3b 20 73 74 6f 72 65  20 6d 79 0d 15 7c 2a 20  | ; store my..|* |
000047f0  20 20 53 54 52 20 20 20  20 20 72 32 2c 5b 72 31  |  STR     r2,[r1|
00004800  2c 23 32 38 5d 20 20 20  20 20 20 3b 20 73 74 6f  |,#28]      ; sto|
00004810  72 65 20 6d 77 0d 15 86  2a 20 20 20 53 54 52 20  |re mw...*   STR |
00004820  20 20 20 20 72 33 2c 5b  72 31 2c 23 33 32 5d 20  |    r3,[r1,#32] |
00004830  20 20 20 20 20 3b 20 73  74 6f 72 65 20 6d 69 0d  |     ; store mi.|
00004840  15 90 2e 20 20 20 4d 4f  56 20 20 20 20 20 72 32  |...   MOV     r2|
00004850  2c 23 35 36 20 20 20 20  20 20 20 20 20 20 20 3b  |,#56           ;|
00004860  20 62 6c 6f 63 6b 20 6c  65 6e 67 74 68 0d 15 9a  | block length...|
00004870  24 20 20 20 4d 4f 56 20  20 20 20 20 72 33 2c 23  |$   MOV     r3,#|
00004880  30 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 74  |0            ; t|
00004890  6f 0d 15 a4 25 20 20 20  4d 4f 56 20 20 20 20 20  |o...%   MOV     |
000048a0  72 34 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |r4,#0           |
000048b0  20 3b 20 72 65 66 0d 15  ae 25 20 20 20 4d 4f 56  | ; ref...%   MOV|
000048c0  20 20 20 20 20 72 35 2c  23 30 20 20 20 20 20 20  |     r5,#0      |
000048d0  20 20 20 20 20 20 3b 20  72 65 66 0d 15 b8 29 20  |      ; ref...) |
000048e0  20 20 4d 4f 56 20 20 20  20 20 72 36 2c 23 31 20  |  MOV     r6,#1 |
000048f0  20 20 20 20 20 20 20 20  20 20 20 3b 20 6d 65 73  |           ; mes|
00004900  73 61 67 65 0d 15 c2 30  20 20 20 53 54 4d 49 41  |sage...0   STMIA|
00004910  20 20 20 72 31 2c 7b 72  32 2d 72 36 7d 20 20 20  |   r1,{r2-r6}   |
00004920  20 20 20 20 3b 20 73 74  6f 72 65 20 69 6e 20 62  |    ; store in b|
00004930  6c 6f 63 6b 0d 15 cc 3d  20 20 20 41 44 52 20 20  |lock...=   ADR  |
00004940  20 20 20 72 30 2c 60 65  73 74 6c 65 6e 20 20 20  |   r0,`estlen   |
00004950  20 20 20 20 3b 20 61 64  64 72 65 73 73 20 6f 66  |    ; address of|
00004960  20 65 73 74 69 6d 61 74  65 64 20 6c 65 6e 67 74  | estimated lengt|
00004970  68 0d 15 d6 19 20 20 20  4c 44 4d 49 41 20 20 20  |h....   LDMIA   |
00004980  72 30 2c 7b 72 32 2d 72  36 7d 0d 15 e0 18 20 20  |r0,{r2-r6}....  |
00004990  20 41 44 44 20 20 20 20  20 72 30 2c 72 31 2c 23  | ADD     r0,r1,#|
000049a0  33 36 0d 15 ea 31 20 20  20 53 54 4d 49 41 20 20  |36...1   STMIA  |
000049b0  20 72 30 2c 7b 72 32 2d  72 36 7d 20 20 20 20 20  | r0,{r2-r6}     |
000049c0  20 20 3b 20 63 6f 70 79  20 69 6e 74 6f 20 62 6c  |  ; copy into bl|
000049d0  6f 63 6b 0d 15 f4 39 20  20 20 4d 4f 56 20 20 20  |ock...9   MOV   |
000049e0  20 20 72 30 2c 23 31 38  20 20 20 20 20 20 20 20  |  r0,#18        |
000049f0  20 20 20 3b 20 73 65 6e  64 20 72 65 63 6f 72 64  |   ; send record|
00004a00  65 64 20 64 65 6c 69 76  65 72 79 8c 0d 15 fe 37  |ed delivery....7|
00004a10  20 20 20 4c 44 52 20 20  20 20 20 72 32 2c 5b 72  |   LDR     r2,[r|
00004a20  31 2c 23 32 30 5d 20 20  20 20 20 20 3b 20 67 65  |1,#20]      ; ge|
00004a30  74 20 77 69 6e 64 6f 77  20 74 6f 20 73 65 6e 64  |t window to send|
00004a40  20 74 6f 0d 16 08 35 20  20 20 4c 44 52 20 20 20  | to...5   LDR   |
00004a50  20 20 72 33 2c 5b 72 31  2c 23 32 34 5d 20 20 20  |  r3,[r1,#24]   |
00004a60  20 20 20 3b 20 67 65 74  20 69 63 6f 6e 20 74 6f  |   ; get icon to|
00004a70  20 73 65 6e 64 20 74 6f  0d 16 12 20 20 20 20 20  | send to...     |
00004a80  20 20 20 20 20 20 3b 20  22 53 65 6e 64 69 6e 67  |      ; "Sending|
00004a90  20 74 6f 20 25 26 32 22  0d 16 1c 22 20 20 20 53  | to %&2"..."   S|
00004aa0  57 49 20 20 20 20 20 22  58 57 69 6d 70 5f 53 65  |WI     "XWimp_Se|
00004ab0  6e 64 4d 65 73 73 61 67  65 22 0d 16 26 37 20 20  |ndMessage"..&7  |
00004ac0  20 4d 4f 56 56 53 20 20  20 72 30 2c 23 30 20 20  | MOVVS   r0,#0  |
00004ad0  20 20 20 20 20 20 20 20  20 20 3b 20 6e 6f 74 20  |          ; not |
00004ae0  64 72 61 67 67 69 6e 67  20 69 66 20 65 72 72 6f  |dragging if erro|
00004af0  72 0d 16 30 4a 20 20 20  4d 4f 56 56 43 20 20 20  |r..0J   MOVVC   |
00004b00  72 30 2c 23 32 20 20 20  20 20 20 20 20 20 20 20  |r0,#2           |
00004b10  20 3b 20 69 66 20 6e 6f  20 65 72 72 6f 72 20 74  | ; if no error t|
00004b20  68 65 6e 20 6f 6e 20 74  6f 20 73 61 76 65 20 64  |hen on to save d|
00004b30  61 74 61 20 6d 65 73 73  61 67 65 0d 16 3a 22 20  |ata message..:" |
00004b40  20 20 53 54 52 20 20 20  20 20 72 30 2c 5b 72 31  |  STR     r0,[r1|
00004b50  32 2c 23 60 64 72 61 67  67 69 6e 67 5d 0d 16 44  |2,#`dragging]..D|
00004b60  28 20 20 20 20 20 20 20  20 20 20 3b 20 22 4d 65  |(          ; "Me|
00004b70  73 73 61 67 65 20 73 65  6e 74 2c 20 6f 6b 20 3d  |ssage sent, ok =|
00004b80  20 25 72 30 22 0d 16 4e  12 2e 5f 5f 7a 36 5f 6e  | %r0"..N..__z6_n|
00004b90  6f 61 63 74 69 6f 6e 0d  16 58 14 20 20 20 4d 4f  |oaction..X.   MO|
00004ba0  56 20 20 20 20 20 72 30  2c 23 30 0d 16 62 3f 20  |V     r0,#0..b? |
00004bb0  20 20 4c 44 4d 46 44 20  20 20 28 73 70 29 21 2c  |  LDMFD   (sp)!,|
00004bc0  7b 72 31 2d 72 39 2c 70  63 7d 20 20 20 20 20 20  |{r1-r9,pc}      |
00004bd0  20 20 20 20 20 20 20 20  3b 20 52 65 74 75 72 6e  |        ; Return|
00004be0  20 66 72 6f 6d 20 63 61  6c 6c 0d 16 6c 0e 2e 5f  | from call..l.._|
00004bf0  5f 7a 36 5f 65 78 69 74  0d 16 76 14 20 20 20 4d  |_z6_exit..v.   M|
00004c00  4f 56 20 20 20 20 20 72  30 2c 23 37 0d 16 80 3f  |OV     r0,#7...?|
00004c10  20 20 20 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |   LDMFD   (sp)!|
00004c20  2c 7b 72 31 2d 72 39 2c  70 63 7d 20 20 20 20 20  |,{r1-r9,pc}     |
00004c30  20 20 20 20 20 20 20 20  20 3b 20 52 65 74 75 72  |         ; Retur|
00004c40  6e 20 66 72 6f 6d 20 63  61 6c 6c 0d 16 8a 05 3a  |n from call....:|
00004c50  0d 16 94 0c 2e 60 65 73  74 6c 65 6e 0d 16 9e 21  |.....`estlen...!|
00004c60  20 20 20 45 51 55 44 20  20 20 20 2d 31 20 3b 20  |   EQUD    -1 ; |
00004c70  64 61 74 61 20 6e 6f 74  20 73 61 66 65 0d 16 a8  |data not safe...|
00004c80  0e 2e 60 74 65 78 74 74  79 70 65 0d 16 b2 13 20  |..`texttype.... |
00004c90  20 20 45 51 55 44 20 20  20 20 26 46 46 46 0d 16  |  EQUD    &FFF..|
00004ca0  bc 0e 2e 60 73 61 76 65  6e 61 6d 65 0d 16 c6 1c  |...`savename....|
00004cb0  20 20 20 45 51 55 53 20  20 20 20 22 49 63 6f 6e  |   EQUS    "Icon|
00004cc0  74 65 78 74 22 2b bd 30  0d 16 d0 05 3a 0d 16 da  |text"+.0....:...|
00004cd0  13 2e 63 68 65 63 6b 6e  75 6c 6c 65 76 65 6e 74  |..checknullevent|
00004ce0  0d 16 e4 22 20 20 20 4c  44 52 20 20 20 20 20 72  |..."   LDR     r|
00004cf0  32 2c 5b 72 31 32 2c 23  60 64 72 61 67 67 69 6e  |2,[r12,#`draggin|
00004d00  67 5d 0d 16 ee 2d 20 20  20 20 20 20 20 20 20 20  |g]...-          |
00004d10  3b 20 22 25 63 30 34 25  63 33 30 43 75 72 72 65  |; "%c04%c30Curre|
00004d20  6e 74 20 73 74 61 74 65  20 3d 20 25 72 32 22 0d  |nt state = %r2".|
00004d30  16 f8 14 20 20 20 43 4d  50 20 20 20 20 20 72 32  |...   CMP     r2|
00004d40  2c 23 31 0d 17 02 1a 20  20 20 42 45 51 20 20 20  |,#1....   BEQ   |
00004d50  20 20 69 73 6e 75 6c 6c  65 76 65 6e 74 0d 17 0c  |  isnullevent...|
00004d60  14 20 20 20 43 4d 50 20  20 20 20 20 72 32 2c 23  |.   CMP     r2,#|
00004d70  33 0d 17 16 44 20 20 20  4c 44 4d 4e 45 46 44 20  |3...D   LDMNEFD |
00004d80  28 73 70 29 21 2c 7b 72  31 2d 72 32 2c 70 63 7d  |(sp)!,{r1-r2,pc}|
00004d90  20 20 20 20 20 20 20 20  20 3b 20 72 65 74 75 72  |         ; retur|
00004da0  6e 20 69 66 20 6e 6f 74  20 61 20 73 6d 61 6c 6c  |n if not a small|
00004db0  20 64 72 61 67 0d 17 20  39 20 20 20 53 54 4d 46  | drag.. 9   STMF|
00004dc0  44 20 20 20 28 73 70 29  21 2c 7b 72 33 2d 72 39  |D   (sp)!,{r3-r9|
00004dd0  7d 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 53  |}            ; S|
00004de0  74 61 63 6b 20 72 65 67  69 73 74 65 72 73 0d 17  |tack registers..|
00004df0  2a 1f 20 a4 4c 41 44 44  28 22 20 20 22 2c 31 2c  |*. .LADD("  ",1,|
00004e00  31 32 2c 60 70 74 72 62  6c 6f 63 6b 29 0d 17 34  |12,`ptrblock)..4|
00004e10  24 20 20 20 53 57 49 20  20 20 20 20 22 57 69 6d  |$   SWI     "Wim|
00004e20  70 5f 47 65 74 50 6f 69  6e 74 65 72 49 6e 66 6f  |p_GetPointerInfo|
00004e30  22 0d 17 3e 20 20 20 20  4c 44 52 20 20 20 20 20  |"..>    LDR     |
00004e40  72 30 2c 5b 72 31 32 2c  23 60 6d 6f 75 73 65 62  |r0,[r12,#`mouseb|
00004e50  5d 0d 17 48 14 20 20 20  54 53 54 20 20 20 20 20  |]..H.   TST     |
00004e60  72 30 2c 23 34 0d 17 52  50 20 20 20 42 45 51 20  |r0,#4..RP   BEQ |
00004e70  20 20 20 20 5f 5f 7a 37  5f 64 72 6f 70 70 65 64  |    __z7_dropped|
00004e80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004e90  20 3b 20 69 66 20 79 6f  75 20 64 72 6f 70 2c 20  | ; if you drop, |
00004ea0  62 75 74 20 73 74 69 6c  6c 20 68 6f 6c 64 20 61  |but still hold a|
00004eb0  64 6a 75 73 74 0d 17 5c  32 20 20 20 54 53 54 20  |djust..\2   TST |
00004ec0  20 20 20 20 72 30 2c 23  31 20 20 20 20 20 20 20  |    r0,#1       |
00004ed0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 61  |             ; a|
00004ee0  64 6a 75 73 74 20 3f 0d  17 66 48 20 20 20 42 4e  |djust ?..fH   BN|
00004ef0  45 20 20 20 20 20 5f 5f  7a 37 5f 65 78 69 74 20  |E     __z7_exit |
00004f00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004f10  20 20 20 3b 20 69 66 20  73 74 69 6c 6c 20 70 72  |   ; if still pr|
00004f20  65 73 73 65 64 20 74 68  65 6e 20 65 78 69 74 0d  |essed then exit.|
00004f30  17 70 13 20 20 20 42 4c  20 20 20 20 20 20 77 61  |.p.   BL      wa|
00004f40  69 74 0d 17 7a 22 20 20  20 4c 44 52 20 20 20 20  |it..z"   LDR    |
00004f50  20 72 38 2c 5b 72 31 32  2c 23 60 73 61 76 65 61  | r8,[r12,#`savea|
00004f60  64 64 72 5d 0d 17 84 20  20 20 20 20 20 20 20 20  |ddr]...         |
00004f70  20 20 3b 20 67 65 74 20  73 61 76 65 20 61 64 64  |  ; get save add|
00004f80  72 65 73 73 0d 17 8e 3c  20 20 20 41 44 52 20 20  |ress...<   ADR  |
00004f90  20 20 20 72 32 2c 60 74  65 78 74 66 69 6c 65 20  |   r2,`textfile |
00004fa0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 73 77  |            ; sw|
00004fb0  61 70 20 62 61 63 6b 20  74 6f 20 62 69 67 67 79  |ap back to biggy|
00004fc0  0d 17 98 16 20 20 20 42  4c 20 20 20 20 20 20 73  |....   BL      s|
00004fd0  65 74 64 72 61 67 0d 17  a2 14 20 20 20 4d 4f 56  |etdrag....   MOV|
00004fe0  20 20 20 20 20 72 30 2c  23 31 0d 17 ac 22 20 20  |     r0,#1..."  |
00004ff0  20 53 54 52 20 20 20 20  20 72 30 2c 5b 72 31 32  | STR     r0,[r12|
00005000  2c 23 60 64 72 61 67 67  69 6e 67 5d 0d 17 b6 14  |,#`dragging]....|
00005010  20 20 20 4d 4f 56 20 20  20 20 20 72 30 2c 23 30  |   MOV     r0,#0|
00005020  0d 17 c0 0e 2e 5f 5f 7a  37 5f 65 78 69 74 0d 17  |.....__z7_exit..|
00005030  ca 1c 20 20 20 4c 44 4d  46 44 20 20 20 28 73 70  |..   LDMFD   (sp|
00005040  29 21 2c 7b 72 33 2d 72  39 7d 0d 17 d4 3a 20 20  |)!,{r3-r9}...:  |
00005050  20 4c 44 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  | LDMFD   (sp)!,{|
00005060  72 31 2d 72 32 2c 70 63  7d 20 20 20 20 20 20 20  |r1-r2,pc}       |
00005070  20 20 3b 20 52 65 74 75  72 6e 20 66 72 6f 6d 20  |  ; Return from |
00005080  63 61 6c 6c 0d 17 de 11  2e 5f 5f 7a 37 5f 64 72  |call.....__z7_dr|
00005090  6f 70 70 65 64 0d 17 e8  1c 20 20 20 4c 44 4d 46  |opped....   LDMF|
000050a0  44 20 20 20 28 73 70 29  21 2c 7b 72 33 2d 72 39  |D   (sp)!,{r3-r9|
000050b0  7d 0d 17 f2 14 20 20 20  4d 4f 56 20 20 20 20 20  |}....   MOV     |
000050c0  72 30 2c 23 30 0d 17 fc  19 20 20 20 42 20 20 20  |r0,#0....   B   |
000050d0  20 20 20 20 69 73 64 72  61 67 64 6f 6e 65 0d 18  |    isdragdone..|
000050e0  06 05 3a 0d 18 10 10 2e  69 73 6e 75 6c 6c 65 76  |..:.....isnullev|
000050f0  65 6e 74 0d 18 1a 39 20  20 20 53 54 4d 46 44 20  |ent...9   STMFD |
00005100  20 20 28 73 70 29 21 2c  7b 72 33 2d 72 39 7d 20  |  (sp)!,{r3-r9} |
00005110  20 20 20 20 20 20 20 20  20 20 20 3b 20 53 74 61  |           ; Sta|
00005120  63 6b 20 72 65 67 69 73  74 65 72 73 0d 18 24 23  |ck registers..$#|
00005130  20 20 20 53 54 52 20 20  20 20 20 72 31 2c 5b 72  |   STR     r1,[r|
00005140  31 32 2c 23 60 75 73 65  72 62 6c 6f 63 6b 5d 0d  |12,#`userblock].|
00005150  18 2e 1f 20 a4 4c 41 44  44 28 22 20 20 22 2c 31  |... .LADD("  ",1|
00005160  2c 31 32 2c 60 70 74 72  62 6c 6f 63 6b 29 0d 18  |,12,`ptrblock)..|
00005170  38 24 20 20 20 53 57 49  20 20 20 20 20 22 57 69  |8$   SWI     "Wi|
00005180  6d 70 5f 47 65 74 50 6f  69 6e 74 65 72 49 6e 66  |mp_GetPointerInf|
00005190  6f 22 0d 18 42 20 20 20  20 4c 44 52 20 20 20 20  |o"..B    LDR    |
000051a0  20 72 30 2c 5b 72 31 32  2c 23 60 6d 6f 75 73 65  | r0,[r12,#`mouse|
000051b0  62 5d 0d 18 4c 32 20 20  20 54 53 54 20 20 20 20  |b]..L2   TST    |
000051c0  20 72 30 2c 23 31 20 20  20 20 20 20 20 20 20 20  | r0,#1          |
000051d0  20 20 20 20 20 20 20 20  20 20 3b 20 61 64 6a 75  |          ; adju|
000051e0  73 74 20 3f 0d 18 56 18  20 20 20 42 45 51 20 20  |st ?..V.   BEQ  |
000051f0  20 20 20 5f 5f 7a 38 5f  65 78 69 74 0d 18 60 20  |   __z8_exit..` |
00005200  20 20 20 4c 44 52 20 20  20 20 20 72 33 2c 5b 72  |   LDR     r3,[r|
00005210  31 32 2c 23 60 6d 6f 75  73 65 77 5d 0d 18 6a 20  |12,#`mousew]..j |
00005220  20 20 20 4c 44 52 20 20  20 20 20 72 34 2c 5b 72  |   LDR     r4,[r|
00005230  31 32 2c 23 60 6d 6f 75  73 65 69 5d 0d 18 74 17  |12,#`mousei]..t.|
00005240  20 20 20 42 4c 20 20 20  20 20 20 69 73 64 72 61  |   BL      isdra|
00005250  67 6f 6b 0d 18 7e 45 20  20 20 43 4d 50 20 20 20  |gok..~E   CMP   |
00005260  20 20 72 30 2c 23 30 20  20 20 20 20 20 20 20 20  |  r0,#0         |
00005270  20 20 20 20 20 20 20 20  20 20 20 3b 20 69 73 20  |           ; is |
00005280  69 74 20 61 20 76 61 6c  69 64 20 69 63 6f 6e 20  |it a valid icon |
00005290  74 6f 20 61 64 64 20 3f  0d 18 88 18 20 20 20 42  |to add ?....   B|
000052a0  45 51 20 20 20 20 20 5f  5f 7a 38 5f 65 78 69 74  |EQ     __z8_exit|
000052b0  0d 18 92 42 20 20 20 4d  4f 56 20 20 20 20 20 72  |...B   MOV     r|
000052c0  30 2c 23 35 20 20 20 20  20 20 20 20 20 20 20 20  |0,#5            |
000052d0  20 20 20 20 20 20 20 20  3b 20 72 65 61 64 20 63  |        ; read c|
000052e0  75 72 72 65 6e 74 20 74  61 73 6b 20 68 61 6e 64  |urrent task hand|
000052f0  6c 65 0d 18 9c 21 20 20  20 53 57 49 20 20 20 20  |le...!   SWI    |
00005300  20 22 57 69 6d 70 5f 52  65 61 64 53 79 73 49 6e  | "Wimp_ReadSysIn|
00005310  66 6f 22 0d 18 a6 39 20  20 20 4d 4f 56 20 20 20  |fo"...9   MOV   |
00005320  20 20 72 39 2c 72 30 20  20 20 20 20 20 20 20 20  |  r9,r0         |
00005330  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 39 3d  |           ; r9=|
00005340  63 75 72 72 65 6e 74 20  74 61 73 6b 0d 18 b0 22  |current task..."|
00005350  3b 20 72 65 61 64 20 74  61 73 6b 20 68 61 6e 64  |; read task hand|
00005360  6c 65 20 77 65 20 61 72  65 20 6f 76 65 72 0d 18  |le we are over..|
00005370  ba 23 20 20 20 4c 44 52  20 20 20 20 20 72 31 2c  |.#   LDR     r1,|
00005380  5b 72 31 32 2c 23 60 75  73 65 72 62 6c 6f 63 6b  |[r12,#`userblock|
00005390  5d 0d 18 c4 14 20 20 20  4d 4f 56 20 20 20 20 20  |]....   MOV     |
000053a0  72 32 2c 72 33 0d 18 ce  14 20 20 20 4d 4f 56 20  |r2,r3....   MOV |
000053b0  20 20 20 20 72 33 2c 72  34 0d 18 d8 15 20 20 20  |    r3,r4....   |
000053c0  4d 4f 56 20 20 20 20 20  72 30 2c 23 31 39 0d 18  |MOV     r0,#19..|
000053d0  e2 3a 20 20 20 53 57 49  20 20 20 20 20 22 58 57  |.:   SWI     "XW|
000053e0  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
000053f0  20 20 3b 20 66 69 6e 64  20 74 68 65 20 74 61 73  |  ; find the tas|
00005400  6b 20 68 61 6e 64 6c 65  0d 18 ec 45 20 20 20 20  |k handle...E    |
00005410  20 20 20 20 20 20 3b 20  bd 34 2b 22 25 49 43 75  |      ; .4+"%ICu|
00005420  72 72 65 6e 74 20 3d 20  25 26 39 2c 20 6f 76 65  |rrent = %&9, ove|
00005430  72 20 3d 20 25 26 32 2c  20 77 69 6e 20 3d 20 25  |r = %&2, win = %|
00005440  26 33 2c 20 69 63 6f 6e  3d 25 26 34 22 0d 18 f6  |&3, icon=%&4"...|
00005450  3e 20 20 20 43 4d 50 20  20 20 20 20 72 32 2c 72  |>   CMP     r2,r|
00005460  39 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |9               |
00005470  20 3b 20 61 72 65 20 74  68 65 79 20 74 68 65 20  | ; are they the |
00005480  73 61 6d 65 20 74 61 73  6b 20 3f 0d 19 00 51 20  |same task ?...Q |
00005490  20 20 42 45 51 20 20 20  20 20 5f 5f 7a 38 5f 67  |  BEQ     __z8_g|
000054a0  6f 74 61 72 65 61 20 20  20 20 20 20 20 20 20 20  |otarea          |
000054b0  20 20 20 3b 20 69 66 20  74 68 65 79 20 61 72 65  |   ; if they are|
000054c0  20 74 68 65 6e 20 60 73  74 72 20 69 73 20 69 6e  | then `str is in|
000054d0  20 72 69 67 68 74 20 70  6c 61 63 65 0d 19 0a 36  | right place...6|
000054e0  20 20 20 4d 4f 56 20 20  20 20 20 72 30 2c 72 32  |   MOV     r0,r2|
000054f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005500  3b 20 72 30 3d 73 6f 75  72 63 65 20 28 6f 76 65  |; r0=source (ove|
00005510  72 29 0d 19 14 1d 20 20  20 4c 44 52 20 20 20 20  |r)....   LDR    |
00005520  20 72 31 2c 5b 72 31 32  2c 23 60 73 74 72 5d 0d  | r1,[r12,#`str].|
00005530  19 1e 28 20 20 20 20 20  20 20 20 20 20 3b 20 72  |..(          ; r|
00005540  31 3d 73 6f 75 72 63 65  20 64 61 74 61 20 28 69  |1=source data (i|
00005550  6e 20 6f 76 65 72 29 0d  19 28 37 20 20 20 4d 4f  |n over)..(7   MO|
00005560  56 20 20 20 20 20 72 32  2c 72 39 20 20 20 20 20  |V     r2,r9     |
00005570  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 32 3d  |           ; r2=|
00005580  64 65 73 74 20 28 63 75  72 72 65 6e 74 29 0d 19  |dest (current)..|
00005590  32 23 20 20 20 4c 44 52  20 20 20 20 20 72 33 2c  |2#   LDR     r3,|
000055a0  5b 72 31 32 2c 23 60 75  73 65 72 62 6c 6f 63 6b  |[r12,#`userblock|
000055b0  5d 0d 19 3c 38 20 20 20  20 20 20 20 20 20 20 3b  |]..<8          ;|
000055c0  20 72 33 3d 64 65 73 74  20 64 61 74 61 20 28 69  | r3=dest data (i|
000055d0  6e 20 63 75 72 72 65 6e  74 20 2d 20 75 73 65 72  |n current - user|
000055e0  73 20 62 6c 6f 63 6b 21  29 0d 19 46 2f 20 20 20  |s block!)..F/   |
000055f0  4d 4f 56 20 20 20 20 20  72 34 2c 23 32 35 36 20  |MOV     r4,#256 |
00005600  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 72  |             ; r|
00005610  34 3d 6c 65 6e 67 74 68  0d 19 50 3b 20 20 20 20  |4=length..P;    |
00005620  20 20 20 20 20 20 3b 20  22 4d 6f 76 65 20 66 72  |      ; "Move fr|
00005630  6f 6d 20 54 25 26 30 20  74 6f 20 54 25 26 32 2c  |om T%&0 to T%&2,|
00005640  20 66 72 6f 6d 20 41 25  26 31 20 74 6f 20 41 25  | from A%&1 to A%|
00005650  26 33 22 0d 19 5a 23 20  20 20 53 57 49 20 20 20  |&3"..Z#   SWI   |
00005660  20 20 22 57 69 6d 70 5f  54 72 61 6e 73 66 65 72  |  "Wimp_Transfer|
00005670  42 6c 6f 63 6b 22 0d 19  64 14 20 20 20 4d 4f 56  |Block"..d.   MOV|
00005680  20 20 20 20 20 72 30 2c  23 30 0d 19 6e 51 20 20  |     r0,#0..nQ  |
00005690  20 53 54 52 42 20 20 20  20 72 30 2c 5b 72 33 2c  | STRB    r0,[r3,|
000056a0  23 32 35 35 5d 20 20 20  20 20 20 20 20 20 3b 20  |#255]         ; |
000056b0  61 64 64 20 61 20 74 65  72 6d 69 6e 61 74 6f 72  |add a terminator|
000056c0  20 69 6e 20 63 61 73 65  20 74 68 65 20 73 74 72  | in case the str|
000056d0  69 6e 67 20 69 73 20 6c  6f 6e 67 0d 19 78 1d 20  |ing is long..x. |
000056e0  20 20 53 54 52 20 20 20  20 20 72 33 2c 5b 72 31  |  STR     r3,[r1|
000056f0  32 2c 23 60 73 74 72 5d  0d 19 82 3a 20 20 20 20  |2,#`str]...:    |
00005700  20 20 20 20 20 20 3b 20  73 74 6f 72 65 20 69 6e  |      ; store in|
00005710  20 62 6c 6f 63 6b 20 73  6f 20 74 68 61 74 20 61  | block so that a|
00005720  64 64 6c 69 6e 65 20 63  61 6e 20 66 69 6e 64 20  |ddline can find |
00005730  69 74 0d 19 8c 11 2e 5f  5f 7a 38 5f 67 6f 74 61  |it.....__z8_gota|
00005740  72 65 61 0d 19 96 1d 20  20 20 4c 44 52 20 20 20  |rea....   LDR   |
00005750  20 20 72 33 2c 5b 72 31  32 2c 23 60 73 74 72 5d  |  r3,[r12,#`str]|
00005760  0d 19 a0 28 20 20 20 20  20 20 20 20 20 20 3b 20  |...(          ; |
00005770  22 49 73 20 6f 6e 65 20  6f 66 20 6f 75 72 73 2c  |"Is one of ours,|
00005780  20 69 73 20 25 24 33 22  0d 19 aa 21 20 20 20 4c  | is %$3"...!   L|
00005790  44 52 20 20 20 20 20 72  37 2c 5b 72 31 32 2c 23  |DR     r7,[r12,#|
000057a0  60 73 61 76 65 6c 65 6e  5d 0d 19 b4 22 20 20 20  |`savelen]..."   |
000057b0  4c 44 52 20 20 20 20 20  72 38 2c 5b 72 31 32 2c  |LDR     r8,[r12,|
000057c0  23 60 73 61 76 65 61 64  64 72 5d 0d 19 be 24 20  |#`saveaddr]...$ |
000057d0  20 20 20 20 20 20 20 20  20 3b 20 22 43 75 72 72  |         ; "Curr|
000057e0  65 6e 74 6c 79 20 73 61  79 73 20 25 24 38 22 0d  |ently says %$8".|
000057f0  19 c8 16 20 20 20 42 4c  20 20 20 20 20 20 61 64  |...   BL      ad|
00005800  64 6c 69 6e 65 0d 19 d2  22 20 20 20 53 54 52 20  |dline..."   STR |
00005810  20 20 20 20 72 38 2c 5b  72 31 32 2c 23 60 73 61  |    r8,[r12,#`sa|
00005820  76 65 61 64 64 72 5d 0d  19 dc 21 20 20 20 53 54  |veaddr]...!   ST|
00005830  52 20 20 20 20 20 72 37  2c 5b 72 31 32 2c 23 60  |R     r7,[r12,#`|
00005840  73 61 76 65 6c 65 6e 5d  0d 19 e6 1d 20 a4 4c 41  |savelen].... .LA|
00005850  44 52 28 22 20 20 22 2c  32 2c 60 73 6d 61 6c 6c  |DR("  ",2,`small|
00005860  66 69 6c 65 29 0d 19 f0  16 20 20 20 42 4c 20 20  |file)....   BL  |
00005870  20 20 20 20 73 65 74 64  72 61 67 0d 19 fa 14 20  |    setdrag.... |
00005880  20 20 4d 4f 56 20 20 20  20 20 72 30 2c 23 33 0d  |  MOV     r0,#3.|
00005890  1a 04 22 20 20 20 53 54  52 20 20 20 20 20 72 30  |.."   STR     r0|
000058a0  2c 5b 72 31 32 2c 23 60  64 72 61 67 67 69 6e 67  |,[r12,#`dragging|
000058b0  5d 0d 1a 0e 30 20 20 20  20 20 20 20 20 20 20 3b  |]...0          ;|
000058c0  20 6d 61 72 6b 20 61 73  20 63 75 72 72 65 6e 74  | mark as current|
000058d0  6c 79 20 64 72 61 67 67  69 6e 67 20 73 6d 61 6c  |ly dragging smal|
000058e0  6c 0d 1a 18 0e 2e 5f 5f  7a 38 5f 65 78 69 74 0d  |l.....__z8_exit.|
000058f0  1a 22 14 20 20 20 4d 4f  56 20 20 20 20 20 72 30  |.".   MOV     r0|
00005900  2c 23 30 0d 1a 2c 40 20  20 20 4c 44 4d 46 44 20  |,#0..,@   LDMFD |
00005910  20 20 28 73 70 29 21 2c  7b 72 33 2d 72 39 7d 20  |  (sp)!,{r3-r9} |
00005920  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005930  3b 20 52 65 73 74 6f 72  65 20 72 65 67 69 73 74  |; Restore regist|
00005940  65 72 73 0d 1a 36 3f 20  20 20 4c 44 4d 46 44 20  |ers..6?   LDMFD |
00005950  20 20 28 73 70 29 21 2c  7b 72 31 2d 72 32 2c 70  |  (sp)!,{r1-r2,p|
00005960  63 7d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |c}              |
00005970  3b 20 52 65 74 75 72 6e  20 66 72 6f 6d 20 63 61  |; Return from ca|
00005980  6c 6c 0d 1a 40 05 3a 0d  1a 4a 2c 20 20 20 20 20  |ll..@.:..J,     |
00005990  20 20 20 20 20 3b 20 49  6e 73 74 61 6c 6c 69 6e  |     ; Installin|
000059a0  67 20 6c 69 62 72 61 72  79 20 27 53 74 72 69 6e  |g library 'Strin|
000059b0  67 73 27 0d 1a 54 05 3a  0d 1a 5e 30 20 20 20 20  |gs'..T.:..^0    |
000059c0  20 20 20 20 20 20 3b 20  4c 69 62 72 61 72 79 20  |      ; Library |
000059d0  72 6f 75 74 69 6e 65 20  53 74 72 69 6e 67 73 2e  |routine Strings.|
000059e0  6d 6f 76 65 63 74 72 6c  0d 1a 68 0d 2e 6d 6f 76  |movectrl..h..mov|
000059f0  65 63 74 72 6c 0d 1a 72  17 3b 20 3e 20 72 30 3d  |ectrl..r.; > r0=|
00005a00  69 6e 70 75 74 20 73 74  72 69 6e 67 0d 1a 7c 17  |input string..|.|
00005a10  3b 20 20 20 72 31 3d 6f  75 70 75 74 20 62 75 66  |;   r1=ouput buf|
00005a20  66 65 72 0d 1a 86 13 3b  20 3c 20 5f 5f 7a 39 5f  |fer....; < __z9_|
00005a30  72 31 3d 24 72 30 0d 1a  90 24 20 20 20 53 54 4d  |r1=$r0...$   STM|
00005a40  46 44 20 20 20 28 73 70  29 21 2c 7b 72 30 2d 72  |FD   (sp)!,{r0-r|
00005a50  31 2c 72 35 2c 6c 69 6e  6b 7d 0d 1a 9a 0e 2e 5f  |1,r5,link}....._|
00005a60  5f 7a 39 5f 6c 6f 6f 70  0d 1a a4 19 20 20 20 4c  |_z9_loop....   L|
00005a70  44 52 42 20 20 20 20 72  35 2c 5b 72 30 5d 2c 23  |DRB    r5,[r0],#|
00005a80  31 0d 1a ae 19 20 20 20  53 54 52 42 20 20 20 20  |1....   STRB    |
00005a90  72 35 2c 5b 72 31 5d 2c  23 31 0d 1a b8 15 20 20  |r5,[r1],#1....  |
00005aa0  20 43 4d 50 20 20 20 20  20 72 35 2c 23 33 31 0d  | CMP     r5,#31.|
00005ab0  1a c2 18 20 20 20 42 47  54 20 20 20 20 20 5f 5f  |...   BGT     __|
00005ac0  7a 39 5f 6c 6f 6f 70 0d  1a cc 23 20 20 20 4c 44  |z9_loop...#   LD|
00005ad0  4d 46 44 20 20 20 28 73  70 29 21 2c 7b 72 30 2d  |MFD   (sp)!,{r0-|
00005ae0  72 31 2c 72 35 2c 70 63  7d 5e 0d 1a d6 05 3a 0d  |r1,r5,pc}^....:.|
00005af0  1a e0 05 3a 0d 1a ea 2f  20 20 20 20 20 20 20 20  |...:.../        |
00005b00  20 20 3b 20 4c 69 62 72  61 72 79 20 72 6f 75 74  |  ; Library rout|
00005b10  69 6e 65 20 53 74 72 69  6e 67 73 2e 6c 65 6e 63  |ine Strings.lenc|
00005b20  74 72 6c 0d 1a f4 0c 2e  6c 65 6e 63 74 72 6c 0d  |trl.....lenctrl.|
00005b30  1a fe 17 3b 20 3e 20 72  30 3d 69 6e 70 75 74 20  |...; > r0=input |
00005b40  73 74 72 69 6e 67 0d 1b  08 10 3b 20 3c 20 72 31  |string....; < r1|
00005b50  3d a9 28 72 30 29 0d 1b  12 1e 20 20 20 53 54 4d  |=.(r0)....   STM|
00005b60  46 44 20 20 20 28 73 70  29 21 2c 7b 72 32 2c 6c  |FD   (sp)!,{r2,l|
00005b70  69 6e 6b 7d 0d 1b 1c 14  20 20 20 4d 4f 56 20 20  |ink}....   MOV  |
00005b80  20 20 20 72 31 2c 23 30  0d 1b 26 0f 2e 5f 5f 7a  |   r1,#0..&..__z|
00005b90  31 30 5f 6c 6f 6f 70 0d  1b 30 19 20 20 20 4c 44  |10_loop..0.   LD|
00005ba0  52 42 20 20 20 20 72 32  2c 5b 72 30 2c 72 31 5d  |RB    r2,[r0,r1]|
00005bb0  0d 1b 3a 17 20 20 20 41  44 44 20 20 20 20 20 72  |..:.   ADD     r|
00005bc0  31 2c 72 31 2c 23 31 0d  1b 44 15 20 20 20 43 4d  |1,r1,#1..D.   CM|
00005bd0  50 20 20 20 20 20 72 32  2c 23 33 32 0d 1b 4e 19  |P     r2,#32..N.|
00005be0  20 20 20 42 47 45 20 20  20 20 20 5f 5f 7a 31 30  |   BGE     __z10|
00005bf0  5f 6c 6f 6f 70 0d 1b 58  17 20 20 20 53 55 42 20  |_loop..X.   SUB |
00005c00  20 20 20 20 72 31 2c 72  31 2c 23 31 0d 1b 62 1d  |    r1,r1,#1..b.|
00005c10  20 20 20 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |   LDMFD   (sp)!|
00005c20  2c 7b 72 32 2c 70 63 7d  5e 0d 1b 6c 05 3a 0d 1b  |,{r2,pc}^..l.:..|
00005c30  76 26 20 20 20 20 20 20  20 20 20 20 3b 20 4c 69  |v&          ; Li|
00005c40  62 72 61 72 79 20 27 53  74 72 69 6e 67 73 27 20  |brary 'Strings' |
00005c50  65 6e 64 73 0d 1b 80 05  5d 0d 1b 8a 20 f4 20 2a  |ends....]... . *|
00005c60  2a 2a 2a 20 45 6e 64 20  6f 66 20 6d 61 69 6e 20  |*** End of main |
00005c70  63 6f 64 65 20 2a 2a 2a  2a 0d 1b 94 36 f4 20 53  |code ****...6. S|
00005c80  65 74 20 66 69 6e 61 6c  20 70 6f 69 6e 74 65 72  |et final pointer|
00005c90  20 74 6f 20 66 69 6e 64  20 74 68 65 20 6c 65 6e  | to find the len|
00005ca0  67 74 68 20 6f 66 20 74  68 65 20 63 6f 64 65 0d  |gth of the code.|
00005cb0  1b 9e 13 f2 70 61 74 63  68 5f 73 65 74 70 63 28  |....patch_setpc(|
00005cc0  30 29 0d 1b a8 0b ed 20  70 61 73 73 25 0d 1b b2  |0)..... pass%...|
00005cd0  13 f2 70 61 74 63 68 5f  73 61 76 65 66 69 6c 65  |..patch_savefile|
00005ce0  0d 1b d0 28 f4 20 2a 2a  2a 2a 20 50 6f 73 74 2d  |...(. **** Post-|
00005cf0  61 73 73 65 6d 62 6c 79  20 75 73 65 72 20 63 6f  |assembly user co|
00005d00  64 65 20 2a 2a 2a 2a 2a  0d 1b da 20 2a 52 75 6e  |de *****... *Run|
00005d10  20 3c 54 65 78 74 43 6f  70 79 24 44 69 72 3e 2e  | <TextCopy$Dir>.|
00005d20  54 65 78 74 43 6f 70 79  0d 1b e4 05 e0 0d 1b ee  |TextCopy........|
00005d30  05 3a 0d 1b f8 05 3a 0d  1c 02 21 f4 20 2a 2a 2a  |.:....:...!. ***|
00005d40  2a 20 46 69 6c 69 6e 67  20 70 72 6f 63 65 64 75  |* Filing procedu|
00005d50  72 65 73 20 2a 2a 2a 2a  0d 1c 0c 05 3a 0d 1c 16  |res ****....:...|
00005d60  15 dd 20 f2 70 61 74 63  68 5f 6c 6f 61 64 66 69  |.. .patch_loadfi|
00005d70  6c 65 0d 1c 20 0d 63 6f  64 65 6c 65 6e 3d 30 0d  |le.. .codelen=0.|
00005d80  1c 2a 0f de 20 4d 43 25  20 26 31 34 30 30 0d 1c  |.*.. MC% &1400..|
00005d90  34 24 65 6e 64 6f 66 63  6f 64 65 3d 63 6f 64 65  |4$endofcode=code|
00005da0  6c 65 6e 2b 26 30 3a 6d  61 78 3d 63 6f 64 65 6c  |len+&0:max=codel|
00005db0  65 6e 0d 1c 3e 10 4c 25  3d 65 6e 64 6f 66 63 6f  |en..>.L%=endofco|
00005dc0  64 65 0d 1c a2 05 e1 0d  1c ac 05 3a 0d 1c b6 15  |de.........:....|
00005dd0  dd 20 f2 70 61 74 63 68  5f 73 61 76 65 66 69 6c  |. .patch_savefil|
00005de0  65 0d 1c c0 26 6f 75 74  66 69 6c 65 24 3d 22 3c  |e...&outfile$="<|
00005df0  54 65 78 74 43 6f 70 79  24 44 69 72 3e 2e 54 65  |TextCopy$Dir>.Te|
00005e00  78 74 43 6f 70 79 22 0d  1c ca 31 ff 28 22 53 61  |xtCopy"...1.("Sa|
00005e10  76 65 20 22 2b 6f 75 74  66 69 6c 65 24 2b 22 20  |ve "+outfile$+" |
00005e20  22 2b c3 7e 4d 43 25 2b  22 20 22 2b c3 7e 28 6d  |"+.~MC%+" "+.~(m|
00005e30  61 78 2b 4d 43 25 29 29  0d 1c d4 24 ff 28 22 53  |ax+MC%))...$.("S|
00005e40  65 74 74 79 70 65 20 22  2b 6f 75 74 66 69 6c 65  |ettype "+outfile|
00005e50  24 2b 22 20 4d 6f 64 75  6c 65 22 29 0d 1c de 1e  |$+" Module")....|
00005e60  70 61 74 63 68 64 69 72  24 3d 22 3c 54 65 78 74  |patchdir$="<Text|
00005e70  43 6f 70 79 24 44 69 72  3e 22 0d 1d 06 05 e1 0d  |Copy$Dir>"......|
00005e80  1d 10 05 3a 0d 1d 1a 1d  f4 20 2a 2a 2a 2a 20 45  |...:..... **** E|
00005e90  72 72 6f 72 20 48 61 6e  64 6c 65 72 20 2a 2a 2a  |rror Handler ***|
00005ea0  2a 0d 1d 24 05 3a 0d 1d  2e 0b dd f2 45 72 72 6f  |*..$.:......Erro|
00005eb0  72 0d 1d 7e 1b 85 20 a2  20 9f 2c f6 24 2b 22 20  |r..~.. . .,.$+" |
00005ec0  61 74 20 6c 69 6e 65 20  22 2b c3 9e 0d 1d 88 05  |at line "+......|
00005ed0  e1 0d 1d 92 05 3a 0d 1d  9c 22 f4 20 2a 2a 2a 2a  |.....:...". ****|
00005ee0  20 55 74 69 6c 69 74 79  20 70 72 6f 63 65 64 75  | Utility procedu|
00005ef0  72 65 73 20 2a 2a 2a 2a  0d 1d a6 05 3a 0d 1d b0  |res ****....:...|
00005f00  14 dd f2 70 61 74 63 68  5f 73 65 74 70 63 28 6e  |...patch_setpc(n|
00005f10  29 0d 1d ba 1a e7 20 50  25 2d 26 30 3e 6d 61 78  |)..... P%-&0>max|
00005f20  20 8c 6d 61 78 3d 50 25  2d 26 30 0d 1d c4 14 50  | .max=P%-&0....P|
00005f30  25 3d 6e 3a 4f 25 3d 4d  43 25 2b 6e 2d 26 30 0d  |%=n:O%=MC%+n-&0.|
00005f40  1d ce 05 e1 0d 1d d8 05  3a 0d 1d e2 22 dd a4 66  |........:..."..f|
00005f50  69 6e 64 66 72 65 65 72  65 67 28 61 2c 62 2c 63  |indfreereg(a,b,c|
00005f60  2c 64 29 3a ea 20 6e 3a  6e 3d 30 0d 1d ec 1c c8  |,d):. n:n=0.....|
00005f70  95 20 6e 3d 61 20 84 20  6e 3d 62 20 84 20 6e 3d  |. n=a . n=b . n=|
00005f80  63 20 84 20 6e 3d 64 0d  1d f6 09 20 6e 2b 3d 31  |c . n=d.... n+=1|
00005f90  0d 1e 00 05 ce 0d 1e 0a  06 3d 6e 0d 1e 14 05 3a  |.........=n....:|
00005fa0  0d 1e 1e 28 f4 20 2a 2a  2a 2a 20 4c 6f 6e 67 20  |...(. **** Long |
00005fb0  41 44 52 20 6d 61 63 72  6f 20 70 72 6f 63 65 64  |ADR macro proced|
00005fc0  75 72 65 20 2a 2a 2a 2a  0d 1e 28 05 3a 0d 1e 32  |ure ****..(.:..2|
00005fd0  40 f4 20 44 45 53 43 2e  20 3a 20 41 44 52 20 65  |@. DESC. : ADR e|
00005fe0  71 75 69 76 61 6c 65 6e  74 20 66 6f 72 20 6c 6f  |quivalent for lo|
00005ff0  6e 67 20 61 64 64 72 65  73 73 20 72 61 6e 67 65  |ng address range|
00006000  73 2c 20 69 6e 20 32 20  69 6e 73 74 73 0d 1e 3c  |s, in 2 insts..<|
00006010  43 f4 20 45 4e 54 52 59  20 3a 20 63 6f 6e 64 24  |C. ENTRY : cond$|
00006020  20 3d 20 74 77 6f 20 63  68 61 72 20 73 74 72 69  | = two char stri|
00006030  6e 67 2c 20 63 6f 6e 74  61 69 6e 69 6e 67 20 74  |ng, containing t|
00006040  68 65 20 41 52 4d 20 63  6f 6e 64 69 74 69 6f 6e  |he ARM condition|
00006050  0d 1e 46 1a f4 20 20 20  20 20 20 20 20 20 72 65  |..F..         re|
00006060  67 25 20 3d 20 30 2e 2e  31 35 0d 1e 50 2b f4 20  |g% = 0..15..P+. |
00006070  20 20 20 20 20 20 20 20  70 6f 69 6e 74 65 72 25  |        pointer%|
00006080  20 3d 20 6c 6f 6e 67 20  72 61 6e 67 65 20 70 6f  | = long range po|
00006090  69 6e 74 65 72 0d 1e 5a  42 f4 20 43 4f 4d 4d 2e  |inter..ZB. COMM.|
000060a0  20 3a 20 70 61 73 73 25  20 3d 20 4f 50 54 20 76  | : pass% = OPT v|
000060b0  61 72 69 61 62 6c 65 20  69 6e 20 74 68 65 20 61  |ariable in the a|
000060c0  73 73 65 6d 62 6c 65 72  20 46 4f 52 2e 2e 4e 45  |ssembler FOR..NE|
000060d0  58 54 20 6c 6f 6f 70 0d  1e 64 2d f4 20 20 20 20  |XT loop..d-.    |
000060e0  20 20 20 20 20 43 61 6e  20 6f 6e 6c 79 20 68 61  |     Can only ha|
000060f0  6e 64 6c 65 20 36 34 20  4b 42 79 74 65 20 72 61  |ndle 64 KByte ra|
00006100  6e 67 65 73 0d 1e 6e 1f  dd a4 4c 41 44 52 28 63  |nges..n...LADR(c|
00006110  6f 6e 64 24 2c 72 65 67  25 2c 70 6f 69 6e 74 65  |ond$,reg%,pointe|
00006120  72 25 29 0d 1e 78 21 ea  20 63 63 25 2c 64 69 66  |r%)..x!. cc%,dif|
00006130  66 25 2c 6c 6f 25 2c 68  69 25 2c 6f 70 31 25 2c  |f%,lo%,hi%,op1%,|
00006140  6f 70 32 25 0d 1e 82 23  e7 20 28 70 61 73 73 25  |op2%...#. (pass%|
00006150  20 80 25 31 30 29 3d 30  20 50 25 2b 3d 38 3a 4f  | .%10)=0 P%+=8:O|
00006160  25 2b 3d 38 3a 3d 30 0d  1e 8c 73 e7 20 94 28 70  |%+=8:=0...s. .(p|
00006170  6f 69 6e 74 65 72 25 2d  50 25 29 3e 36 35 35 33  |ointer%-P%)>6553|
00006180  35 20 8c 20 85 20 31 2c  22 4c 41 44 52 20 63 61  |5 . . 1,"LADR ca|
00006190  6e 20 6f 6e 6c 79 20 68  61 6e 64 6c 65 20 36 34  |n only handle 64|
000061a0  20 4b 42 79 74 65 20 72  61 6e 67 65 73 20 61 74  | KByte ranges at|
000061b0  20 26 22 2b c3 7e 50 25  2b 22 20 28 26 22 2b c3  | &"+.~P%+" (&"+.|
000061c0  7e 28 70 6f 69 6e 74 65  72 25 2d 50 25 29 2b 22  |~(pointer%-P%)+"|
000061d0  20 64 69 73 74 61 6e 74  29 22 0d 1e 96 27 e7 63  | distant)"...'.c|
000061e0  6f 6e 64 24 3d 22 20 20  22 20 84 20 63 6f 6e 64  |ond$="  " . cond|
000061f0  24 3d 22 22 20 20 8c 63  6f 6e 64 24 3d 22 41 4c  |$=""  .cond$="AL|
00006200  22 0d 1e a0 32 63 63 25  3d a7 22 45 51 4e 45 43  |"...2cc%=."EQNEC|
00006210  53 43 43 4d 49 50 4c 56  53 56 43 48 49 4c 53 47  |SCCMIPLVSVCHILSG|
00006220  45 4c 54 47 54 4c 45 41  4c 4e 56 22 2c 63 6f 6e  |ELTGTLEALNV",con|
00006230  64 24 29 0d 1e aa 63 e7  20 63 63 25 3d 30 20 85  |d$)...c. cc%=0 .|
00006240  20 31 2c 22 46 41 54 41  4c 20 45 52 52 4f 52 20  | 1,"FATAL ERROR |
00006250  3a 20 55 6e 6b 6e 6f 77  6e 20 63 6f 6e 64 69 74  |: Unknown condit|
00006260  69 6f 6e 20 66 6f 72 20  4c 41 44 52 20 61 74 20  |ion for LADR at |
00006270  26 22 2b c3 7e 50 25 2b  22 20 28 26 22 2b c3 7e  |&"+.~P%+" (&"+.~|
00006280  4f 25 2b 22 29 22 20 8b  20 63 63 25 3d 28 63 63  |O%+")" . cc%=(cc|
00006290  25 2d 31 29 81 32 0d 1e  b4 17 64 69 66 66 25 3d  |%-1).2....diff%=|
000062a0  70 6f 69 6e 74 65 72 25  2d 50 25 2d 38 0d 1e be  |pointer%-P%-8...|
000062b0  14 6c 6f 25 3d 94 28 64  69 66 66 25 29 80 26 46  |.lo%=.(diff%).&F|
000062c0  46 0d 1e c8 16 68 69 25  3d 94 28 64 69 66 66 25  |F....hi%=.(diff%|
000062d0  29 80 26 46 46 30 30 0d  1e d2 0e e7 64 69 66 66  |).&FF00.....diff|
000062e0  25 3e 3d 30 8c 0d 1e dc  2c 20 6f 70 31 25 3d 28  |%>=0...., op1%=(|
000062f0  63 63 25 3c 3c 32 38 29  2b 26 30 32 38 46 30 30  |cc%<<28)+&028F00|
00006300  30 30 2b 28 72 65 67 25  3c 3c 31 32 29 2b 6c 6f  |00+(reg%<<12)+lo|
00006310  25 0d 1e e6 3c 20 6f 70  32 25 3d 28 63 63 25 3c  |%...< op2%=(cc%<|
00006320  3c 32 38 29 2b 26 30 32  38 30 30 43 30 30 2b 28  |<28)+&02800C00+(|
00006330  72 65 67 25 3c 3c 31 36  29 2b 28 72 65 67 25 3c  |reg%<<16)+(reg%<|
00006340  3c 31 32 29 2b 28 68 69  25 3e 3e 38 29 0d 1e f0  |<12)+(hi%>>8)...|
00006350  05 cc 0d 1e fa 2c 20 6f  70 31 25 3d 28 63 63 25  |....., op1%=(cc%|
00006360  3c 3c 32 38 29 2b 26 30  32 34 46 30 30 30 30 2b  |<<28)+&024F0000+|
00006370  28 72 65 67 25 3c 3c 31  32 29 2b 6c 6f 25 0d 1f  |(reg%<<12)+lo%..|
00006380  04 3c 20 6f 70 32 25 3d  28 63 63 25 3c 3c 32 38  |.< op2%=(cc%<<28|
00006390  29 2b 26 30 32 34 30 30  43 30 30 2b 28 72 65 67  |)+&02400C00+(reg|
000063a0  25 3c 3c 31 36 29 2b 28  72 65 67 25 3c 3c 31 32  |%<<16)+(reg%<<12|
000063b0  29 2b 28 68 69 25 3e 3e  38 29 0d 1f 0e 05 cd 0d  |)+(hi%>>8)......|
000063c0  1f 18 24 5b 4f 50 54 20  70 61 73 73 25 3a 45 51  |..$[OPT pass%:EQ|
000063d0  55 44 20 6f 70 31 25 3a  45 51 55 44 20 6f 70 32  |UD op1%:EQUD op2|
000063e0  25 3a 5d 0d 1f 22 06 3d  30 0d 1f 2c 05 3a 0d 1f  |%:]..".=0..,.:..|
000063f0  36 2a f4 20 2a 2a 2a 2a  20 4c 6f 6e 67 20 4d 4f  |6*. **** Long MO|
00006400  56 20 6d 61 63 72 6f 20  69 6e 73 74 72 75 63 74  |V macro instruct|
00006410  69 6f 6e 20 2a 2a 2a 2a  0d 1f 40 05 3a 0d 1f 4a  |ion ****..@.:..J|
00006420  1b dd a4 4c 4d 4f 56 28  63 6f 6e 64 24 2c 72 65  |...LMOV(cond$,re|
00006430  67 2c 76 61 6c 75 65 29  0d 1f 54 27 e7 20 63 6f  |g,value)..T'. co|
00006440  6e 64 24 3d 22 22 20 84  20 63 6f 6e 64 24 3d 22  |nd$="" . cond$="|
00006450  20 20 22 20 8c 63 6f 6e  64 24 3d 22 41 4c 22 0d  |  " .cond$="AL".|
00006460  1f 5e 39 63 6f 6e 64 3d  28 a7 22 45 51 4e 45 43  |.^9cond=(."EQNEC|
00006470  53 43 43 4d 49 50 4c 56  53 56 43 48 49 4c 53 47  |SCCMIPLVSVCHILSG|
00006480  45 4c 54 47 54 4c 45 41  4c 4e 56 22 2c 63 6f 6e  |ELTGTLEALNV",con|
00006490  64 24 29 2d 31 29 2f 32  0d 1f 68 26 6d 6f 76 3d  |d$)-1)/2..h&mov=|
000064a0  28 26 33 41 3c 3c 32 30  29 2b 28 72 65 67 3c 3c  |(&3A<<20)+(reg<<|
000064b0  31 32 29 2b 28 63 6f 6e  64 3c 3c 32 38 29 0d 1f  |12)+(cond<<28)..|
000064c0  72 30 61 64 64 3d 28 26  32 38 3c 3c 32 30 29 2b  |r0add=(&28<<20)+|
000064d0  28 72 65 67 3c 3c 31 32  29 2b 28 72 65 67 3c 3c  |(reg<<12)+(reg<<|
000064e0  31 36 29 2b 28 63 6f 6e  64 3c 3c 32 38 29 0d 1f  |16)+(cond<<28)..|
000064f0  7c 0b 73 68 69 66 74 3d  30 0d 1f 86 05 f5 0d 1f  ||.shift=0.......|
00006500  90 15 20 c8 95 20 28 76  61 6c 75 65 20 80 20 33  |.. .. (value . 3|
00006510  29 3d 30 0d 1f 9a 1d 20  20 73 68 69 66 74 2b 3d  |)=0....  shift+=|
00006520  31 3a 76 61 6c 75 65 3d  76 61 6c 75 65 20 81 34  |1:value=value .4|
00006530  0d 1f a4 06 20 ce 0d 1f  ae 2a 20 78 73 68 69 66  |.... ....* xshif|
00006540  74 3d 31 36 2d 73 68 69  66 74 3a e7 20 78 73 68  |t=16-shift:. xsh|
00006550  69 66 74 3d 31 36 20 8c  78 73 68 69 66 74 3d 30  |ift=16 .xshift=0|
00006560  0d 1f b8 0f 20 e7 20 6d  6f 76 3c 3e 30 20 8c 0d  |.... . mov<>0 ..|
00006570  1f c2 35 20 20 5b 4f 50  54 20 70 61 73 73 25 3a  |..5  [OPT pass%:|
00006580  45 51 55 44 20 6d 6f 76  2b 28 78 73 68 69 66 74  |EQUD mov+(xshift|
00006590  3c 3c 38 29 2b 28 76 61  6c 75 65 20 80 20 32 35  |<<8)+(value . 25|
000065a0  35 29 3a 5d 0d 1f cc 0b  20 20 6d 6f 76 3d 30 0d  |5):]....  mov=0.|
000065b0  1f d6 06 20 cc 0d 1f e0  35 20 20 5b 4f 50 54 20  |... ....5  [OPT |
000065c0  70 61 73 73 25 3a 45 51  55 44 20 61 64 64 2b 28  |pass%:EQUD add+(|
000065d0  78 73 68 69 66 74 3c 3c  38 29 2b 28 76 61 6c 75  |xshift<<8)+(valu|
000065e0  65 20 80 20 32 35 35 29  3a 5d 0d 1f ea 06 20 cd  |e . 255):].... .|
000065f0  0d 1f f4 1e 20 76 61 6c  75 65 3d 76 61 6c 75 65  |.... value=value|
00006600  20 81 32 35 36 3a 73 68  69 66 74 2b 3d 34 0d 1f  | .256:shift+=4..|
00006610  fe 0c fd 76 61 6c 75 65  3d 30 0d 20 08 06 3d 30  |...value=0. ..=0|
00006620  0d 20 12 05 3a 0d 20 1c  2a f4 20 2a 2a 2a 2a 20  |. ..:. .*. **** |
00006630  4c 6f 6e 67 20 41 44 44  20 6d 61 63 72 6f 20 69  |Long ADD macro i|
00006640  6e 73 74 72 75 63 74 69  6f 6e 20 2a 2a 2a 2a 0d  |nstruction ****.|
00006650  20 26 05 3a 0d 20 30 21  dd a4 4c 41 44 44 28 63  | &.:. 0!..LADD(c|
00006660  6f 6e 64 24 2c 72 65 67  31 2c 72 65 67 32 2c 76  |ond$,reg1,reg2,v|
00006670  61 6c 75 65 29 0d 20 3a  27 e7 20 63 6f 6e 64 24  |alue). :'. cond$|
00006680  3d 22 22 20 84 20 63 6f  6e 64 24 3d 22 20 20 22  |="" . cond$="  "|
00006690  20 8c 63 6f 6e 64 24 3d  22 41 4c 22 0d 20 44 39  | .cond$="AL". D9|
000066a0  63 6f 6e 64 3d 28 a7 22  45 51 4e 45 43 53 43 43  |cond=(."EQNECSCC|
000066b0  4d 49 50 4c 56 53 56 43  48 49 4c 53 47 45 4c 54  |MIPLVSVCHILSGELT|
000066c0  47 54 4c 45 41 4c 4e 56  22 2c 63 6f 6e 64 24 29  |GTLEALNV",cond$)|
000066d0  2d 31 29 2f 32 0d 20 4e  33 61 64 64 31 3d 28 26  |-1)/2. N3add1=(&|
000066e0  32 38 3c 3c 32 30 29 2b  28 72 65 67 31 3c 3c 31  |28<<20)+(reg1<<1|
000066f0  32 29 2b 28 72 65 67 32  3c 3c 31 36 29 2b 28 63  |2)+(reg2<<16)+(c|
00006700  6f 6e 64 3c 3c 32 38 29  0d 20 58 33 61 64 64 32  |ond<<28). X3add2|
00006710  3d 28 26 32 38 3c 3c 32  30 29 2b 28 72 65 67 31  |=(&28<<20)+(reg1|
00006720  3c 3c 31 32 29 2b 28 72  65 67 31 3c 3c 31 36 29  |<<12)+(reg1<<16)|
00006730  2b 28 63 6f 6e 64 3c 3c  32 38 29 0d 20 62 0b 73  |+(cond<<28). b.s|
00006740  68 69 66 74 3d 30 0d 20  6c 05 f5 0d 20 76 15 20  |hift=0. l... v. |
00006750  c8 95 20 28 76 61 6c 75  65 20 80 20 33 29 3d 30  |.. (value . 3)=0|
00006760  0d 20 80 1d 20 20 73 68  69 66 74 2b 3d 31 3a 76  |. ..  shift+=1:v|
00006770  61 6c 75 65 3d 76 61 6c  75 65 20 81 34 0d 20 8a  |alue=value .4. .|
00006780  06 20 ce 0d 20 94 2a 20  78 73 68 69 66 74 3d 31  |. .. .* xshift=1|
00006790  36 2d 73 68 69 66 74 3a  e7 20 78 73 68 69 66 74  |6-shift:. xshift|
000067a0  3d 31 36 20 8c 78 73 68  69 66 74 3d 30 0d 20 9e  |=16 .xshift=0. .|
000067b0  10 20 e7 20 61 64 64 31  3c 3e 30 20 8c 0d 20 a8  |. . add1<>0 .. .|
000067c0  35 20 20 5b 4f 50 54 20  70 61 73 73 25 3a 45 51  |5  [OPT pass%:EQ|
000067d0  55 44 61 64 64 31 2b 28  78 73 68 69 66 74 3c 3c  |UDadd1+(xshift<<|
000067e0  38 29 2b 28 76 61 6c 75  65 20 80 20 32 35 35 29  |8)+(value . 255)|
000067f0  3a 5d 0d 20 b2 0c 20 20  61 64 64 31 3d 30 0d 20  |:]. ..  add1=0. |
00006800  bc 06 20 cc 0d 20 c6 35  20 20 5b 4f 50 54 20 70  |.. .. .5  [OPT p|
00006810  61 73 73 25 3a 45 51 55  44 61 64 64 32 2b 28 78  |ass%:EQUDadd2+(x|
00006820  73 68 69 66 74 3c 3c 38  29 2b 28 76 61 6c 75 65  |shift<<8)+(value|
00006830  20 80 20 32 35 35 29 3a  5d 0d 20 d0 06 20 cd 0d  | . 255):]. .. ..|
00006840  20 da 1e 20 76 61 6c 75  65 3d 76 61 6c 75 65 20  | .. value=value |
00006850  81 32 35 36 3a 73 68 69  66 74 2b 3d 34 0d 20 e4  |.256:shift+=4. .|
00006860  0c fd 76 61 6c 75 65 3d  30 0d 20 ee 06 3d 30 0d  |..value=0. ..=0.|
00006870  20 f8 05 3a 0d 7f 7f 0d  f4 20 4a 46 50 61 74 63  | ..:..... JFPatc|
00006880  68 0d ff                                          |h..|
00006883