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

StarInfo/Fletcher/Source111

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/Source111
Read OK:
File size: 4810 bytes
Load address: 0000
Exec address: 0000
File contents
App  TextCopy
In   -
Out  TextCopy
Type Module
Ver  1.11b

Define Workspace
 Name    DragBox
 Default r9
 Prefix  db_
  `left        !    left of icon
  `bottom      !    bottom of icon
  `right       !    right of icon
  `top         !    top of icon
 Name    workspace
 Default r12
  `filehandle  !    handle of file to save to
  `window      !    window being dragged to/from
  `icon        !    icon being dragged to/from
  `left        !    left of icon
  `bottom      !    bottom of icon
  `right       !    right of icon
  `top         !    top of icon
  `flags       !    icon flags
  `str         !    string pointer
  `valid       !    validation pointer
  `length      !    length of string
  `eventtype   !    Temporary store for event type
  `saveaddr    !    Address of text to save out
  `savelen     !    Length of text to save out
  `dragbox     ^DragBox
  `userblock   !    Pointer to users block
  `ptrblock    !    Block for pointer information, and x co-ordinate of mouse
  `mousey      !    y co-ordinate of mouse
  `mouseb      !    button state of mouse
  `mousew      !    window mouse is over
  `mousei      !    icon mouse is over
  `dragging    !    marker showing the current dragging state
End Workspace

Define Module
 Name    TextCopy
 Help    Text Copy
 Author  Justin Fletcher
 Init    InitCode
 Commands
  Name   TextCopy
  Help   ...
    The TextCopy allows you to drag text files directly on to writable
    icons. This is done by use of filters, so this may clash with
    applications which process text files dragged onto writeable icons.
    If multiple writable icons are present, then the text will span
    these.|M
    Holding down Shift when dragging will copy the filename into the icon.
    |M|MDragging of writable icons is also possible for type 15 icons and
    for all icons if the AllWCD module is present.|M|M
    Holding down Ctrl when dragging will bypass the both patches.
 End Commands
 Workspace `len_workspace
 PostFilter
  Name   Text Copy
  Code   filtercode
  Task   -
  Accept Null
  Accept DragDropped
  Accept MouseClick
  Accept Message
  Accept MessageRec
  Accept MessageAck
 End Filter
End Module

# REM OFF
.InitCode
   STMFD  (sp)!,{r0,link}
   MOV    r0,#0
   STRW   r0,`dragging
   LDMFD  (sp)!,{r0,pc}

.filtercode
   STMFD   (sp)!,{r1-r2,link}
   CMP     r0,#0
   BEQ     checknullevent
   CMP     r0,#6
   BEQ     ismouseclick
   CMP     r0,#7
   BEQ     isdragdone
   CMP     r0,#17
   CMPNE   r0,#18
   BEQ     ismessage
   CMP     r0,#19
   BEQ     ismessageack
   LDMFD   (sp)!,{r1-r2,pc}

.ismessageack
   STRW    r0,`eventtype
   REM     "%c04%c30Acknowledged"
   LDR     r2,[r1,#16]
   CMP     r2,#1
   BEQ     isNoDataSaveAck           ; Nobody loves me, so transfer dies�
   B       exitevent
.ismessage
   STRW    r0,`eventtype
   LDR     r2,[r1,#16]
   REM     "%c04%c30Message %&2"
   CMP     r2,#1
   BEQ     isDataSave                ; Initial message, can I save to you ?
   CMP     r2,#3
   BEQ     isDataLoad                ; Please load this data from me�
   CMP     r2,#2
   BEQ     isDataSaveAck             ; I want your data, give it to me now�
.exitevent
   LDRW    r0,`eventtype
   LDMFD   (sp)!,{r1-r2,pc}

.isDataSaveAck
   LDRW    r0,`dragging
   CMP     r0,#2
   BNE     exitevent
   REM     "Data save initiated..."
   MOV     r0,#10
   ADD     r1,r1,#44                     ; address in block of filename
   REM     "File name to save as %$1"
   LMOV    r2,#&FFF                      ; filetype
   LDRW    r4,`saveaddr                  ; start address
   LDRW    r5,`savelen                   ; length
   ADD     r5,r5,r4                      ; end address
   REM     "Save memory %&4 - %&5"
   SWI     "OS_File"                     ; save file
   SUB     r1,r1,#44                     ; restore block pointer
   MOV     r0,#3                         ; acknowledge sending of data
   STR     r0,[r1,#16]                   ; store in block
   LDR     r0,[r1,#8]                    ; get their ref
   STR     r0,[r1,#12]                   ; store in our ref to mark as reply
   LDR     r2,[r1,#4]                    ; task to return to
   MOV     r0,#17
   SWI     "Wimp_SendMessage"            ; tell them...
   MOV     r0,#0
   STRW    r0,`dragging                  ; mark as not dragging
   LDMFD   (sp)!,{r1-r2,pc}              ; Return from call

.isNoDataSaveAck
   LDRW    r0,`dragging
   CMP     r0,#2
   BNE     exitevent
   MOV     r0,#0
   STRW    r0,`dragging                  ; mark as not dragging
   LDMFD   (sp)!,{r1-r2,pc}              ; Return from call

.isDataSave
; check for the correct icon
   REM    "Check icon"
   BL     checkctrl
   BEQ    exitevent
   LDR    r2,[r1,#40]
   ADD    r2,r2,#1
   CMP    r2,#&1000
   BNE    exitevent
   BL     checkshift      ; is shift pressed ?
   BEQ    exitevent       ; if so then exit, 'cos we can't deal with it here
   LDR    r3,[r1,#20]     ; window
   LDR    r4,[r1,#24]     ; icon
   BL     isdragok
   CMP    r0,#0
   BEQ    exitevent
   LDMFD  (sp),{r1}
; end of check
   MVN    r2,#NOT -1
   STR    r2,[r1,#36]   ; data not safe
   MOV    r2,#128
   STR    r2,[r1,#0]    ; length of block
   MOV    r2,#2
   STR    r2,[r1,#16]   ; ok save file message
   LDR    r2,[r1,#8]
   STR    r2,[r1,#12]   ; note message number
   LADR   r3,`ourfilename
   ADD    r4,r1,#44     ; start of filename
$DSfilenameloop
   LDRB   r2,[r3],#1
   STRB   r2,[r4],#1
   CMP    r2,#31
   BGT    $DSfilenameloop
   MOV    r0,#17
   LDR    r2,[r1,#4]
   SWI    "Wimp_SendMessage"
   MOV    r0,#0
   LDMFD  (sp)!,{r1-r2,pc}

.isDataLoad
; check for the correct icon
   REM    "DataLoad"
   BL     checkctrl
   BEQ    exitevent
   BL     checkshift      ; is shift pressed ?
   BNE    $notshift
   LDREQ  r2,[r1,#36]     ; if so then is this data safe ?
   CMNEQ  r2,#1           ; is it -1 (unsafe ?)
   BEQ    exitevent
   B      $oktoload
$notshift
   LDR    r2,[r1,#40]
   ADD    r2,r2,#1
   CMP    r2,#&1000
   BNE    exitevent
$oktoload
   LDR    r3,[r1,#20]   ; window
   LDR    r4,[r1,#24]   ; icon
   BL     isdragok
   CMP    r0,#0
   BEQ    exitevent
; end of check
   LDMFD  (sp),{r1}
   LDRW   r3,`str
   LDRW   r4,`length
   ADD    r1,r1,#44   ; filename
   BL     checkshift  ; is shift drag ?
   BEQ    doshiftdrag ; if so then only copy filename�
   MOV    r0,#&40     ; opening file for input
   SWI    "OS_Find"   ; open file
   STRW   r0,`filehandle
   REM    "Handle %r0"
$DLreaddataiconloop
   LDRW   r3,`str
   LDRW   r4,`length
$DLreaddataloop
   LDRW   r1,`filehandle
   MOV    r0,#&7F     ; check EOF
   SWI    "OS_Byte"
   CMP    r1,#0
   BNE    $DLeof
   CMP    r4,#1       ; is this last char
   BEQ    $DLnexticon ; if so, next icon
   LDRW   r1,`filehandle
   SWI    "XOS_BGet"
   STRB   r0,[r3],#1
   CMP    r0,#31       ; is this terminator
   BLE    $DLnexticon  ; if so, next icon
   SUB    r4,r4,#1
   B      $DLreaddataloop
$DLnexticon
   BL     updateicon
   MOV    r0,#0
   STRB   r0,[r3],#1
   LDRW   r4,`icon
   ADD    r4,r4,#1
   STRW   r4,`icon     ; next icon
   LDRW   r3,`window
   BL     isdragok
   CMP    r0,#0       ; is next icon valid
   BEQ    $DLnomore
   B      $DLreaddataiconloop
$DLeof
   LDRW   r4,`str
   CMP    r4,r3          ; have we stored anything yet ?
   MOVNE  r0,#0
   STRNEB r0,[r3],#1
   BLNE   updateicon     ; and only update if we have changed it...
$DLnomore
   LDRW   r1,`filehandle
   MOV    r0,#0       ; r0=0 close file
   SWI    "OS_Find"
._DLconfirm
   LDMFD  (sp),{r1}
   MOV    r0,#4
   STR    r0,[r1,#16]
   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
$loop
   CMP    r4,#1         ; how much space left ?
   BLE    $exit         ; is terminator then exit
   LDRB   r0,[r1],#1    ; get byte of filename
   STRB   r0,[r3],#1    ; store in block
   CMP    r0,#31        ; is this terminator
   BLE    $exit         ; if so, then exit
   SUB    r4,r4,#1
   B      $loop
$exit
   BL     updateicon
   B      _DLconfirm

.isdragok
   STMFD  (sp)!,{r1-r4,link}
   REM    "Win  = %&3"
   REM    "Icon = %&4"
   STRW   r3,`window
   STRW   r4,`icon
   ADRW   r1,`window
   SWI    "XWimp_GetIconState"
   BVS    $notdragok
   LDRW   r2,`flags
   TST    r2,#(1<<8)    ; is it indirected
   BEQ    $notdragok
   AND    r3,r2,#(15<<12)
   CMP    r3,#(14<<12)     ; write/click/drag
   CMPNE  r3,#(15<<12)     ; writeable
   BNE    $notdragok
   MOV    r0,#1
   REM    "Icon valid"
   LDMFD  (sp)!,{r1-r4,pc}
$notdragok
   MOV    r0,#0
   REM    "Icon not valid"
   LDMFD  (sp)!,{r1-r4,pc}

.updateicon
   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
   REM     CHR$4+"%IUpdating icon"
   ADRW    r1,`window
   SWI     "Wimp_GetIconState"
   ADD     r1,r1,#8                      ; remove first two words
   LDMIA   r1,{r1-r4}                    ; read lbrt into r1,r2,r3,r4
   LDRW    r0,`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
   MOV     r1,#&80             ; SHIFT key code
   SWI     "XOS_Byte"          ; Call OS_Byte to read status
   TEQ     r1,#&FF             ; is it pressed ?
   LDMFD   (sp)!,{r0-r2,pc}
; Check if the ctrl key is pressed
; < EQ if pressed
.checkctrl
   STMFD   (sp)!,{r0-r2,link}
   MOV     r0,#&79             ; Keyboard scan OS_Byte code
   MOV     r1,#&81             ; CTRL key code
   SWI     "XOS_Byte"          ; Call OS_Byte to read status
   TEQ     r1,#&FF             ; is it pressed ?
   LDMFD   (sp)!,{r0-r2,pc}

.`ourfilename:EQUS "<Wimp$Scrap>":EQUB 0:ALIGN

.ismouseclick
   STMFD   (sp)!,{r3-r9}    ; Stack registers
   LDR     r0,[r1,#8]
   REM     "Button event = %&0"
   BL      checkctrl
   LDRNE   r0,[r1,#8]       ; get buttons if ctrl not pressed�
   TSTNE   r0,#&40          ; �is this a select drag ?
   BEQ     $exit            ; if either then exit
;    SWI     &104
   REM     "Checking drag is ok"
   LDR     r3,[r1,#12]      ; window
   LDR     r4,[r1,#16]      ; icon
   BL      isdragok
   CMP     r0,#0
   BEQ     $exit
$isdrag
   LDRW    r2,`window
   MVN     r3,#NOT -1
   MOV     r0,#19
   SWI     "XWimp_SendMessage"  ; find the task handle
   BVS     $exit
   MOV     r6,r2                ; r6=task handle
   MOV     r8,#0                ; r8=pointer to rma
   MOV     r7,#0                ; r7=length of area (0 bytes)
   ADR     r2,`textfile         ; large text file icon to drag
   BL      setdrag
   BL      addline
;    SWI     &104
   REM     "Is one of our drag requests!!!"
   MOV     r0,#1
   STRW    r0,`dragging
   STRW    r8,`saveaddr
   STRW    r7,`savelen
   REM     "Data is length %r7, containing %$8"
   B       $noaction
$noaction
   MOV     r0,#0
   LDMFD   (sp)!,{r3-r9}              ; Restore registers
   LDMFD   (sp)!,{r1-r2,pc}           ; Return from call
$exit
   MOV     r0,#6
   LDMFD   (sp)!,{r3-r9}              ; Restore registers
   LDMFD   (sp)!,{r1-r2,pc}           ; Return from call

.`textfile
   EQUS    "File_FFF"+CHR$0
.`smallfile
   EQUS    "Small_FFF"+CHR$0
   ALIGN

; set the drag icon
.setdrag
   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
   CMP     r8,#0                ; is the current pointer set ?
   SWINE   "DragASprite_Stop"   ; if not then stop the current drag
   ADRW    r1,`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)
   ADRW    r5,`dragbox
   STMIA   r5,{r0-r3}           ; store drag box in block in WS
   LDR     r2,[sp,#8]           ; r2=sprite name
   MOV     r0,#%11000101        ; centre, constrain pointer, do shadow
   MOV     r1,#1                ; use Wimp sprite area
   MOV     r3,r5                ; r3=dragbox pointer
   SWI     "DragASprite_Start"
   REM     "Starting drag"
   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call

.wait
   STMFD   (sp)!,{r0-r1,link}            ; Stack registers
   SWI     "OS_ReadMonotonicTime"
   ADD     r1,r0,#5         ; r1=time now + delay
$loop
   SWI     "OS_ReadMonotonicTime"
   CMP     r0,r1            ; have we exceeded delay ?
   BLT     $loop            ; if not then keep checking�
   LDMFD   (sp)!,{r0-r1,pc}              ; Return from call

; Add a line from the icon pointed to by the block
.addline
   STMFD   (sp)!,{r0-r5,link}            ; Stack registers
   LDRW    r0,`str                       ; r0=string
   BL      lenctrl                       ; how long is the string
   REM     "Checking length = %r1, current block = %&8"
;    REM     "String located at %&0"
;    LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
;
   CMP     r8,#0                         ; is this the first call ?
   MOVEQ   r0,#6                         ; if so then claim new block
   MOVNE   r0,#13                        ; otherwise extend it
   MOVNE   r2,r8
   MOV     r3,r1                         ; r3=amount to claim/extend
   ADD     r3,r1,#1                      ; add extra byte for LF
   SWI     "OS_Module"                   ; claim/extend
   MOV     r8,r2                         ; r8=new area pointer
   ADD     r1,r2,r7                      ; r2=end of previous area
   LDRW    r0,`str                       ; r0=pointer to string to copy
   REM     "Moving %&0 to %&1"
   BL      movectrl                      ; copy it to the new area
   ADD     r7,r7,r3                      ; increment amount to copy
   MOV     r0,#10                        ; LF to add to end of line!
   SUB     r1,r7,#1                      ; store as last byte
   STRB    r0,[r8,r1]                    ; and store in memory
   LDMFD   (sp)!,{r0-r5,pc}              ; Return from call

.isdragdone
   STMFD   (sp)!,{r3-r9}                 ; Stack registers
   LDRW    r0,`dragging
   CMP     r0,#1
   CMPNE   r0,#3
   BNE     $exit
   REM     "%c04Drag done, in state %r0"
   SWI     "DragASprite_Stop"
   SWI     "Wimp_GetPointerInfo"
   LDMIA   r1,{r2,r3,r4,r5,r6}
   REM     "%R"
   STR     r5,[r1,#20]      ; store mx
   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
   STMIA   r1,{r2-r6}       ; store in block
   ADR     r0,`estlen       ; address of estimated length
   LDMIA   r0,{r2-r6}
   ADD     r0,r1,#36
   STMIA   r0,{r2-r6}       ; copy into block
   MOV     r0,#18           ; send recorded delivery�
   LDR     r2,[r1,#20]      ; get window to send to
   LDR     r3,[r1,#24]      ; get icon to send to
   REM     "Sending to %&2"
   SWI     "XWimp_SendMessage"
   MOVVS   r0,#0            ; not dragging if error
   MOVVC   r0,#2            ; if no error then on to save data message
   STRW    r0,`dragging
   REM     "Message sent, ok = %r0"
$noaction
   MOV     r0,#0
   LDMFD   (sp)!,{r1-r9,pc}              ; Return from call
$exit
   MOV     r0,#7
   LDMFD   (sp)!,{r1-r9,pc}              ; Return from call

.`estlen
   EQUD    -1 ; data not safe
.`texttype
   EQUD    &FFF
.`savename
   EQUS    "Icontext"+CHR$0

.checknullevent
   LDRW    r2,`dragging
   REM     "%c04%c30Current state = %r2"
   CMP     r2,#1
   BEQ     isnullevent
   CMP     r2,#3
   LDMNEFD (sp)!,{r1-r2,pc}         ; return if not a small drag
   STMFD   (sp)!,{r3-r9}            ; Stack registers
   ADRW    r1,`ptrblock
   SWI     "Wimp_GetPointerInfo"
   LDRW    r0,`mouseb
   TST     r0,#4
   BEQ     $dropped                 ; if you drop, but still hold adjust
   TST     r0,#1                    ; adjust ?
   BNE     $exit                    ; if still pressed then exit
   BL      wait
   LDRW    r8,`saveaddr             ; get save address
   ADR     r2,`textfile             ; swap back to biggy
   BL      setdrag
   MOV     r0,#1
   STRW    r0,`dragging
   MOV     r0,#0
$exit
   LDMFD   (sp)!,{r3-r9}
   LDMFD   (sp)!,{r1-r2,pc}         ; Return from call
$dropped
   LDMFD   (sp)!,{r3-r9}
   MOV     r0,#0
   B       isdragdone

.isnullevent
   STMFD   (sp)!,{r3-r9}            ; Stack registers
   STRW    r1,`userblock
   ADRW    r1,`ptrblock
   SWI     "Wimp_GetPointerInfo"
   LDRW    r0,`mouseb
   TST     r0,#1                    ; adjust ?
   BEQ     $exit
   LDRW    r3,`mousew
   LDRW    r4,`mousei
   BL      isdragok
   CMP     r0,#0                    ; is it a valid icon to add ?
   BEQ     $exit
   MOV     r0,#5                    ; read current task handle
   SWI     "Wimp_ReadSysInfo"
   MOV     r9,r0                    ; r9=current task
; read task handle we are over
   LDRW    r1,`userblock
   MOV     r2,r3
   MOV     r3,r4
   MOV     r0,#19
   SWI     "XWimp_SendMessage"  ; find the task handle
   REM     CHR$4+"%ICurrent = %&9, over = %&2, win = %&3, icon=%&4"
   CMP     r2,r9                ; are they the same task ?
   BEQ     $gotarea             ; if they are then `str is in right place
   MOV     r0,r2                ; r0=source (over)
   LDRW    r1,`str              ; r1=source data (in over)
   MOV     r2,r9                ; r2=dest (current)
   LDRW    r3,`userblock        ; r3=dest data (in current - users block!)
   MOV     r4,#256              ; r4=length
   REM     "Move from T%&0 to T%&2, from A%&1 to A%&3"
   SWI     "Wimp_TransferBlock"
   MOV     r0,#0
   STRB    r0,[r3,#255]         ; add a terminator in case the string is long
   STRW    r3,`str              ; store in block so that addline can find it
$gotarea
   LDRW    r3,`str
   REM     "Is one of ours, is %$3"
   LDRW    r7,`savelen
   LDRW    r8,`saveaddr
   REM     "Currently says %$8"
   BL      addline
   STRW    r8,`saveaddr
   STRW    r7,`savelen
   LADR    r2,`smallfile
   BL      setdrag
   MOV     r0,#3
   STRW    r0,`dragging         ; mark as currently dragging small
$exit
   MOV     r0,#0
   LDMFD   (sp)!,{r3-r9}                 ; Restore registers
   LDMFD   (sp)!,{r1-r2,pc}              ; Return from call

#Library "Strings",lenctrl.movectrl
# POST
# RUN <CODE>
# END

00000000  41 70 70 20 20 54 65 78  74 43 6f 70 79 0a 49 6e  |App  TextCopy.In|
00000010  20 20 20 2d 0a 4f 75 74  20 20 54 65 78 74 43 6f  |   -.Out  TextCo|
00000020  70 79 0a 54 79 70 65 20  4d 6f 64 75 6c 65 0a 56  |py.Type Module.V|
00000030  65 72 20 20 31 2e 31 31  62 0a 0a 44 65 66 69 6e  |er  1.11b..Defin|
00000040  65 20 57 6f 72 6b 73 70  61 63 65 0a 20 4e 61 6d  |e Workspace. Nam|
00000050  65 20 20 20 20 44 72 61  67 42 6f 78 0a 20 44 65  |e    DragBox. De|
00000060  66 61 75 6c 74 20 72 39  0a 20 50 72 65 66 69 78  |fault r9. Prefix|
00000070  20 20 64 62 5f 0a 20 20  60 6c 65 66 74 20 20 20  |  db_.  `left   |
00000080  20 20 20 20 20 21 20 20  20 20 6c 65 66 74 20 6f  |     !    left o|
00000090  66 20 69 63 6f 6e 0a 20  20 60 62 6f 74 74 6f 6d  |f icon.  `bottom|
000000a0  20 20 20 20 20 20 21 20  20 20 20 62 6f 74 74 6f  |      !    botto|
000000b0  6d 20 6f 66 20 69 63 6f  6e 0a 20 20 60 72 69 67  |m of icon.  `rig|
000000c0  68 74 20 20 20 20 20 20  20 21 20 20 20 20 72 69  |ht       !    ri|
000000d0  67 68 74 20 6f 66 20 69  63 6f 6e 0a 20 20 60 74  |ght of icon.  `t|
000000e0  6f 70 20 20 20 20 20 20  20 20 20 21 20 20 20 20  |op         !    |
000000f0  74 6f 70 20 6f 66 20 69  63 6f 6e 0a 20 4e 61 6d  |top of icon. Nam|
00000100  65 20 20 20 20 77 6f 72  6b 73 70 61 63 65 0a 20  |e    workspace. |
00000110  44 65 66 61 75 6c 74 20  72 31 32 0a 20 20 60 66  |Default r12.  `f|
00000120  69 6c 65 68 61 6e 64 6c  65 20 20 21 20 20 20 20  |ilehandle  !    |
00000130  68 61 6e 64 6c 65 20 6f  66 20 66 69 6c 65 20 74  |handle of file t|
00000140  6f 20 73 61 76 65 20 74  6f 0a 20 20 60 77 69 6e  |o save to.  `win|
00000150  64 6f 77 20 20 20 20 20  20 21 20 20 20 20 77 69  |dow      !    wi|
00000160  6e 64 6f 77 20 62 65 69  6e 67 20 64 72 61 67 67  |ndow being dragg|
00000170  65 64 20 74 6f 2f 66 72  6f 6d 0a 20 20 60 69 63  |ed to/from.  `ic|
00000180  6f 6e 20 20 20 20 20 20  20 20 21 20 20 20 20 69  |on        !    i|
00000190  63 6f 6e 20 62 65 69 6e  67 20 64 72 61 67 67 65  |con being dragge|
000001a0  64 20 74 6f 2f 66 72 6f  6d 0a 20 20 60 6c 65 66  |d to/from.  `lef|
000001b0  74 20 20 20 20 20 20 20  20 21 20 20 20 20 6c 65  |t        !    le|
000001c0  66 74 20 6f 66 20 69 63  6f 6e 0a 20 20 60 62 6f  |ft of icon.  `bo|
000001d0  74 74 6f 6d 20 20 20 20  20 20 21 20 20 20 20 62  |ttom      !    b|
000001e0  6f 74 74 6f 6d 20 6f 66  20 69 63 6f 6e 0a 20 20  |ottom of icon.  |
000001f0  60 72 69 67 68 74 20 20  20 20 20 20 20 21 20 20  |`right       !  |
00000200  20 20 72 69 67 68 74 20  6f 66 20 69 63 6f 6e 0a  |  right of icon.|
00000210  20 20 60 74 6f 70 20 20  20 20 20 20 20 20 20 21  |  `top         !|
00000220  20 20 20 20 74 6f 70 20  6f 66 20 69 63 6f 6e 0a  |    top of icon.|
00000230  20 20 60 66 6c 61 67 73  20 20 20 20 20 20 20 21  |  `flags       !|
00000240  20 20 20 20 69 63 6f 6e  20 66 6c 61 67 73 0a 20  |    icon flags. |
00000250  20 60 73 74 72 20 20 20  20 20 20 20 20 20 21 20  | `str         ! |
00000260  20 20 20 73 74 72 69 6e  67 20 70 6f 69 6e 74 65  |   string pointe|
00000270  72 0a 20 20 60 76 61 6c  69 64 20 20 20 20 20 20  |r.  `valid      |
00000280  20 21 20 20 20 20 76 61  6c 69 64 61 74 69 6f 6e  | !    validation|
00000290  20 70 6f 69 6e 74 65 72  0a 20 20 60 6c 65 6e 67  | pointer.  `leng|
000002a0  74 68 20 20 20 20 20 20  21 20 20 20 20 6c 65 6e  |th      !    len|
000002b0  67 74 68 20 6f 66 20 73  74 72 69 6e 67 0a 20 20  |gth of string.  |
000002c0  60 65 76 65 6e 74 74 79  70 65 20 20 20 21 20 20  |`eventtype   !  |
000002d0  20 20 54 65 6d 70 6f 72  61 72 79 20 73 74 6f 72  |  Temporary stor|
000002e0  65 20 66 6f 72 20 65 76  65 6e 74 20 74 79 70 65  |e for event type|
000002f0  0a 20 20 60 73 61 76 65  61 64 64 72 20 20 20 20  |.  `saveaddr    |
00000300  21 20 20 20 20 41 64 64  72 65 73 73 20 6f 66 20  |!    Address of |
00000310  74 65 78 74 20 74 6f 20  73 61 76 65 20 6f 75 74  |text to save out|
00000320  0a 20 20 60 73 61 76 65  6c 65 6e 20 20 20 20 20  |.  `savelen     |
00000330  21 20 20 20 20 4c 65 6e  67 74 68 20 6f 66 20 74  |!    Length of t|
00000340  65 78 74 20 74 6f 20 73  61 76 65 20 6f 75 74 0a  |ext to save out.|
00000350  20 20 60 64 72 61 67 62  6f 78 20 20 20 20 20 5e  |  `dragbox     ^|
00000360  44 72 61 67 42 6f 78 0a  20 20 60 75 73 65 72 62  |DragBox.  `userb|
00000370  6c 6f 63 6b 20 20 20 21  20 20 20 20 50 6f 69 6e  |lock   !    Poin|
00000380  74 65 72 20 74 6f 20 75  73 65 72 73 20 62 6c 6f  |ter to users blo|
00000390  63 6b 0a 20 20 60 70 74  72 62 6c 6f 63 6b 20 20  |ck.  `ptrblock  |
000003a0  20 20 21 20 20 20 20 42  6c 6f 63 6b 20 66 6f 72  |  !    Block for|
000003b0  20 70 6f 69 6e 74 65 72  20 69 6e 66 6f 72 6d 61  | pointer informa|
000003c0  74 69 6f 6e 2c 20 61 6e  64 20 78 20 63 6f 2d 6f  |tion, and x co-o|
000003d0  72 64 69 6e 61 74 65 20  6f 66 20 6d 6f 75 73 65  |rdinate of mouse|
000003e0  0a 20 20 60 6d 6f 75 73  65 79 20 20 20 20 20 20  |.  `mousey      |
000003f0  21 20 20 20 20 79 20 63  6f 2d 6f 72 64 69 6e 61  |!    y co-ordina|
00000400  74 65 20 6f 66 20 6d 6f  75 73 65 0a 20 20 60 6d  |te of mouse.  `m|
00000410  6f 75 73 65 62 20 20 20  20 20 20 21 20 20 20 20  |ouseb      !    |
00000420  62 75 74 74 6f 6e 20 73  74 61 74 65 20 6f 66 20  |button state of |
00000430  6d 6f 75 73 65 0a 20 20  60 6d 6f 75 73 65 77 20  |mouse.  `mousew |
00000440  20 20 20 20 20 21 20 20  20 20 77 69 6e 64 6f 77  |     !    window|
00000450  20 6d 6f 75 73 65 20 69  73 20 6f 76 65 72 0a 20  | mouse is over. |
00000460  20 60 6d 6f 75 73 65 69  20 20 20 20 20 20 21 20  | `mousei      ! |
00000470  20 20 20 69 63 6f 6e 20  6d 6f 75 73 65 20 69 73  |   icon mouse is|
00000480  20 6f 76 65 72 0a 20 20  60 64 72 61 67 67 69 6e  | over.  `draggin|
00000490  67 20 20 20 20 21 20 20  20 20 6d 61 72 6b 65 72  |g    !    marker|
000004a0  20 73 68 6f 77 69 6e 67  20 74 68 65 20 63 75 72  | showing the cur|
000004b0  72 65 6e 74 20 64 72 61  67 67 69 6e 67 20 73 74  |rent dragging st|
000004c0  61 74 65 0a 45 6e 64 20  57 6f 72 6b 73 70 61 63  |ate.End Workspac|
000004d0  65 0a 0a 44 65 66 69 6e  65 20 4d 6f 64 75 6c 65  |e..Define Module|
000004e0  0a 20 4e 61 6d 65 20 20  20 20 54 65 78 74 43 6f  |. Name    TextCo|
000004f0  70 79 0a 20 48 65 6c 70  20 20 20 20 54 65 78 74  |py. Help    Text|
00000500  20 43 6f 70 79 0a 20 41  75 74 68 6f 72 20 20 4a  | Copy. Author  J|
00000510  75 73 74 69 6e 20 46 6c  65 74 63 68 65 72 0a 20  |ustin Fletcher. |
00000520  49 6e 69 74 20 20 20 20  49 6e 69 74 43 6f 64 65  |Init    InitCode|
00000530  0a 20 43 6f 6d 6d 61 6e  64 73 0a 20 20 4e 61 6d  |. Commands.  Nam|
00000540  65 20 20 20 54 65 78 74  43 6f 70 79 0a 20 20 48  |e   TextCopy.  H|
00000550  65 6c 70 20 20 20 2e 2e  2e 0a 20 20 20 20 54 68  |elp   ....    Th|
00000560  65 20 54 65 78 74 43 6f  70 79 20 61 6c 6c 6f 77  |e TextCopy allow|
00000570  73 20 79 6f 75 20 74 6f  20 64 72 61 67 20 74 65  |s you to drag te|
00000580  78 74 20 66 69 6c 65 73  20 64 69 72 65 63 74 6c  |xt files directl|
00000590  79 20 6f 6e 20 74 6f 20  77 72 69 74 61 62 6c 65  |y on to writable|
000005a0  0a 20 20 20 20 69 63 6f  6e 73 2e 20 54 68 69 73  |.    icons. This|
000005b0  20 69 73 20 64 6f 6e 65  20 62 79 20 75 73 65 20  | is done by use |
000005c0  6f 66 20 66 69 6c 74 65  72 73 2c 20 73 6f 20 74  |of filters, so t|
000005d0  68 69 73 20 6d 61 79 20  63 6c 61 73 68 20 77 69  |his may clash wi|
000005e0  74 68 0a 20 20 20 20 61  70 70 6c 69 63 61 74 69  |th.    applicati|
000005f0  6f 6e 73 20 77 68 69 63  68 20 70 72 6f 63 65 73  |ons which proces|
00000600  73 20 74 65 78 74 20 66  69 6c 65 73 20 64 72 61  |s text files dra|
00000610  67 67 65 64 20 6f 6e 74  6f 20 77 72 69 74 65 61  |gged onto writea|
00000620  62 6c 65 20 69 63 6f 6e  73 2e 0a 20 20 20 20 49  |ble icons..    I|
00000630  66 20 6d 75 6c 74 69 70  6c 65 20 77 72 69 74 61  |f multiple writa|
00000640  62 6c 65 20 69 63 6f 6e  73 20 61 72 65 20 70 72  |ble icons are pr|
00000650  65 73 65 6e 74 2c 20 74  68 65 6e 20 74 68 65 20  |esent, then the |
00000660  74 65 78 74 20 77 69 6c  6c 20 73 70 61 6e 0a 20  |text will span. |
00000670  20 20 20 74 68 65 73 65  2e 7c 4d 0a 20 20 20 20  |   these.|M.    |
00000680  48 6f 6c 64 69 6e 67 20  64 6f 77 6e 20 53 68 69  |Holding down Shi|
00000690  66 74 20 77 68 65 6e 20  64 72 61 67 67 69 6e 67  |ft when dragging|
000006a0  20 77 69 6c 6c 20 63 6f  70 79 20 74 68 65 20 66  | will copy the f|
000006b0  69 6c 65 6e 61 6d 65 20  69 6e 74 6f 20 74 68 65  |ilename into the|
000006c0  20 69 63 6f 6e 2e 0a 20  20 20 20 7c 4d 7c 4d 44  | icon..    |M|MD|
000006d0  72 61 67 67 69 6e 67 20  6f 66 20 77 72 69 74 61  |ragging of writa|
000006e0  62 6c 65 20 69 63 6f 6e  73 20 69 73 20 61 6c 73  |ble icons is als|
000006f0  6f 20 70 6f 73 73 69 62  6c 65 20 66 6f 72 20 74  |o possible for t|
00000700  79 70 65 20 31 35 20 69  63 6f 6e 73 20 61 6e 64  |ype 15 icons and|
00000710  0a 20 20 20 20 66 6f 72  20 61 6c 6c 20 69 63 6f  |.    for all ico|
00000720  6e 73 20 69 66 20 74 68  65 20 41 6c 6c 57 43 44  |ns if the AllWCD|
00000730  20 6d 6f 64 75 6c 65 20  69 73 20 70 72 65 73 65  | module is prese|
00000740  6e 74 2e 7c 4d 7c 4d 0a  20 20 20 20 48 6f 6c 64  |nt.|M|M.    Hold|
00000750  69 6e 67 20 64 6f 77 6e  20 43 74 72 6c 20 77 68  |ing down Ctrl wh|
00000760  65 6e 20 64 72 61 67 67  69 6e 67 20 77 69 6c 6c  |en dragging will|
00000770  20 62 79 70 61 73 73 20  74 68 65 20 62 6f 74 68  | bypass the both|
00000780  20 70 61 74 63 68 65 73  2e 0a 20 45 6e 64 20 43  | patches.. End C|
00000790  6f 6d 6d 61 6e 64 73 0a  20 57 6f 72 6b 73 70 61  |ommands. Workspa|
000007a0  63 65 20 60 6c 65 6e 5f  77 6f 72 6b 73 70 61 63  |ce `len_workspac|
000007b0  65 0a 20 50 6f 73 74 46  69 6c 74 65 72 0a 20 20  |e. PostFilter.  |
000007c0  4e 61 6d 65 20 20 20 54  65 78 74 20 43 6f 70 79  |Name   Text Copy|
000007d0  0a 20 20 43 6f 64 65 20  20 20 66 69 6c 74 65 72  |.  Code   filter|
000007e0  63 6f 64 65 0a 20 20 54  61 73 6b 20 20 20 2d 0a  |code.  Task   -.|
000007f0  20 20 41 63 63 65 70 74  20 4e 75 6c 6c 0a 20 20  |  Accept Null.  |
00000800  41 63 63 65 70 74 20 44  72 61 67 44 72 6f 70 70  |Accept DragDropp|
00000810  65 64 0a 20 20 41 63 63  65 70 74 20 4d 6f 75 73  |ed.  Accept Mous|
00000820  65 43 6c 69 63 6b 0a 20  20 41 63 63 65 70 74 20  |eClick.  Accept |
00000830  4d 65 73 73 61 67 65 0a  20 20 41 63 63 65 70 74  |Message.  Accept|
00000840  20 4d 65 73 73 61 67 65  52 65 63 0a 20 20 41 63  | MessageRec.  Ac|
00000850  63 65 70 74 20 4d 65 73  73 61 67 65 41 63 6b 0a  |cept MessageAck.|
00000860  20 45 6e 64 20 46 69 6c  74 65 72 0a 45 6e 64 20  | End Filter.End |
00000870  4d 6f 64 75 6c 65 0a 0a  23 20 52 45 4d 20 4f 46  |Module..# REM OF|
00000880  46 0a 2e 49 6e 69 74 43  6f 64 65 0a 20 20 20 53  |F..InitCode.   S|
00000890  54 4d 46 44 20 20 28 73  70 29 21 2c 7b 72 30 2c  |TMFD  (sp)!,{r0,|
000008a0  6c 69 6e 6b 7d 0a 20 20  20 4d 4f 56 20 20 20 20  |link}.   MOV    |
000008b0  72 30 2c 23 30 0a 20 20  20 53 54 52 57 20 20 20  |r0,#0.   STRW   |
000008c0  72 30 2c 60 64 72 61 67  67 69 6e 67 0a 20 20 20  |r0,`dragging.   |
000008d0  4c 44 4d 46 44 20 20 28  73 70 29 21 2c 7b 72 30  |LDMFD  (sp)!,{r0|
000008e0  2c 70 63 7d 0a 0a 2e 66  69 6c 74 65 72 63 6f 64  |,pc}...filtercod|
000008f0  65 0a 20 20 20 53 54 4d  46 44 20 20 20 28 73 70  |e.   STMFD   (sp|
00000900  29 21 2c 7b 72 31 2d 72  32 2c 6c 69 6e 6b 7d 0a  |)!,{r1-r2,link}.|
00000910  20 20 20 43 4d 50 20 20  20 20 20 72 30 2c 23 30  |   CMP     r0,#0|
00000920  0a 20 20 20 42 45 51 20  20 20 20 20 63 68 65 63  |.   BEQ     chec|
00000930  6b 6e 75 6c 6c 65 76 65  6e 74 0a 20 20 20 43 4d  |knullevent.   CM|
00000940  50 20 20 20 20 20 72 30  2c 23 36 0a 20 20 20 42  |P     r0,#6.   B|
00000950  45 51 20 20 20 20 20 69  73 6d 6f 75 73 65 63 6c  |EQ     ismousecl|
00000960  69 63 6b 0a 20 20 20 43  4d 50 20 20 20 20 20 72  |ick.   CMP     r|
00000970  30 2c 23 37 0a 20 20 20  42 45 51 20 20 20 20 20  |0,#7.   BEQ     |
00000980  69 73 64 72 61 67 64 6f  6e 65 0a 20 20 20 43 4d  |isdragdone.   CM|
00000990  50 20 20 20 20 20 72 30  2c 23 31 37 0a 20 20 20  |P     r0,#17.   |
000009a0  43 4d 50 4e 45 20 20 20  72 30 2c 23 31 38 0a 20  |CMPNE   r0,#18. |
000009b0  20 20 42 45 51 20 20 20  20 20 69 73 6d 65 73 73  |  BEQ     ismess|
000009c0  61 67 65 0a 20 20 20 43  4d 50 20 20 20 20 20 72  |age.   CMP     r|
000009d0  30 2c 23 31 39 0a 20 20  20 42 45 51 20 20 20 20  |0,#19.   BEQ    |
000009e0  20 69 73 6d 65 73 73 61  67 65 61 63 6b 0a 20 20  | ismessageack.  |
000009f0  20 4c 44 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  | LDMFD   (sp)!,{|
00000a00  72 31 2d 72 32 2c 70 63  7d 0a 0a 2e 69 73 6d 65  |r1-r2,pc}...isme|
00000a10  73 73 61 67 65 61 63 6b  0a 20 20 20 53 54 52 57  |ssageack.   STRW|
00000a20  20 20 20 20 72 30 2c 60  65 76 65 6e 74 74 79 70  |    r0,`eventtyp|
00000a30  65 0a 20 20 20 52 45 4d  20 20 20 20 20 22 25 63  |e.   REM     "%c|
00000a40  30 34 25 63 33 30 41 63  6b 6e 6f 77 6c 65 64 67  |04%c30Acknowledg|
00000a50  65 64 22 0a 20 20 20 4c  44 52 20 20 20 20 20 72  |ed".   LDR     r|
00000a60  32 2c 5b 72 31 2c 23 31  36 5d 0a 20 20 20 43 4d  |2,[r1,#16].   CM|
00000a70  50 20 20 20 20 20 72 32  2c 23 31 0a 20 20 20 42  |P     r2,#1.   B|
00000a80  45 51 20 20 20 20 20 69  73 4e 6f 44 61 74 61 53  |EQ     isNoDataS|
00000a90  61 76 65 41 63 6b 20 20  20 20 20 20 20 20 20 20  |aveAck          |
00000aa0  20 3b 20 4e 6f 62 6f 64  79 20 6c 6f 76 65 73 20  | ; Nobody loves |
00000ab0  6d 65 2c 20 73 6f 20 74  72 61 6e 73 66 65 72 20  |me, so transfer |
00000ac0  64 69 65 73 8c 0a 20 20  20 42 20 20 20 20 20 20  |dies..   B      |
00000ad0  20 65 78 69 74 65 76 65  6e 74 0a 2e 69 73 6d 65  | exitevent..isme|
00000ae0  73 73 61 67 65 0a 20 20  20 53 54 52 57 20 20 20  |ssage.   STRW   |
00000af0  20 72 30 2c 60 65 76 65  6e 74 74 79 70 65 0a 20  | r0,`eventtype. |
00000b00  20 20 4c 44 52 20 20 20  20 20 72 32 2c 5b 72 31  |  LDR     r2,[r1|
00000b10  2c 23 31 36 5d 0a 20 20  20 52 45 4d 20 20 20 20  |,#16].   REM    |
00000b20  20 22 25 63 30 34 25 63  33 30 4d 65 73 73 61 67  | "%c04%c30Messag|
00000b30  65 20 25 26 32 22 0a 20  20 20 43 4d 50 20 20 20  |e %&2".   CMP   |
00000b40  20 20 72 32 2c 23 31 0a  20 20 20 42 45 51 20 20  |  r2,#1.   BEQ  |
00000b50  20 20 20 69 73 44 61 74  61 53 61 76 65 20 20 20  |   isDataSave   |
00000b60  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 49  |             ; I|
00000b70  6e 69 74 69 61 6c 20 6d  65 73 73 61 67 65 2c 20  |nitial message, |
00000b80  63 61 6e 20 49 20 73 61  76 65 20 74 6f 20 79 6f  |can I save to yo|
00000b90  75 20 3f 0a 20 20 20 43  4d 50 20 20 20 20 20 72  |u ?.   CMP     r|
00000ba0  32 2c 23 33 0a 20 20 20  42 45 51 20 20 20 20 20  |2,#3.   BEQ     |
00000bb0  69 73 44 61 74 61 4c 6f  61 64 20 20 20 20 20 20  |isDataLoad      |
00000bc0  20 20 20 20 20 20 20 20  20 20 3b 20 50 6c 65 61  |          ; Plea|
00000bd0  73 65 20 6c 6f 61 64 20  74 68 69 73 20 64 61 74  |se load this dat|
00000be0  61 20 66 72 6f 6d 20 6d  65 8c 0a 20 20 20 43 4d  |a from me..   CM|
00000bf0  50 20 20 20 20 20 72 32  2c 23 32 0a 20 20 20 42  |P     r2,#2.   B|
00000c00  45 51 20 20 20 20 20 69  73 44 61 74 61 53 61 76  |EQ     isDataSav|
00000c10  65 41 63 6b 20 20 20 20  20 20 20 20 20 20 20 20  |eAck            |
00000c20  20 3b 20 49 20 77 61 6e  74 20 79 6f 75 72 20 64  | ; I want your d|
00000c30  61 74 61 2c 20 67 69 76  65 20 69 74 20 74 6f 20  |ata, give it to |
00000c40  6d 65 20 6e 6f 77 8c 0a  2e 65 78 69 74 65 76 65  |me now...exiteve|
00000c50  6e 74 0a 20 20 20 4c 44  52 57 20 20 20 20 72 30  |nt.   LDRW    r0|
00000c60  2c 60 65 76 65 6e 74 74  79 70 65 0a 20 20 20 4c  |,`eventtype.   L|
00000c70  44 4d 46 44 20 20 20 28  73 70 29 21 2c 7b 72 31  |DMFD   (sp)!,{r1|
00000c80  2d 72 32 2c 70 63 7d 0a  0a 2e 69 73 44 61 74 61  |-r2,pc}...isData|
00000c90  53 61 76 65 41 63 6b 0a  20 20 20 4c 44 52 57 20  |SaveAck.   LDRW |
00000ca0  20 20 20 72 30 2c 60 64  72 61 67 67 69 6e 67 0a  |   r0,`dragging.|
00000cb0  20 20 20 43 4d 50 20 20  20 20 20 72 30 2c 23 32  |   CMP     r0,#2|
00000cc0  0a 20 20 20 42 4e 45 20  20 20 20 20 65 78 69 74  |.   BNE     exit|
00000cd0  65 76 65 6e 74 0a 20 20  20 52 45 4d 20 20 20 20  |event.   REM    |
00000ce0  20 22 44 61 74 61 20 73  61 76 65 20 69 6e 69 74  | "Data save init|
00000cf0  69 61 74 65 64 2e 2e 2e  22 0a 20 20 20 4d 4f 56  |iated...".   MOV|
00000d00  20 20 20 20 20 72 30 2c  23 31 30 0a 20 20 20 41  |     r0,#10.   A|
00000d10  44 44 20 20 20 20 20 72  31 2c 72 31 2c 23 34 34  |DD     r1,r1,#44|
00000d20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000d30  20 20 20 20 20 3b 20 61  64 64 72 65 73 73 20 69  |     ; address i|
00000d40  6e 20 62 6c 6f 63 6b 20  6f 66 20 66 69 6c 65 6e  |n block of filen|
00000d50  61 6d 65 0a 20 20 20 52  45 4d 20 20 20 20 20 22  |ame.   REM     "|
00000d60  46 69 6c 65 20 6e 61 6d  65 20 74 6f 20 73 61 76  |File name to sav|
00000d70  65 20 61 73 20 25 24 31  22 0a 20 20 20 4c 4d 4f  |e as %$1".   LMO|
00000d80  56 20 20 20 20 72 32 2c  23 26 46 46 46 20 20 20  |V    r2,#&FFF   |
00000d90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000da0  20 20 20 3b 20 66 69 6c  65 74 79 70 65 0a 20 20  |   ; filetype.  |
00000db0  20 4c 44 52 57 20 20 20  20 72 34 2c 60 73 61 76  | LDRW    r4,`sav|
00000dc0  65 61 64 64 72 20 20 20  20 20 20 20 20 20 20 20  |eaddr           |
00000dd0  20 20 20 20 20 20 20 3b  20 73 74 61 72 74 20 61  |       ; start a|
00000de0  64 64 72 65 73 73 0a 20  20 20 4c 44 52 57 20 20  |ddress.   LDRW  |
00000df0  20 20 72 35 2c 60 73 61  76 65 6c 65 6e 20 20 20  |  r5,`savelen   |
00000e00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e10  3b 20 6c 65 6e 67 74 68  0a 20 20 20 41 44 44 20  |; length.   ADD |
00000e20  20 20 20 20 72 35 2c 72  35 2c 72 34 20 20 20 20  |    r5,r5,r4    |
00000e30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e40  20 20 3b 20 65 6e 64 20  61 64 64 72 65 73 73 0a  |  ; end address.|
00000e50  20 20 20 52 45 4d 20 20  20 20 20 22 53 61 76 65  |   REM     "Save|
00000e60  20 6d 65 6d 6f 72 79 20  25 26 34 20 2d 20 25 26  | memory %&4 - %&|
00000e70  35 22 0a 20 20 20 53 57  49 20 20 20 20 20 22 4f  |5".   SWI     "O|
00000e80  53 5f 46 69 6c 65 22 20  20 20 20 20 20 20 20 20  |S_File"         |
00000e90  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 73 61  |            ; sa|
00000ea0  76 65 20 66 69 6c 65 0a  20 20 20 53 55 42 20 20  |ve file.   SUB  |
00000eb0  20 20 20 72 31 2c 72 31  2c 23 34 34 20 20 20 20  |   r1,r1,#44    |
00000ec0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000ed0  20 3b 20 72 65 73 74 6f  72 65 20 62 6c 6f 63 6b  | ; restore block|
00000ee0  20 70 6f 69 6e 74 65 72  0a 20 20 20 4d 4f 56 20  | pointer.   MOV |
00000ef0  20 20 20 20 72 30 2c 23  33 20 20 20 20 20 20 20  |    r0,#3       |
00000f00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000f10  20 20 3b 20 61 63 6b 6e  6f 77 6c 65 64 67 65 20  |  ; acknowledge |
00000f20  73 65 6e 64 69 6e 67 20  6f 66 20 64 61 74 61 0a  |sending of data.|
00000f30  20 20 20 53 54 52 20 20  20 20 20 72 30 2c 5b 72  |   STR     r0,[r|
00000f40  31 2c 23 31 36 5d 20 20  20 20 20 20 20 20 20 20  |1,#16]          |
00000f50  20 20 20 20 20 20 20 20  20 3b 20 73 74 6f 72 65  |         ; store|
00000f60  20 69 6e 20 62 6c 6f 63  6b 0a 20 20 20 4c 44 52  | in block.   LDR|
00000f70  20 20 20 20 20 72 30 2c  5b 72 31 2c 23 38 5d 20  |     r0,[r1,#8] |
00000f80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000f90  20 20 20 3b 20 67 65 74  20 74 68 65 69 72 20 72  |   ; get their r|
00000fa0  65 66 0a 20 20 20 53 54  52 20 20 20 20 20 72 30  |ef.   STR     r0|
00000fb0  2c 5b 72 31 2c 23 31 32  5d 20 20 20 20 20 20 20  |,[r1,#12]       |
00000fc0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 73 74  |            ; st|
00000fd0  6f 72 65 20 69 6e 20 6f  75 72 20 72 65 66 20 74  |ore in our ref t|
00000fe0  6f 20 6d 61 72 6b 20 61  73 20 72 65 70 6c 79 0a  |o mark as reply.|
00000ff0  20 20 20 4c 44 52 20 20  20 20 20 72 32 2c 5b 72  |   LDR     r2,[r|
00001000  31 2c 23 34 5d 20 20 20  20 20 20 20 20 20 20 20  |1,#4]           |
00001010  20 20 20 20 20 20 20 20  20 3b 20 74 61 73 6b 20  |         ; task |
00001020  74 6f 20 72 65 74 75 72  6e 20 74 6f 0a 20 20 20  |to return to.   |
00001030  4d 4f 56 20 20 20 20 20  72 30 2c 23 31 37 0a 20  |MOV     r0,#17. |
00001040  20 20 53 57 49 20 20 20  20 20 22 57 69 6d 70 5f  |  SWI     "Wimp_|
00001050  53 65 6e 64 4d 65 73 73  61 67 65 22 20 20 20 20  |SendMessage"    |
00001060  20 20 20 20 20 20 20 20  3b 20 74 65 6c 6c 20 74  |        ; tell t|
00001070  68 65 6d 2e 2e 2e 0a 20  20 20 4d 4f 56 20 20 20  |hem....   MOV   |
00001080  20 20 72 30 2c 23 30 0a  20 20 20 53 54 52 57 20  |  r0,#0.   STRW |
00001090  20 20 20 72 30 2c 60 64  72 61 67 67 69 6e 67 20  |   r0,`dragging |
000010a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000010b0  20 3b 20 6d 61 72 6b 20  61 73 20 6e 6f 74 20 64  | ; mark as not d|
000010c0  72 61 67 67 69 6e 67 0a  20 20 20 4c 44 4d 46 44  |ragging.   LDMFD|
000010d0  20 20 20 28 73 70 29 21  2c 7b 72 31 2d 72 32 2c  |   (sp)!,{r1-r2,|
000010e0  70 63 7d 20 20 20 20 20  20 20 20 20 20 20 20 20  |pc}             |
000010f0  20 3b 20 52 65 74 75 72  6e 20 66 72 6f 6d 20 63  | ; Return from c|
00001100  61 6c 6c 0a 0a 2e 69 73  4e 6f 44 61 74 61 53 61  |all...isNoDataSa|
00001110  76 65 41 63 6b 0a 20 20  20 4c 44 52 57 20 20 20  |veAck.   LDRW   |
00001120  20 72 30 2c 60 64 72 61  67 67 69 6e 67 0a 20 20  | r0,`dragging.  |
00001130  20 43 4d 50 20 20 20 20  20 72 30 2c 23 32 0a 20  | CMP     r0,#2. |
00001140  20 20 42 4e 45 20 20 20  20 20 65 78 69 74 65 76  |  BNE     exitev|
00001150  65 6e 74 0a 20 20 20 4d  4f 56 20 20 20 20 20 72  |ent.   MOV     r|
00001160  30 2c 23 30 0a 20 20 20  53 54 52 57 20 20 20 20  |0,#0.   STRW    |
00001170  72 30 2c 60 64 72 61 67  67 69 6e 67 20 20 20 20  |r0,`dragging    |
00001180  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00001190  6d 61 72 6b 20 61 73 20  6e 6f 74 20 64 72 61 67  |mark as not drag|
000011a0  67 69 6e 67 0a 20 20 20  4c 44 4d 46 44 20 20 20  |ging.   LDMFD   |
000011b0  28 73 70 29 21 2c 7b 72  31 2d 72 32 2c 70 63 7d  |(sp)!,{r1-r2,pc}|
000011c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000011d0  52 65 74 75 72 6e 20 66  72 6f 6d 20 63 61 6c 6c  |Return from call|
000011e0  0a 0a 2e 69 73 44 61 74  61 53 61 76 65 0a 3b 20  |...isDataSave.; |
000011f0  63 68 65 63 6b 20 66 6f  72 20 74 68 65 20 63 6f  |check for the co|
00001200  72 72 65 63 74 20 69 63  6f 6e 0a 20 20 20 52 45  |rrect icon.   RE|
00001210  4d 20 20 20 20 22 43 68  65 63 6b 20 69 63 6f 6e  |M    "Check icon|
00001220  22 0a 20 20 20 42 4c 20  20 20 20 20 63 68 65 63  |".   BL     chec|
00001230  6b 63 74 72 6c 0a 20 20  20 42 45 51 20 20 20 20  |kctrl.   BEQ    |
00001240  65 78 69 74 65 76 65 6e  74 0a 20 20 20 4c 44 52  |exitevent.   LDR|
00001250  20 20 20 20 72 32 2c 5b  72 31 2c 23 34 30 5d 0a  |    r2,[r1,#40].|
00001260  20 20 20 41 44 44 20 20  20 20 72 32 2c 72 32 2c  |   ADD    r2,r2,|
00001270  23 31 0a 20 20 20 43 4d  50 20 20 20 20 72 32 2c  |#1.   CMP    r2,|
00001280  23 26 31 30 30 30 0a 20  20 20 42 4e 45 20 20 20  |#&1000.   BNE   |
00001290  20 65 78 69 74 65 76 65  6e 74 0a 20 20 20 42 4c  | exitevent.   BL|
000012a0  20 20 20 20 20 63 68 65  63 6b 73 68 69 66 74 20  |     checkshift |
000012b0  20 20 20 20 20 3b 20 69  73 20 73 68 69 66 74 20  |     ; is shift |
000012c0  70 72 65 73 73 65 64 20  3f 0a 20 20 20 42 45 51  |pressed ?.   BEQ|
000012d0  20 20 20 20 65 78 69 74  65 76 65 6e 74 20 20 20  |    exitevent   |
000012e0  20 20 20 20 3b 20 69 66  20 73 6f 20 74 68 65 6e  |    ; if so then|
000012f0  20 65 78 69 74 2c 20 27  63 6f 73 20 77 65 20 63  | exit, 'cos we c|
00001300  61 6e 27 74 20 64 65 61  6c 20 77 69 74 68 20 69  |an't deal with i|
00001310  74 20 68 65 72 65 0a 20  20 20 4c 44 52 20 20 20  |t here.   LDR   |
00001320  20 72 33 2c 5b 72 31 2c  23 32 30 5d 20 20 20 20  | r3,[r1,#20]    |
00001330  20 3b 20 77 69 6e 64 6f  77 0a 20 20 20 4c 44 52  | ; window.   LDR|
00001340  20 20 20 20 72 34 2c 5b  72 31 2c 23 32 34 5d 20  |    r4,[r1,#24] |
00001350  20 20 20 20 3b 20 69 63  6f 6e 0a 20 20 20 42 4c  |    ; icon.   BL|
00001360  20 20 20 20 20 69 73 64  72 61 67 6f 6b 0a 20 20  |     isdragok.  |
00001370  20 43 4d 50 20 20 20 20  72 30 2c 23 30 0a 20 20  | CMP    r0,#0.  |
00001380  20 42 45 51 20 20 20 20  65 78 69 74 65 76 65 6e  | BEQ    exiteven|
00001390  74 0a 20 20 20 4c 44 4d  46 44 20 20 28 73 70 29  |t.   LDMFD  (sp)|
000013a0  2c 7b 72 31 7d 0a 3b 20  65 6e 64 20 6f 66 20 63  |,{r1}.; end of c|
000013b0  68 65 63 6b 0a 20 20 20  4d 56 4e 20 20 20 20 72  |heck.   MVN    r|
000013c0  32 2c 23 4e 4f 54 20 2d  31 0a 20 20 20 53 54 52  |2,#NOT -1.   STR|
000013d0  20 20 20 20 72 32 2c 5b  72 31 2c 23 33 36 5d 20  |    r2,[r1,#36] |
000013e0  20 20 3b 20 64 61 74 61  20 6e 6f 74 20 73 61 66  |  ; data not saf|
000013f0  65 0a 20 20 20 4d 4f 56  20 20 20 20 72 32 2c 23  |e.   MOV    r2,#|
00001400  31 32 38 0a 20 20 20 53  54 52 20 20 20 20 72 32  |128.   STR    r2|
00001410  2c 5b 72 31 2c 23 30 5d  20 20 20 20 3b 20 6c 65  |,[r1,#0]    ; le|
00001420  6e 67 74 68 20 6f 66 20  62 6c 6f 63 6b 0a 20 20  |ngth of block.  |
00001430  20 4d 4f 56 20 20 20 20  72 32 2c 23 32 0a 20 20  | MOV    r2,#2.  |
00001440  20 53 54 52 20 20 20 20  72 32 2c 5b 72 31 2c 23  | STR    r2,[r1,#|
00001450  31 36 5d 20 20 20 3b 20  6f 6b 20 73 61 76 65 20  |16]   ; ok save |
00001460  66 69 6c 65 20 6d 65 73  73 61 67 65 0a 20 20 20  |file message.   |
00001470  4c 44 52 20 20 20 20 72  32 2c 5b 72 31 2c 23 38  |LDR    r2,[r1,#8|
00001480  5d 0a 20 20 20 53 54 52  20 20 20 20 72 32 2c 5b  |].   STR    r2,[|
00001490  72 31 2c 23 31 32 5d 20  20 20 3b 20 6e 6f 74 65  |r1,#12]   ; note|
000014a0  20 6d 65 73 73 61 67 65  20 6e 75 6d 62 65 72 0a  | message number.|
000014b0  20 20 20 4c 41 44 52 20  20 20 72 33 2c 60 6f 75  |   LADR   r3,`ou|
000014c0  72 66 69 6c 65 6e 61 6d  65 0a 20 20 20 41 44 44  |rfilename.   ADD|
000014d0  20 20 20 20 72 34 2c 72  31 2c 23 34 34 20 20 20  |    r4,r1,#44   |
000014e0  20 20 3b 20 73 74 61 72  74 20 6f 66 20 66 69 6c  |  ; start of fil|
000014f0  65 6e 61 6d 65 0a 24 44  53 66 69 6c 65 6e 61 6d  |ename.$DSfilenam|
00001500  65 6c 6f 6f 70 0a 20 20  20 4c 44 52 42 20 20 20  |eloop.   LDRB   |
00001510  72 32 2c 5b 72 33 5d 2c  23 31 0a 20 20 20 53 54  |r2,[r3],#1.   ST|
00001520  52 42 20 20 20 72 32 2c  5b 72 34 5d 2c 23 31 0a  |RB   r2,[r4],#1.|
00001530  20 20 20 43 4d 50 20 20  20 20 72 32 2c 23 33 31  |   CMP    r2,#31|
00001540  0a 20 20 20 42 47 54 20  20 20 20 24 44 53 66 69  |.   BGT    $DSfi|
00001550  6c 65 6e 61 6d 65 6c 6f  6f 70 0a 20 20 20 4d 4f  |lenameloop.   MO|
00001560  56 20 20 20 20 72 30 2c  23 31 37 0a 20 20 20 4c  |V    r0,#17.   L|
00001570  44 52 20 20 20 20 72 32  2c 5b 72 31 2c 23 34 5d  |DR    r2,[r1,#4]|
00001580  0a 20 20 20 53 57 49 20  20 20 20 22 57 69 6d 70  |.   SWI    "Wimp|
00001590  5f 53 65 6e 64 4d 65 73  73 61 67 65 22 0a 20 20  |_SendMessage".  |
000015a0  20 4d 4f 56 20 20 20 20  72 30 2c 23 30 0a 20 20  | MOV    r0,#0.  |
000015b0  20 4c 44 4d 46 44 20 20  28 73 70 29 21 2c 7b 72  | LDMFD  (sp)!,{r|
000015c0  31 2d 72 32 2c 70 63 7d  0a 0a 2e 69 73 44 61 74  |1-r2,pc}...isDat|
000015d0  61 4c 6f 61 64 0a 3b 20  63 68 65 63 6b 20 66 6f  |aLoad.; check fo|
000015e0  72 20 74 68 65 20 63 6f  72 72 65 63 74 20 69 63  |r the correct ic|
000015f0  6f 6e 0a 20 20 20 52 45  4d 20 20 20 20 22 44 61  |on.   REM    "Da|
00001600  74 61 4c 6f 61 64 22 0a  20 20 20 42 4c 20 20 20  |taLoad".   BL   |
00001610  20 20 63 68 65 63 6b 63  74 72 6c 0a 20 20 20 42  |  checkctrl.   B|
00001620  45 51 20 20 20 20 65 78  69 74 65 76 65 6e 74 0a  |EQ    exitevent.|
00001630  20 20 20 42 4c 20 20 20  20 20 63 68 65 63 6b 73  |   BL     checks|
00001640  68 69 66 74 20 20 20 20  20 20 3b 20 69 73 20 73  |hift      ; is s|
00001650  68 69 66 74 20 70 72 65  73 73 65 64 20 3f 0a 20  |hift pressed ?. |
00001660  20 20 42 4e 45 20 20 20  20 24 6e 6f 74 73 68 69  |  BNE    $notshi|
00001670  66 74 0a 20 20 20 4c 44  52 45 51 20 20 72 32 2c  |ft.   LDREQ  r2,|
00001680  5b 72 31 2c 23 33 36 5d  20 20 20 20 20 3b 20 69  |[r1,#36]     ; i|
00001690  66 20 73 6f 20 74 68 65  6e 20 69 73 20 74 68 69  |f so then is thi|
000016a0  73 20 64 61 74 61 20 73  61 66 65 20 3f 0a 20 20  |s data safe ?.  |
000016b0  20 43 4d 4e 45 51 20 20  72 32 2c 23 31 20 20 20  | CMNEQ  r2,#1   |
000016c0  20 20 20 20 20 20 20 20  3b 20 69 73 20 69 74 20  |        ; is it |
000016d0  2d 31 20 28 75 6e 73 61  66 65 20 3f 29 0a 20 20  |-1 (unsafe ?).  |
000016e0  20 42 45 51 20 20 20 20  65 78 69 74 65 76 65 6e  | BEQ    exiteven|
000016f0  74 0a 20 20 20 42 20 20  20 20 20 20 24 6f 6b 74  |t.   B      $okt|
00001700  6f 6c 6f 61 64 0a 24 6e  6f 74 73 68 69 66 74 0a  |oload.$notshift.|
00001710  20 20 20 4c 44 52 20 20  20 20 72 32 2c 5b 72 31  |   LDR    r2,[r1|
00001720  2c 23 34 30 5d 0a 20 20  20 41 44 44 20 20 20 20  |,#40].   ADD    |
00001730  72 32 2c 72 32 2c 23 31  0a 20 20 20 43 4d 50 20  |r2,r2,#1.   CMP |
00001740  20 20 20 72 32 2c 23 26  31 30 30 30 0a 20 20 20  |   r2,#&1000.   |
00001750  42 4e 45 20 20 20 20 65  78 69 74 65 76 65 6e 74  |BNE    exitevent|
00001760  0a 24 6f 6b 74 6f 6c 6f  61 64 0a 20 20 20 4c 44  |.$oktoload.   LD|
00001770  52 20 20 20 20 72 33 2c  5b 72 31 2c 23 32 30 5d  |R    r3,[r1,#20]|
00001780  20 20 20 3b 20 77 69 6e  64 6f 77 0a 20 20 20 4c  |   ; window.   L|
00001790  44 52 20 20 20 20 72 34  2c 5b 72 31 2c 23 32 34  |DR    r4,[r1,#24|
000017a0  5d 20 20 20 3b 20 69 63  6f 6e 0a 20 20 20 42 4c  |]   ; icon.   BL|
000017b0  20 20 20 20 20 69 73 64  72 61 67 6f 6b 0a 20 20  |     isdragok.  |
000017c0  20 43 4d 50 20 20 20 20  72 30 2c 23 30 0a 20 20  | CMP    r0,#0.  |
000017d0  20 42 45 51 20 20 20 20  65 78 69 74 65 76 65 6e  | BEQ    exiteven|
000017e0  74 0a 3b 20 65 6e 64 20  6f 66 20 63 68 65 63 6b  |t.; end of check|
000017f0  0a 20 20 20 4c 44 4d 46  44 20 20 28 73 70 29 2c  |.   LDMFD  (sp),|
00001800  7b 72 31 7d 0a 20 20 20  4c 44 52 57 20 20 20 72  |{r1}.   LDRW   r|
00001810  33 2c 60 73 74 72 0a 20  20 20 4c 44 52 57 20 20  |3,`str.   LDRW  |
00001820  20 72 34 2c 60 6c 65 6e  67 74 68 0a 20 20 20 41  | r4,`length.   A|
00001830  44 44 20 20 20 20 72 31  2c 72 31 2c 23 34 34 20  |DD    r1,r1,#44 |
00001840  20 20 3b 20 66 69 6c 65  6e 61 6d 65 0a 20 20 20  |  ; filename.   |
00001850  42 4c 20 20 20 20 20 63  68 65 63 6b 73 68 69 66  |BL     checkshif|
00001860  74 20 20 3b 20 69 73 20  73 68 69 66 74 20 64 72  |t  ; is shift dr|
00001870  61 67 20 3f 0a 20 20 20  42 45 51 20 20 20 20 64  |ag ?.   BEQ    d|
00001880  6f 73 68 69 66 74 64 72  61 67 20 3b 20 69 66 20  |oshiftdrag ; if |
00001890  73 6f 20 74 68 65 6e 20  6f 6e 6c 79 20 63 6f 70  |so then only cop|
000018a0  79 20 66 69 6c 65 6e 61  6d 65 8c 0a 20 20 20 4d  |y filename..   M|
000018b0  4f 56 20 20 20 20 72 30  2c 23 26 34 30 20 20 20  |OV    r0,#&40   |
000018c0  20 20 3b 20 6f 70 65 6e  69 6e 67 20 66 69 6c 65  |  ; opening file|
000018d0  20 66 6f 72 20 69 6e 70  75 74 0a 20 20 20 53 57  | for input.   SW|
000018e0  49 20 20 20 20 22 4f 53  5f 46 69 6e 64 22 20 20  |I    "OS_Find"  |
000018f0  20 3b 20 6f 70 65 6e 20  66 69 6c 65 0a 20 20 20  | ; open file.   |
00001900  53 54 52 57 20 20 20 72  30 2c 60 66 69 6c 65 68  |STRW   r0,`fileh|
00001910  61 6e 64 6c 65 0a 20 20  20 52 45 4d 20 20 20 20  |andle.   REM    |
00001920  22 48 61 6e 64 6c 65 20  25 72 30 22 0a 24 44 4c  |"Handle %r0".$DL|
00001930  72 65 61 64 64 61 74 61  69 63 6f 6e 6c 6f 6f 70  |readdataiconloop|
00001940  0a 20 20 20 4c 44 52 57  20 20 20 72 33 2c 60 73  |.   LDRW   r3,`s|
00001950  74 72 0a 20 20 20 4c 44  52 57 20 20 20 72 34 2c  |tr.   LDRW   r4,|
00001960  60 6c 65 6e 67 74 68 0a  24 44 4c 72 65 61 64 64  |`length.$DLreadd|
00001970  61 74 61 6c 6f 6f 70 0a  20 20 20 4c 44 52 57 20  |ataloop.   LDRW |
00001980  20 20 72 31 2c 60 66 69  6c 65 68 61 6e 64 6c 65  |  r1,`filehandle|
00001990  0a 20 20 20 4d 4f 56 20  20 20 20 72 30 2c 23 26  |.   MOV    r0,#&|
000019a0  37 46 20 20 20 20 20 3b  20 63 68 65 63 6b 20 45  |7F     ; check E|
000019b0  4f 46 0a 20 20 20 53 57  49 20 20 20 20 22 4f 53  |OF.   SWI    "OS|
000019c0  5f 42 79 74 65 22 0a 20  20 20 43 4d 50 20 20 20  |_Byte".   CMP   |
000019d0  20 72 31 2c 23 30 0a 20  20 20 42 4e 45 20 20 20  | r1,#0.   BNE   |
000019e0  20 24 44 4c 65 6f 66 0a  20 20 20 43 4d 50 20 20  | $DLeof.   CMP  |
000019f0  20 20 72 34 2c 23 31 20  20 20 20 20 20 20 3b 20  |  r4,#1       ; |
00001a00  69 73 20 74 68 69 73 20  6c 61 73 74 20 63 68 61  |is this last cha|
00001a10  72 0a 20 20 20 42 45 51  20 20 20 20 24 44 4c 6e  |r.   BEQ    $DLn|
00001a20  65 78 74 69 63 6f 6e 20  3b 20 69 66 20 73 6f 2c  |exticon ; if so,|
00001a30  20 6e 65 78 74 20 69 63  6f 6e 0a 20 20 20 4c 44  | next icon.   LD|
00001a40  52 57 20 20 20 72 31 2c  60 66 69 6c 65 68 61 6e  |RW   r1,`filehan|
00001a50  64 6c 65 0a 20 20 20 53  57 49 20 20 20 20 22 58  |dle.   SWI    "X|
00001a60  4f 53 5f 42 47 65 74 22  0a 20 20 20 53 54 52 42  |OS_BGet".   STRB|
00001a70  20 20 20 72 30 2c 5b 72  33 5d 2c 23 31 0a 20 20  |   r0,[r3],#1.  |
00001a80  20 43 4d 50 20 20 20 20  72 30 2c 23 33 31 20 20  | CMP    r0,#31  |
00001a90  20 20 20 20 20 3b 20 69  73 20 74 68 69 73 20 74  |     ; is this t|
00001aa0  65 72 6d 69 6e 61 74 6f  72 0a 20 20 20 42 4c 45  |erminator.   BLE|
00001ab0  20 20 20 20 24 44 4c 6e  65 78 74 69 63 6f 6e 20  |    $DLnexticon |
00001ac0  20 3b 20 69 66 20 73 6f  2c 20 6e 65 78 74 20 69  | ; if so, next i|
00001ad0  63 6f 6e 0a 20 20 20 53  55 42 20 20 20 20 72 34  |con.   SUB    r4|
00001ae0  2c 72 34 2c 23 31 0a 20  20 20 42 20 20 20 20 20  |,r4,#1.   B     |
00001af0  20 24 44 4c 72 65 61 64  64 61 74 61 6c 6f 6f 70  | $DLreaddataloop|
00001b00  0a 24 44 4c 6e 65 78 74  69 63 6f 6e 0a 20 20 20  |.$DLnexticon.   |
00001b10  42 4c 20 20 20 20 20 75  70 64 61 74 65 69 63 6f  |BL     updateico|
00001b20  6e 0a 20 20 20 4d 4f 56  20 20 20 20 72 30 2c 23  |n.   MOV    r0,#|
00001b30  30 0a 20 20 20 53 54 52  42 20 20 20 72 30 2c 5b  |0.   STRB   r0,[|
00001b40  72 33 5d 2c 23 31 0a 20  20 20 4c 44 52 57 20 20  |r3],#1.   LDRW  |
00001b50  20 72 34 2c 60 69 63 6f  6e 0a 20 20 20 41 44 44  | r4,`icon.   ADD|
00001b60  20 20 20 20 72 34 2c 72  34 2c 23 31 0a 20 20 20  |    r4,r4,#1.   |
00001b70  53 54 52 57 20 20 20 72  34 2c 60 69 63 6f 6e 20  |STRW   r4,`icon |
00001b80  20 20 20 20 3b 20 6e 65  78 74 20 69 63 6f 6e 0a  |    ; next icon.|
00001b90  20 20 20 4c 44 52 57 20  20 20 72 33 2c 60 77 69  |   LDRW   r3,`wi|
00001ba0  6e 64 6f 77 0a 20 20 20  42 4c 20 20 20 20 20 69  |ndow.   BL     i|
00001bb0  73 64 72 61 67 6f 6b 0a  20 20 20 43 4d 50 20 20  |sdragok.   CMP  |
00001bc0  20 20 72 30 2c 23 30 20  20 20 20 20 20 20 3b 20  |  r0,#0       ; |
00001bd0  69 73 20 6e 65 78 74 20  69 63 6f 6e 20 76 61 6c  |is next icon val|
00001be0  69 64 0a 20 20 20 42 45  51 20 20 20 20 24 44 4c  |id.   BEQ    $DL|
00001bf0  6e 6f 6d 6f 72 65 0a 20  20 20 42 20 20 20 20 20  |nomore.   B     |
00001c00  20 24 44 4c 72 65 61 64  64 61 74 61 69 63 6f 6e  | $DLreaddataicon|
00001c10  6c 6f 6f 70 0a 24 44 4c  65 6f 66 0a 20 20 20 4c  |loop.$DLeof.   L|
00001c20  44 52 57 20 20 20 72 34  2c 60 73 74 72 0a 20 20  |DRW   r4,`str.  |
00001c30  20 43 4d 50 20 20 20 20  72 34 2c 72 33 20 20 20  | CMP    r4,r3   |
00001c40  20 20 20 20 20 20 20 3b  20 68 61 76 65 20 77 65  |       ; have we|
00001c50  20 73 74 6f 72 65 64 20  61 6e 79 74 68 69 6e 67  | stored anything|
00001c60  20 79 65 74 20 3f 0a 20  20 20 4d 4f 56 4e 45 20  | yet ?.   MOVNE |
00001c70  20 72 30 2c 23 30 0a 20  20 20 53 54 52 4e 45 42  | r0,#0.   STRNEB|
00001c80  20 72 30 2c 5b 72 33 5d  2c 23 31 0a 20 20 20 42  | r0,[r3],#1.   B|
00001c90  4c 4e 45 20 20 20 75 70  64 61 74 65 69 63 6f 6e  |LNE   updateicon|
00001ca0  20 20 20 20 20 3b 20 61  6e 64 20 6f 6e 6c 79 20  |     ; and only |
00001cb0  75 70 64 61 74 65 20 69  66 20 77 65 20 68 61 76  |update if we hav|
00001cc0  65 20 63 68 61 6e 67 65  64 20 69 74 2e 2e 2e 0a  |e changed it....|
00001cd0  24 44 4c 6e 6f 6d 6f 72  65 0a 20 20 20 4c 44 52  |$DLnomore.   LDR|
00001ce0  57 20 20 20 72 31 2c 60  66 69 6c 65 68 61 6e 64  |W   r1,`filehand|
00001cf0  6c 65 0a 20 20 20 4d 4f  56 20 20 20 20 72 30 2c  |le.   MOV    r0,|
00001d00  23 30 20 20 20 20 20 20  20 3b 20 72 30 3d 30 20  |#0       ; r0=0 |
00001d10  63 6c 6f 73 65 20 66 69  6c 65 0a 20 20 20 53 57  |close file.   SW|
00001d20  49 20 20 20 20 22 4f 53  5f 46 69 6e 64 22 0a 2e  |I    "OS_Find"..|
00001d30  5f 44 4c 63 6f 6e 66 69  72 6d 0a 20 20 20 4c 44  |_DLconfirm.   LD|
00001d40  4d 46 44 20 20 28 73 70  29 2c 7b 72 31 7d 0a 20  |MFD  (sp),{r1}. |
00001d50  20 20 4d 4f 56 20 20 20  20 72 30 2c 23 34 0a 20  |  MOV    r0,#4. |
00001d60  20 20 53 54 52 20 20 20  20 72 30 2c 5b 72 31 2c  |  STR    r0,[r1,|
00001d70  23 31 36 5d 0a 20 20 20  4c 44 52 20 20 20 20 72  |#16].   LDR    r|
00001d80  30 2c 5b 72 31 2c 23 38  5d 0a 20 20 20 53 54 52  |0,[r1,#8].   STR|
00001d90  20 20 20 20 72 30 2c 5b  72 31 2c 23 31 32 5d 0a  |    r0,[r1,#12].|
00001da0  20 20 20 4c 44 52 20 20  20 20 72 32 2c 5b 72 31  |   LDR    r2,[r1|
00001db0  2c 23 34 5d 0a 20 20 20  4d 4f 56 20 20 20 20 72  |,#4].   MOV    r|
00001dc0  30 2c 23 31 37 0a 20 20  20 53 57 49 20 20 20 20  |0,#17.   SWI    |
00001dd0  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00001de0  65 22 0a 20 20 20 4d 4f  56 20 20 20 20 72 30 2c  |e".   MOV    r0,|
00001df0  23 30 0a 20 20 20 4c 44  4d 46 44 20 20 28 73 70  |#0.   LDMFD  (sp|
00001e00  29 21 2c 7b 72 31 2d 72  32 2c 70 63 7d 0a 0a 2e  |)!,{r1-r2,pc}...|
00001e10  64 6f 73 68 69 66 74 64  72 61 67 0a 3b 20 3e 20  |doshiftdrag.; > |
00001e20  72 31 3d 66 69 6c 65 6e  61 6d 65 0a 3b 20 20 20  |r1=filename.;   |
00001e30  72 33 3d 73 74 6f 72 65  20 6c 6f 63 61 74 69 6f  |r3=store locatio|
00001e40  6e 0a 3b 20 20 20 72 34  3d 6c 65 6e 67 74 68 20  |n.;   r4=length |
00001e50  6f 66 20 73 74 72 69 6e  67 0a 24 6c 6f 6f 70 0a  |of string.$loop.|
00001e60  20 20 20 43 4d 50 20 20  20 20 72 34 2c 23 31 20  |   CMP    r4,#1 |
00001e70  20 20 20 20 20 20 20 20  3b 20 68 6f 77 20 6d 75  |        ; how mu|
00001e80  63 68 20 73 70 61 63 65  20 6c 65 66 74 20 3f 0a  |ch space left ?.|
00001e90  20 20 20 42 4c 45 20 20  20 20 24 65 78 69 74 20  |   BLE    $exit |
00001ea0  20 20 20 20 20 20 20 20  3b 20 69 73 20 74 65 72  |        ; is ter|
00001eb0  6d 69 6e 61 74 6f 72 20  74 68 65 6e 20 65 78 69  |minator then exi|
00001ec0  74 0a 20 20 20 4c 44 52  42 20 20 20 72 30 2c 5b  |t.   LDRB   r0,[|
00001ed0  72 31 5d 2c 23 31 20 20  20 20 3b 20 67 65 74 20  |r1],#1    ; get |
00001ee0  62 79 74 65 20 6f 66 20  66 69 6c 65 6e 61 6d 65  |byte of filename|
00001ef0  0a 20 20 20 53 54 52 42  20 20 20 72 30 2c 5b 72  |.   STRB   r0,[r|
00001f00  33 5d 2c 23 31 20 20 20  20 3b 20 73 74 6f 72 65  |3],#1    ; store|
00001f10  20 69 6e 20 62 6c 6f 63  6b 0a 20 20 20 43 4d 50  | in block.   CMP|
00001f20  20 20 20 20 72 30 2c 23  33 31 20 20 20 20 20 20  |    r0,#31      |
00001f30  20 20 3b 20 69 73 20 74  68 69 73 20 74 65 72 6d  |  ; is this term|
00001f40  69 6e 61 74 6f 72 0a 20  20 20 42 4c 45 20 20 20  |inator.   BLE   |
00001f50  20 24 65 78 69 74 20 20  20 20 20 20 20 20 20 3b  | $exit         ;|
00001f60  20 69 66 20 73 6f 2c 20  74 68 65 6e 20 65 78 69  | if so, then exi|
00001f70  74 0a 20 20 20 53 55 42  20 20 20 20 72 34 2c 72  |t.   SUB    r4,r|
00001f80  34 2c 23 31 0a 20 20 20  42 20 20 20 20 20 20 24  |4,#1.   B      $|
00001f90  6c 6f 6f 70 0a 24 65 78  69 74 0a 20 20 20 42 4c  |loop.$exit.   BL|
00001fa0  20 20 20 20 20 75 70 64  61 74 65 69 63 6f 6e 0a  |     updateicon.|
00001fb0  20 20 20 42 20 20 20 20  20 20 5f 44 4c 63 6f 6e  |   B      _DLcon|
00001fc0  66 69 72 6d 0a 0a 2e 69  73 64 72 61 67 6f 6b 0a  |firm...isdragok.|
00001fd0  20 20 20 53 54 4d 46 44  20 20 28 73 70 29 21 2c  |   STMFD  (sp)!,|
00001fe0  7b 72 31 2d 72 34 2c 6c  69 6e 6b 7d 0a 20 20 20  |{r1-r4,link}.   |
00001ff0  52 45 4d 20 20 20 20 22  57 69 6e 20 20 3d 20 25  |REM    "Win  = %|
00002000  26 33 22 0a 20 20 20 52  45 4d 20 20 20 20 22 49  |&3".   REM    "I|
00002010  63 6f 6e 20 3d 20 25 26  34 22 0a 20 20 20 53 54  |con = %&4".   ST|
00002020  52 57 20 20 20 72 33 2c  60 77 69 6e 64 6f 77 0a  |RW   r3,`window.|
00002030  20 20 20 53 54 52 57 20  20 20 72 34 2c 60 69 63  |   STRW   r4,`ic|
00002040  6f 6e 0a 20 20 20 41 44  52 57 20 20 20 72 31 2c  |on.   ADRW   r1,|
00002050  60 77 69 6e 64 6f 77 0a  20 20 20 53 57 49 20 20  |`window.   SWI  |
00002060  20 20 22 58 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |  "XWimp_GetIcon|
00002070  53 74 61 74 65 22 0a 20  20 20 42 56 53 20 20 20  |State".   BVS   |
00002080  20 24 6e 6f 74 64 72 61  67 6f 6b 0a 20 20 20 4c  | $notdragok.   L|
00002090  44 52 57 20 20 20 72 32  2c 60 66 6c 61 67 73 0a  |DRW   r2,`flags.|
000020a0  20 20 20 54 53 54 20 20  20 20 72 32 2c 23 28 31  |   TST    r2,#(1|
000020b0  3c 3c 38 29 20 20 20 20  3b 20 69 73 20 69 74 20  |<<8)    ; is it |
000020c0  69 6e 64 69 72 65 63 74  65 64 0a 20 20 20 42 45  |indirected.   BE|
000020d0  51 20 20 20 20 24 6e 6f  74 64 72 61 67 6f 6b 0a  |Q    $notdragok.|
000020e0  20 20 20 41 4e 44 20 20  20 20 72 33 2c 72 32 2c  |   AND    r3,r2,|
000020f0  23 28 31 35 3c 3c 31 32  29 0a 20 20 20 43 4d 50  |#(15<<12).   CMP|
00002100  20 20 20 20 72 33 2c 23  28 31 34 3c 3c 31 32 29  |    r3,#(14<<12)|
00002110  20 20 20 20 20 3b 20 77  72 69 74 65 2f 63 6c 69  |     ; write/cli|
00002120  63 6b 2f 64 72 61 67 0a  20 20 20 43 4d 50 4e 45  |ck/drag.   CMPNE|
00002130  20 20 72 33 2c 23 28 31  35 3c 3c 31 32 29 20 20  |  r3,#(15<<12)  |
00002140  20 20 20 3b 20 77 72 69  74 65 61 62 6c 65 0a 20  |   ; writeable. |
00002150  20 20 42 4e 45 20 20 20  20 24 6e 6f 74 64 72 61  |  BNE    $notdra|
00002160  67 6f 6b 0a 20 20 20 4d  4f 56 20 20 20 20 72 30  |gok.   MOV    r0|
00002170  2c 23 31 0a 20 20 20 52  45 4d 20 20 20 20 22 49  |,#1.   REM    "I|
00002180  63 6f 6e 20 76 61 6c 69  64 22 0a 20 20 20 4c 44  |con valid".   LD|
00002190  4d 46 44 20 20 28 73 70  29 21 2c 7b 72 31 2d 72  |MFD  (sp)!,{r1-r|
000021a0  34 2c 70 63 7d 0a 24 6e  6f 74 64 72 61 67 6f 6b  |4,pc}.$notdragok|
000021b0  0a 20 20 20 4d 4f 56 20  20 20 20 72 30 2c 23 30  |.   MOV    r0,#0|
000021c0  0a 20 20 20 52 45 4d 20  20 20 20 22 49 63 6f 6e  |.   REM    "Icon|
000021d0  20 6e 6f 74 20 76 61 6c  69 64 22 0a 20 20 20 4c  | not valid".   L|
000021e0  44 4d 46 44 20 20 28 73  70 29 21 2c 7b 72 31 2d  |DMFD  (sp)!,{r1-|
000021f0  72 34 2c 70 63 7d 0a 0a  2e 75 70 64 61 74 65 69  |r4,pc}...updatei|
00002200  63 6f 6e 0a 20 20 20 53  54 4d 46 44 20 20 20 28  |con.   STMFD   (|
00002210  73 70 29 21 2c 7b 72 30  2d 72 35 2c 6c 69 6e 6b  |sp)!,{r0-r5,link|
00002220  7d 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 53  |}            ; S|
00002230  74 61 63 6b 20 72 65 67  69 73 74 65 72 73 0a 20  |tack registers. |
00002240  20 20 52 45 4d 20 20 20  20 20 43 48 52 24 34 2b  |  REM     CHR$4+|
00002250  22 25 49 55 70 64 61 74  69 6e 67 20 69 63 6f 6e  |"%IUpdating icon|
00002260  22 0a 20 20 20 41 44 52  57 20 20 20 20 72 31 2c  |".   ADRW    r1,|
00002270  60 77 69 6e 64 6f 77 0a  20 20 20 53 57 49 20 20  |`window.   SWI  |
00002280  20 20 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |   "Wimp_GetIcon|
00002290  53 74 61 74 65 22 0a 20  20 20 41 44 44 20 20 20  |State".   ADD   |
000022a0  20 20 72 31 2c 72 31 2c  23 38 20 20 20 20 20 20  |  r1,r1,#8      |
000022b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000022c0  3b 20 72 65 6d 6f 76 65  20 66 69 72 73 74 20 74  |; remove first t|
000022d0  77 6f 20 77 6f 72 64 73  0a 20 20 20 4c 44 4d 49  |wo words.   LDMI|
000022e0  41 20 20 20 72 31 2c 7b  72 31 2d 72 34 7d 20 20  |A   r1,{r1-r4}  |
000022f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002300  20 20 3b 20 72 65 61 64  20 6c 62 72 74 20 69 6e  |  ; read lbrt in|
00002310  74 6f 20 72 31 2c 72 32  2c 72 33 2c 72 34 0a 20  |to r1,r2,r3,r4. |
00002320  20 20 4c 44 52 57 20 20  20 20 72 30 2c 60 77 69  |  LDRW    r0,`wi|
00002330  6e 64 6f 77 0a 20 20 20  53 57 49 20 20 20 20 20  |ndow.   SWI     |
00002340  22 57 69 6d 70 5f 46 6f  72 63 65 52 65 64 72 61  |"Wimp_ForceRedra|
00002350  77 22 0a 20 20 20 4c 44  4d 46 44 20 20 20 28 73  |w".   LDMFD   (s|
00002360  70 29 21 2c 7b 72 30 2d  72 35 2c 70 63 7d 20 20  |p)!,{r0-r5,pc}  |
00002370  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 52 65  |            ; Re|
00002380  74 75 72 6e 20 66 72 6f  6d 20 63 61 6c 6c 0a 0a  |turn from call..|
00002390  3b 20 43 68 65 63 6b 20  69 66 20 74 68 65 20 73  |; Check if the s|
000023a0  68 69 66 74 20 6b 65 79  20 69 73 20 70 72 65 73  |hift key is pres|
000023b0  73 65 64 0a 3b 20 3c 20  45 51 20 69 66 20 70 72  |sed.; < EQ if pr|
000023c0  65 73 73 65 64 0a 2e 63  68 65 63 6b 73 68 69 66  |essed..checkshif|
000023d0  74 0a 20 20 20 53 54 4d  46 44 20 20 20 28 73 70  |t.   STMFD   (sp|
000023e0  29 21 2c 7b 72 30 2d 72  32 2c 6c 69 6e 6b 7d 0a  |)!,{r0-r2,link}.|
000023f0  20 20 20 4d 4f 56 20 20  20 20 20 72 30 2c 23 26  |   MOV     r0,#&|
00002400  37 39 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |79             ;|
00002410  20 4b 65 79 62 6f 61 72  64 20 73 63 61 6e 20 4f  | Keyboard scan O|
00002420  53 5f 42 79 74 65 20 63  6f 64 65 0a 20 20 20 4d  |S_Byte code.   M|
00002430  4f 56 20 20 20 20 20 72  31 2c 23 26 38 30 20 20  |OV     r1,#&80  |
00002440  20 20 20 20 20 20 20 20  20 20 20 3b 20 53 48 49  |           ; SHI|
00002450  46 54 20 6b 65 79 20 63  6f 64 65 0a 20 20 20 53  |FT key code.   S|
00002460  57 49 20 20 20 20 20 22  58 4f 53 5f 42 79 74 65  |WI     "XOS_Byte|
00002470  22 20 20 20 20 20 20 20  20 20 20 3b 20 43 61 6c  |"          ; Cal|
00002480  6c 20 4f 53 5f 42 79 74  65 20 74 6f 20 72 65 61  |l OS_Byte to rea|
00002490  64 20 73 74 61 74 75 73  0a 20 20 20 54 45 51 20  |d status.   TEQ |
000024a0  20 20 20 20 72 31 2c 23  26 46 46 20 20 20 20 20  |    r1,#&FF     |
000024b0  20 20 20 20 20 20 20 20  3b 20 69 73 20 69 74 20  |        ; is it |
000024c0  70 72 65 73 73 65 64 20  3f 0a 20 20 20 4c 44 4d  |pressed ?.   LDM|
000024d0  46 44 20 20 20 28 73 70  29 21 2c 7b 72 30 2d 72  |FD   (sp)!,{r0-r|
000024e0  32 2c 70 63 7d 0a 3b 20  43 68 65 63 6b 20 69 66  |2,pc}.; Check if|
000024f0  20 74 68 65 20 63 74 72  6c 20 6b 65 79 20 69 73  | the ctrl key is|
00002500  20 70 72 65 73 73 65 64  0a 3b 20 3c 20 45 51 20  | pressed.; < EQ |
00002510  69 66 20 70 72 65 73 73  65 64 0a 2e 63 68 65 63  |if pressed..chec|
00002520  6b 63 74 72 6c 0a 20 20  20 53 54 4d 46 44 20 20  |kctrl.   STMFD  |
00002530  20 28 73 70 29 21 2c 7b  72 30 2d 72 32 2c 6c 69  | (sp)!,{r0-r2,li|
00002540  6e 6b 7d 0a 20 20 20 4d  4f 56 20 20 20 20 20 72  |nk}.   MOV     r|
00002550  30 2c 23 26 37 39 20 20  20 20 20 20 20 20 20 20  |0,#&79          |
00002560  20 20 20 3b 20 4b 65 79  62 6f 61 72 64 20 73 63  |   ; Keyboard sc|
00002570  61 6e 20 4f 53 5f 42 79  74 65 20 63 6f 64 65 0a  |an OS_Byte code.|
00002580  20 20 20 4d 4f 56 20 20  20 20 20 72 31 2c 23 26  |   MOV     r1,#&|
00002590  38 31 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |81             ;|
000025a0  20 43 54 52 4c 20 6b 65  79 20 63 6f 64 65 0a 20  | CTRL key code. |
000025b0  20 20 53 57 49 20 20 20  20 20 22 58 4f 53 5f 42  |  SWI     "XOS_B|
000025c0  79 74 65 22 20 20 20 20  20 20 20 20 20 20 3b 20  |yte"          ; |
000025d0  43 61 6c 6c 20 4f 53 5f  42 79 74 65 20 74 6f 20  |Call OS_Byte to |
000025e0  72 65 61 64 20 73 74 61  74 75 73 0a 20 20 20 54  |read status.   T|
000025f0  45 51 20 20 20 20 20 72  31 2c 23 26 46 46 20 20  |EQ     r1,#&FF  |
00002600  20 20 20 20 20 20 20 20  20 20 20 3b 20 69 73 20  |           ; is |
00002610  69 74 20 70 72 65 73 73  65 64 20 3f 0a 20 20 20  |it pressed ?.   |
00002620  4c 44 4d 46 44 20 20 20  28 73 70 29 21 2c 7b 72  |LDMFD   (sp)!,{r|
00002630  30 2d 72 32 2c 70 63 7d  0a 0a 2e 60 6f 75 72 66  |0-r2,pc}...`ourf|
00002640  69 6c 65 6e 61 6d 65 3a  45 51 55 53 20 22 3c 57  |ilename:EQUS "<W|
00002650  69 6d 70 24 53 63 72 61  70 3e 22 3a 45 51 55 42  |imp$Scrap>":EQUB|
00002660  20 30 3a 41 4c 49 47 4e  0a 0a 2e 69 73 6d 6f 75  | 0:ALIGN...ismou|
00002670  73 65 63 6c 69 63 6b 0a  20 20 20 53 54 4d 46 44  |seclick.   STMFD|
00002680  20 20 20 28 73 70 29 21  2c 7b 72 33 2d 72 39 7d  |   (sp)!,{r3-r9}|
00002690  20 20 20 20 3b 20 53 74  61 63 6b 20 72 65 67 69  |    ; Stack regi|
000026a0  73 74 65 72 73 0a 20 20  20 4c 44 52 20 20 20 20  |sters.   LDR    |
000026b0  20 72 30 2c 5b 72 31 2c  23 38 5d 0a 20 20 20 52  | r0,[r1,#8].   R|
000026c0  45 4d 20 20 20 20 20 22  42 75 74 74 6f 6e 20 65  |EM     "Button e|
000026d0  76 65 6e 74 20 3d 20 25  26 30 22 0a 20 20 20 42  |vent = %&0".   B|
000026e0  4c 20 20 20 20 20 20 63  68 65 63 6b 63 74 72 6c  |L      checkctrl|
000026f0  0a 20 20 20 4c 44 52 4e  45 20 20 20 72 30 2c 5b  |.   LDRNE   r0,[|
00002700  72 31 2c 23 38 5d 20 20  20 20 20 20 20 3b 20 67  |r1,#8]       ; g|
00002710  65 74 20 62 75 74 74 6f  6e 73 20 69 66 20 63 74  |et buttons if ct|
00002720  72 6c 20 6e 6f 74 20 70  72 65 73 73 65 64 8c 0a  |rl not pressed..|
00002730  20 20 20 54 53 54 4e 45  20 20 20 72 30 2c 23 26  |   TSTNE   r0,#&|
00002740  34 30 20 20 20 20 20 20  20 20 20 20 3b 20 8c 69  |40          ; .i|
00002750  73 20 74 68 69 73 20 61  20 73 65 6c 65 63 74 20  |s this a select |
00002760  64 72 61 67 20 3f 0a 20  20 20 42 45 51 20 20 20  |drag ?.   BEQ   |
00002770  20 20 24 65 78 69 74 20  20 20 20 20 20 20 20 20  |  $exit         |
00002780  20 20 20 3b 20 69 66 20  65 69 74 68 65 72 20 74  |   ; if either t|
00002790  68 65 6e 20 65 78 69 74  0a 3b 20 20 20 20 53 57  |hen exit.;    SW|
000027a0  49 20 20 20 20 20 26 31  30 34 0a 20 20 20 52 45  |I     &104.   RE|
000027b0  4d 20 20 20 20 20 22 43  68 65 63 6b 69 6e 67 20  |M     "Checking |
000027c0  64 72 61 67 20 69 73 20  6f 6b 22 0a 20 20 20 4c  |drag is ok".   L|
000027d0  44 52 20 20 20 20 20 72  33 2c 5b 72 31 2c 23 31  |DR     r3,[r1,#1|
000027e0  32 5d 20 20 20 20 20 20  3b 20 77 69 6e 64 6f 77  |2]      ; window|
000027f0  0a 20 20 20 4c 44 52 20  20 20 20 20 72 34 2c 5b  |.   LDR     r4,[|
00002800  72 31 2c 23 31 36 5d 20  20 20 20 20 20 3b 20 69  |r1,#16]      ; i|
00002810  63 6f 6e 0a 20 20 20 42  4c 20 20 20 20 20 20 69  |con.   BL      i|
00002820  73 64 72 61 67 6f 6b 0a  20 20 20 43 4d 50 20 20  |sdragok.   CMP  |
00002830  20 20 20 72 30 2c 23 30  0a 20 20 20 42 45 51 20  |   r0,#0.   BEQ |
00002840  20 20 20 20 24 65 78 69  74 0a 24 69 73 64 72 61  |    $exit.$isdra|
00002850  67 0a 20 20 20 4c 44 52  57 20 20 20 20 72 32 2c  |g.   LDRW    r2,|
00002860  60 77 69 6e 64 6f 77 0a  20 20 20 4d 56 4e 20 20  |`window.   MVN  |
00002870  20 20 20 72 33 2c 23 4e  4f 54 20 2d 31 0a 20 20  |   r3,#NOT -1.  |
00002880  20 4d 4f 56 20 20 20 20  20 72 30 2c 23 31 39 0a  | MOV     r0,#19.|
00002890  20 20 20 53 57 49 20 20  20 20 20 22 58 57 69 6d  |   SWI     "XWim|
000028a0  70 5f 53 65 6e 64 4d 65  73 73 61 67 65 22 20 20  |p_SendMessage"  |
000028b0  3b 20 66 69 6e 64 20 74  68 65 20 74 61 73 6b 20  |; find the task |
000028c0  68 61 6e 64 6c 65 0a 20  20 20 42 56 53 20 20 20  |handle.   BVS   |
000028d0  20 20 24 65 78 69 74 0a  20 20 20 4d 4f 56 20 20  |  $exit.   MOV  |
000028e0  20 20 20 72 36 2c 72 32  20 20 20 20 20 20 20 20  |   r6,r2        |
000028f0  20 20 20 20 20 20 20 20  3b 20 72 36 3d 74 61 73  |        ; r6=tas|
00002900  6b 20 68 61 6e 64 6c 65  0a 20 20 20 4d 4f 56 20  |k handle.   MOV |
00002910  20 20 20 20 72 38 2c 23  30 20 20 20 20 20 20 20  |    r8,#0       |
00002920  20 20 20 20 20 20 20 20  20 3b 20 72 38 3d 70 6f  |         ; r8=po|
00002930  69 6e 74 65 72 20 74 6f  20 72 6d 61 0a 20 20 20  |inter to rma.   |
00002940  4d 4f 56 20 20 20 20 20  72 37 2c 23 30 20 20 20  |MOV     r7,#0   |
00002950  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 72  |             ; r|
00002960  37 3d 6c 65 6e 67 74 68  20 6f 66 20 61 72 65 61  |7=length of area|
00002970  20 28 30 20 62 79 74 65  73 29 0a 20 20 20 41 44  | (0 bytes).   AD|
00002980  52 20 20 20 20 20 72 32  2c 60 74 65 78 74 66 69  |R     r2,`textfi|
00002990  6c 65 20 20 20 20 20 20  20 20 20 3b 20 6c 61 72  |le         ; lar|
000029a0  67 65 20 74 65 78 74 20  66 69 6c 65 20 69 63 6f  |ge text file ico|
000029b0  6e 20 74 6f 20 64 72 61  67 0a 20 20 20 42 4c 20  |n to drag.   BL |
000029c0  20 20 20 20 20 73 65 74  64 72 61 67 0a 20 20 20  |     setdrag.   |
000029d0  42 4c 20 20 20 20 20 20  61 64 64 6c 69 6e 65 0a  |BL      addline.|
000029e0  3b 20 20 20 20 53 57 49  20 20 20 20 20 26 31 30  |;    SWI     &10|
000029f0  34 0a 20 20 20 52 45 4d  20 20 20 20 20 22 49 73  |4.   REM     "Is|
00002a00  20 6f 6e 65 20 6f 66 20  6f 75 72 20 64 72 61 67  | one of our drag|
00002a10  20 72 65 71 75 65 73 74  73 21 21 21 22 0a 20 20  | requests!!!".  |
00002a20  20 4d 4f 56 20 20 20 20  20 72 30 2c 23 31 0a 20  | MOV     r0,#1. |
00002a30  20 20 53 54 52 57 20 20  20 20 72 30 2c 60 64 72  |  STRW    r0,`dr|
00002a40  61 67 67 69 6e 67 0a 20  20 20 53 54 52 57 20 20  |agging.   STRW  |
00002a50  20 20 72 38 2c 60 73 61  76 65 61 64 64 72 0a 20  |  r8,`saveaddr. |
00002a60  20 20 53 54 52 57 20 20  20 20 72 37 2c 60 73 61  |  STRW    r7,`sa|
00002a70  76 65 6c 65 6e 0a 20 20  20 52 45 4d 20 20 20 20  |velen.   REM    |
00002a80  20 22 44 61 74 61 20 69  73 20 6c 65 6e 67 74 68  | "Data is length|
00002a90  20 25 72 37 2c 20 63 6f  6e 74 61 69 6e 69 6e 67  | %r7, containing|
00002aa0  20 25 24 38 22 0a 20 20  20 42 20 20 20 20 20 20  | %$8".   B      |
00002ab0  20 24 6e 6f 61 63 74 69  6f 6e 0a 24 6e 6f 61 63  | $noaction.$noac|
00002ac0  74 69 6f 6e 0a 20 20 20  4d 4f 56 20 20 20 20 20  |tion.   MOV     |
00002ad0  72 30 2c 23 30 0a 20 20  20 4c 44 4d 46 44 20 20  |r0,#0.   LDMFD  |
00002ae0  20 28 73 70 29 21 2c 7b  72 33 2d 72 39 7d 20 20  | (sp)!,{r3-r9}  |
00002af0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 52 65  |            ; Re|
00002b00  73 74 6f 72 65 20 72 65  67 69 73 74 65 72 73 0a  |store registers.|
00002b10  20 20 20 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |   LDMFD   (sp)!|
00002b20  2c 7b 72 31 2d 72 32 2c  70 63 7d 20 20 20 20 20  |,{r1-r2,pc}     |
00002b30  20 20 20 20 20 20 3b 20  52 65 74 75 72 6e 20 66  |      ; Return f|
00002b40  72 6f 6d 20 63 61 6c 6c  0a 24 65 78 69 74 0a 20  |rom call.$exit. |
00002b50  20 20 4d 4f 56 20 20 20  20 20 72 30 2c 23 36 0a  |  MOV     r0,#6.|
00002b60  20 20 20 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |   LDMFD   (sp)!|
00002b70  2c 7b 72 33 2d 72 39 7d  20 20 20 20 20 20 20 20  |,{r3-r9}        |
00002b80  20 20 20 20 20 20 3b 20  52 65 73 74 6f 72 65 20  |      ; Restore |
00002b90  72 65 67 69 73 74 65 72  73 0a 20 20 20 4c 44 4d  |registers.   LDM|
00002ba0  46 44 20 20 20 28 73 70  29 21 2c 7b 72 31 2d 72  |FD   (sp)!,{r1-r|
00002bb0  32 2c 70 63 7d 20 20 20  20 20 20 20 20 20 20 20  |2,pc}           |
00002bc0  3b 20 52 65 74 75 72 6e  20 66 72 6f 6d 20 63 61  |; Return from ca|
00002bd0  6c 6c 0a 0a 2e 60 74 65  78 74 66 69 6c 65 0a 20  |ll...`textfile. |
00002be0  20 20 45 51 55 53 20 20  20 20 22 46 69 6c 65 5f  |  EQUS    "File_|
00002bf0  46 46 46 22 2b 43 48 52  24 30 0a 2e 60 73 6d 61  |FFF"+CHR$0..`sma|
00002c00  6c 6c 66 69 6c 65 0a 20  20 20 45 51 55 53 20 20  |llfile.   EQUS  |
00002c10  20 20 22 53 6d 61 6c 6c  5f 46 46 46 22 2b 43 48  |  "Small_FFF"+CH|
00002c20  52 24 30 0a 20 20 20 41  4c 49 47 4e 0a 0a 3b 20  |R$0.   ALIGN..; |
00002c30  73 65 74 20 74 68 65 20  64 72 61 67 20 69 63 6f  |set the drag ico|
00002c40  6e 0a 2e 73 65 74 64 72  61 67 0a 20 20 20 53 54  |n..setdrag.   ST|
00002c50  4d 46 44 20 20 20 28 73  70 29 21 2c 7b 72 30 2d  |MFD   (sp)!,{r0-|
00002c60  72 35 2c 6c 69 6e 6b 7d  20 20 20 20 20 20 20 20  |r5,link}        |
00002c70  20 20 20 20 3b 20 53 74  61 63 6b 20 72 65 67 69  |    ; Stack regi|
00002c80  73 74 65 72 73 0a 20 20  20 43 4d 50 20 20 20 20  |sters.   CMP    |
00002c90  20 72 38 2c 23 30 20 20  20 20 20 20 20 20 20 20  | r8,#0          |
00002ca0  20 20 20 20 20 20 3b 20  69 73 20 74 68 65 20 63  |      ; is the c|
00002cb0  75 72 72 65 6e 74 20 70  6f 69 6e 74 65 72 20 73  |urrent pointer s|
00002cc0  65 74 20 3f 0a 20 20 20  53 57 49 4e 45 20 20 20  |et ?.   SWINE   |
00002cd0  22 44 72 61 67 41 53 70  72 69 74 65 5f 53 74 6f  |"DragASprite_Sto|
00002ce0  70 22 20 20 20 3b 20 69  66 20 6e 6f 74 20 74 68  |p"   ; if not th|
00002cf0  65 6e 20 73 74 6f 70 20  74 68 65 20 63 75 72 72  |en stop the curr|
00002d00  65 6e 74 20 64 72 61 67  0a 20 20 20 41 44 52 57  |ent drag.   ADRW|
00002d10  20 20 20 20 72 31 2c 60  64 72 61 67 62 6f 78 0a  |    r1,`dragbox.|
00002d20  20 20 20 53 57 49 20 20  20 20 20 22 57 69 6d 70  |   SWI     "Wimp|
00002d30  5f 47 65 74 50 6f 69 6e  74 65 72 49 6e 66 6f 22  |_GetPointerInfo"|
00002d40  0a 20 20 20 4c 44 4d 49  41 20 20 20 72 31 2c 7b  |.   LDMIA   r1,{|
00002d50  72 30 2d 72 31 7d 0a 20  20 20 53 55 42 20 20 20  |r0-r1}.   SUB   |
00002d60  20 20 72 30 2c 72 30 2c  23 33 34 20 20 20 20 20  |  r0,r0,#34     |
00002d70  20 20 20 20 20 20 20 3b  20 78 30 3d 78 2d 33 34  |       ; x0=x-34|
00002d80  20 28 bd 20 77 69 64 74  68 20 6f 66 20 62 6f 78  | (. width of box|
00002d90  29 0a 20 20 20 53 55 42  20 20 20 20 20 72 31 2c  |).   SUB     r1,|
00002da0  72 31 2c 23 33 34 20 20  20 20 20 20 20 20 20 20  |r1,#34          |
00002db0  20 20 3b 20 79 30 3d 79  2d 33 34 20 28 bd 20 68  |  ; y0=y-34 (. h|
00002dc0  65 69 67 68 74 20 6f 66  20 62 6f 78 29 0a 20 20  |eight of box).  |
00002dd0  20 41 44 44 20 20 20 20  20 72 32 2c 72 30 2c 23  | ADD     r2,r0,#|
00002de0  33 34 2a 32 20 20 20 20  20 20 20 20 20 20 3b 20  |34*2          ; |
00002df0  78 31 3d 78 30 2b 36 34  20 28 77 69 64 74 68 20  |x1=x0+64 (width |
00002e00  6f 66 20 62 6f 78 29 0a  20 20 20 41 44 44 20 20  |of box).   ADD  |
00002e10  20 20 20 72 33 2c 72 31  2c 23 33 34 2a 32 20 20  |   r3,r1,#34*2  |
00002e20  20 20 20 20 20 20 20 20  3b 20 79 31 3d 79 30 2b  |        ; y1=y0+|
00002e30  36 34 20 28 68 65 69 67  68 74 20 6f 66 20 62 6f  |64 (height of bo|
00002e40  78 29 0a 20 20 20 41 44  52 57 20 20 20 20 72 35  |x).   ADRW    r5|
00002e50  2c 60 64 72 61 67 62 6f  78 0a 20 20 20 53 54 4d  |,`dragbox.   STM|
00002e60  49 41 20 20 20 72 35 2c  7b 72 30 2d 72 33 7d 20  |IA   r5,{r0-r3} |
00002e70  20 20 20 20 20 20 20 20  20 20 3b 20 73 74 6f 72  |          ; stor|
00002e80  65 20 64 72 61 67 20 62  6f 78 20 69 6e 20 62 6c  |e drag box in bl|
00002e90  6f 63 6b 20 69 6e 20 57  53 0a 20 20 20 4c 44 52  |ock in WS.   LDR|
00002ea0  20 20 20 20 20 72 32 2c  5b 73 70 2c 23 38 5d 20  |     r2,[sp,#8] |
00002eb0  20 20 20 20 20 20 20 20  20 20 3b 20 72 32 3d 73  |          ; r2=s|
00002ec0  70 72 69 74 65 20 6e 61  6d 65 0a 20 20 20 4d 4f  |prite name.   MO|
00002ed0  56 20 20 20 20 20 72 30  2c 23 25 31 31 30 30 30  |V     r0,#%11000|
00002ee0  31 30 31 20 20 20 20 20  20 20 20 3b 20 63 65 6e  |101        ; cen|
00002ef0  74 72 65 2c 20 63 6f 6e  73 74 72 61 69 6e 20 70  |tre, constrain p|
00002f00  6f 69 6e 74 65 72 2c 20  64 6f 20 73 68 61 64 6f  |ointer, do shado|
00002f10  77 0a 20 20 20 4d 4f 56  20 20 20 20 20 72 31 2c  |w.   MOV     r1,|
00002f20  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
00002f30  20 20 3b 20 75 73 65 20  57 69 6d 70 20 73 70 72  |  ; use Wimp spr|
00002f40  69 74 65 20 61 72 65 61  0a 20 20 20 4d 4f 56 20  |ite area.   MOV |
00002f50  20 20 20 20 72 33 2c 72  35 20 20 20 20 20 20 20  |    r3,r5       |
00002f60  20 20 20 20 20 20 20 20  20 3b 20 72 33 3d 64 72  |         ; r3=dr|
00002f70  61 67 62 6f 78 20 70 6f  69 6e 74 65 72 0a 20 20  |agbox pointer.  |
00002f80  20 53 57 49 20 20 20 20  20 22 44 72 61 67 41 53  | SWI     "DragAS|
00002f90  70 72 69 74 65 5f 53 74  61 72 74 22 0a 20 20 20  |prite_Start".   |
00002fa0  52 45 4d 20 20 20 20 20  22 53 74 61 72 74 69 6e  |REM     "Startin|
00002fb0  67 20 64 72 61 67 22 0a  20 20 20 4c 44 4d 46 44  |g drag".   LDMFD|
00002fc0  20 20 20 28 73 70 29 21  2c 7b 72 30 2d 72 35 2c  |   (sp)!,{r0-r5,|
00002fd0  70 63 7d 20 20 20 20 20  20 20 20 20 20 20 20 20  |pc}             |
00002fe0  20 3b 20 52 65 74 75 72  6e 20 66 72 6f 6d 20 63  | ; Return from c|
00002ff0  61 6c 6c 0a 0a 2e 77 61  69 74 0a 20 20 20 53 54  |all...wait.   ST|
00003000  4d 46 44 20 20 20 28 73  70 29 21 2c 7b 72 30 2d  |MFD   (sp)!,{r0-|
00003010  72 31 2c 6c 69 6e 6b 7d  20 20 20 20 20 20 20 20  |r1,link}        |
00003020  20 20 20 20 3b 20 53 74  61 63 6b 20 72 65 67 69  |    ; Stack regi|
00003030  73 74 65 72 73 0a 20 20  20 53 57 49 20 20 20 20  |sters.   SWI    |
00003040  20 22 4f 53 5f 52 65 61  64 4d 6f 6e 6f 74 6f 6e  | "OS_ReadMonoton|
00003050  69 63 54 69 6d 65 22 0a  20 20 20 41 44 44 20 20  |icTime".   ADD  |
00003060  20 20 20 72 31 2c 72 30  2c 23 35 20 20 20 20 20  |   r1,r0,#5     |
00003070  20 20 20 20 3b 20 72 31  3d 74 69 6d 65 20 6e 6f  |    ; r1=time no|
00003080  77 20 2b 20 64 65 6c 61  79 0a 24 6c 6f 6f 70 0a  |w + delay.$loop.|
00003090  20 20 20 53 57 49 20 20  20 20 20 22 4f 53 5f 52  |   SWI     "OS_R|
000030a0  65 61 64 4d 6f 6e 6f 74  6f 6e 69 63 54 69 6d 65  |eadMonotonicTime|
000030b0  22 0a 20 20 20 43 4d 50  20 20 20 20 20 72 30 2c  |".   CMP     r0,|
000030c0  72 31 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |r1            ; |
000030d0  68 61 76 65 20 77 65 20  65 78 63 65 65 64 65 64  |have we exceeded|
000030e0  20 64 65 6c 61 79 20 3f  0a 20 20 20 42 4c 54 20  | delay ?.   BLT |
000030f0  20 20 20 20 24 6c 6f 6f  70 20 20 20 20 20 20 20  |    $loop       |
00003100  20 20 20 20 20 3b 20 69  66 20 6e 6f 74 20 74 68  |     ; if not th|
00003110  65 6e 20 6b 65 65 70 20  63 68 65 63 6b 69 6e 67  |en keep checking|
00003120  8c 0a 20 20 20 4c 44 4d  46 44 20 20 20 28 73 70  |..   LDMFD   (sp|
00003130  29 21 2c 7b 72 30 2d 72  31 2c 70 63 7d 20 20 20  |)!,{r0-r1,pc}   |
00003140  20 20 20 20 20 20 20 20  20 20 20 3b 20 52 65 74  |           ; Ret|
00003150  75 72 6e 20 66 72 6f 6d  20 63 61 6c 6c 0a 0a 3b  |urn from call..;|
00003160  20 41 64 64 20 61 20 6c  69 6e 65 20 66 72 6f 6d  | Add a line from|
00003170  20 74 68 65 20 69 63 6f  6e 20 70 6f 69 6e 74 65  | the icon pointe|
00003180  64 20 74 6f 20 62 79 20  74 68 65 20 62 6c 6f 63  |d to by the bloc|
00003190  6b 0a 2e 61 64 64 6c 69  6e 65 0a 20 20 20 53 54  |k..addline.   ST|
000031a0  4d 46 44 20 20 20 28 73  70 29 21 2c 7b 72 30 2d  |MFD   (sp)!,{r0-|
000031b0  72 35 2c 6c 69 6e 6b 7d  20 20 20 20 20 20 20 20  |r5,link}        |
000031c0  20 20 20 20 3b 20 53 74  61 63 6b 20 72 65 67 69  |    ; Stack regi|
000031d0  73 74 65 72 73 0a 20 20  20 4c 44 52 57 20 20 20  |sters.   LDRW   |
000031e0  20 72 30 2c 60 73 74 72  20 20 20 20 20 20 20 20  | r0,`str        |
000031f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00003200  20 72 30 3d 73 74 72 69  6e 67 0a 20 20 20 42 4c  | r0=string.   BL|
00003210  20 20 20 20 20 20 6c 65  6e 63 74 72 6c 20 20 20  |      lenctrl   |
00003220  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003230  20 20 20 20 3b 20 68 6f  77 20 6c 6f 6e 67 20 69  |    ; how long i|
00003240  73 20 74 68 65 20 73 74  72 69 6e 67 0a 20 20 20  |s the string.   |
00003250  52 45 4d 20 20 20 20 20  22 43 68 65 63 6b 69 6e  |REM     "Checkin|
00003260  67 20 6c 65 6e 67 74 68  20 3d 20 25 72 31 2c 20  |g length = %r1, |
00003270  63 75 72 72 65 6e 74 20  62 6c 6f 63 6b 20 3d 20  |current block = |
00003280  25 26 38 22 0a 3b 20 20  20 20 52 45 4d 20 20 20  |%&8".;    REM   |
00003290  20 20 22 53 74 72 69 6e  67 20 6c 6f 63 61 74 65  |  "String locate|
000032a0  64 20 61 74 20 25 26 30  22 0a 3b 20 20 20 20 4c  |d at %&0".;    L|
000032b0  44 4d 46 44 20 20 20 28  73 70 29 21 2c 7b 72 30  |DMFD   (sp)!,{r0|
000032c0  2d 72 35 2c 70 63 7d 20  20 20 20 20 20 20 20 20  |-r5,pc}         |
000032d0  20 20 20 20 20 3b 20 52  65 74 75 72 6e 20 66 72  |     ; Return fr|
000032e0  6f 6d 20 63 61 6c 6c 0a  3b 0a 20 20 20 43 4d 50  |om call.;.   CMP|
000032f0  20 20 20 20 20 72 38 2c  23 30 20 20 20 20 20 20  |     r8,#0      |
00003300  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003310  20 20 20 3b 20 69 73 20  74 68 69 73 20 74 68 65  |   ; is this the|
00003320  20 66 69 72 73 74 20 63  61 6c 6c 20 3f 0a 20 20  | first call ?.  |
00003330  20 4d 4f 56 45 51 20 20  20 72 30 2c 23 36 20 20  | MOVEQ   r0,#6  |
00003340  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003350  20 20 20 20 20 20 20 3b  20 69 66 20 73 6f 20 74  |       ; if so t|
00003360  68 65 6e 20 63 6c 61 69  6d 20 6e 65 77 20 62 6c  |hen claim new bl|
00003370  6f 63 6b 0a 20 20 20 4d  4f 56 4e 45 20 20 20 72  |ock.   MOVNE   r|
00003380  30 2c 23 31 33 20 20 20  20 20 20 20 20 20 20 20  |0,#13           |
00003390  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 6f  |             ; o|
000033a0  74 68 65 72 77 69 73 65  20 65 78 74 65 6e 64 20  |therwise extend |
000033b0  69 74 0a 20 20 20 4d 4f  56 4e 45 20 20 20 72 32  |it.   MOVNE   r2|
000033c0  2c 72 38 0a 20 20 20 4d  4f 56 20 20 20 20 20 72  |,r8.   MOV     r|
000033d0  33 2c 72 31 20 20 20 20  20 20 20 20 20 20 20 20  |3,r1            |
000033e0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 72  |             ; r|
000033f0  33 3d 61 6d 6f 75 6e 74  20 74 6f 20 63 6c 61 69  |3=amount to clai|
00003400  6d 2f 65 78 74 65 6e 64  0a 20 20 20 41 44 44 20  |m/extend.   ADD |
00003410  20 20 20 20 72 33 2c 72  31 2c 23 31 20 20 20 20  |    r3,r1,#1    |
00003420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003430  20 20 3b 20 61 64 64 20  65 78 74 72 61 20 62 79  |  ; add extra by|
00003440  74 65 20 66 6f 72 20 4c  46 0a 20 20 20 53 57 49  |te for LF.   SWI|
00003450  20 20 20 20 20 22 4f 53  5f 4d 6f 64 75 6c 65 22  |     "OS_Module"|
00003460  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003470  20 20 20 3b 20 63 6c 61  69 6d 2f 65 78 74 65 6e  |   ; claim/exten|
00003480  64 0a 20 20 20 4d 4f 56  20 20 20 20 20 72 38 2c  |d.   MOV     r8,|
00003490  72 32 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |r2              |
000034a0  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 38 3d  |           ; r8=|
000034b0  6e 65 77 20 61 72 65 61  20 70 6f 69 6e 74 65 72  |new area pointer|
000034c0  0a 20 20 20 41 44 44 20  20 20 20 20 72 31 2c 72  |.   ADD     r1,r|
000034d0  32 2c 72 37 20 20 20 20  20 20 20 20 20 20 20 20  |2,r7            |
000034e0  20 20 20 20 20 20 20 20  20 20 3b 20 72 32 3d 65  |          ; r2=e|
000034f0  6e 64 20 6f 66 20 70 72  65 76 69 6f 75 73 20 61  |nd of previous a|
00003500  72 65 61 0a 20 20 20 4c  44 52 57 20 20 20 20 72  |rea.   LDRW    r|
00003510  30 2c 60 73 74 72 20 20  20 20 20 20 20 20 20 20  |0,`str          |
00003520  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 72  |             ; r|
00003530  30 3d 70 6f 69 6e 74 65  72 20 74 6f 20 73 74 72  |0=pointer to str|
00003540  69 6e 67 20 74 6f 20 63  6f 70 79 0a 20 20 20 52  |ing to copy.   R|
00003550  45 4d 20 20 20 20 20 22  4d 6f 76 69 6e 67 20 25  |EM     "Moving %|
00003560  26 30 20 74 6f 20 25 26  31 22 0a 20 20 20 42 4c  |&0 to %&1".   BL|
00003570  20 20 20 20 20 20 6d 6f  76 65 63 74 72 6c 20 20  |      movectrl  |
00003580  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003590  20 20 20 20 3b 20 63 6f  70 79 20 69 74 20 74 6f  |    ; copy it to|
000035a0  20 74 68 65 20 6e 65 77  20 61 72 65 61 0a 20 20  | the new area.  |
000035b0  20 41 44 44 20 20 20 20  20 72 37 2c 72 37 2c 72  | ADD     r7,r7,r|
000035c0  33 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |3               |
000035d0  20 20 20 20 20 20 20 3b  20 69 6e 63 72 65 6d 65  |       ; increme|
000035e0  6e 74 20 61 6d 6f 75 6e  74 20 74 6f 20 63 6f 70  |nt amount to cop|
000035f0  79 0a 20 20 20 4d 4f 56  20 20 20 20 20 72 30 2c  |y.   MOV     r0,|
00003600  23 31 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |#10             |
00003610  20 20 20 20 20 20 20 20  20 20 20 3b 20 4c 46 20  |           ; LF |
00003620  74 6f 20 61 64 64 20 74  6f 20 65 6e 64 20 6f 66  |to add to end of|
00003630  20 6c 69 6e 65 21 0a 20  20 20 53 55 42 20 20 20  | line!.   SUB   |
00003640  20 20 72 31 2c 72 37 2c  23 31 20 20 20 20 20 20  |  r1,r7,#1      |
00003650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003660  3b 20 73 74 6f 72 65 20  61 73 20 6c 61 73 74 20  |; store as last |
00003670  62 79 74 65 0a 20 20 20  53 54 52 42 20 20 20 20  |byte.   STRB    |
00003680  72 30 2c 5b 72 38 2c 72  31 5d 20 20 20 20 20 20  |r0,[r8,r1]      |
00003690  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000036a0  61 6e 64 20 73 74 6f 72  65 20 69 6e 20 6d 65 6d  |and store in mem|
000036b0  6f 72 79 0a 20 20 20 4c  44 4d 46 44 20 20 20 28  |ory.   LDMFD   (|
000036c0  73 70 29 21 2c 7b 72 30  2d 72 35 2c 70 63 7d 20  |sp)!,{r0-r5,pc} |
000036d0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 52  |             ; R|
000036e0  65 74 75 72 6e 20 66 72  6f 6d 20 63 61 6c 6c 0a  |eturn from call.|
000036f0  0a 2e 69 73 64 72 61 67  64 6f 6e 65 0a 20 20 20  |..isdragdone.   |
00003700  53 54 4d 46 44 20 20 20  28 73 70 29 21 2c 7b 72  |STMFD   (sp)!,{r|
00003710  33 2d 72 39 7d 20 20 20  20 20 20 20 20 20 20 20  |3-r9}           |
00003720  20 20 20 20 20 20 3b 20  53 74 61 63 6b 20 72 65  |      ; Stack re|
00003730  67 69 73 74 65 72 73 0a  20 20 20 4c 44 52 57 20  |gisters.   LDRW |
00003740  20 20 20 72 30 2c 60 64  72 61 67 67 69 6e 67 0a  |   r0,`dragging.|
00003750  20 20 20 43 4d 50 20 20  20 20 20 72 30 2c 23 31  |   CMP     r0,#1|
00003760  0a 20 20 20 43 4d 50 4e  45 20 20 20 72 30 2c 23  |.   CMPNE   r0,#|
00003770  33 0a 20 20 20 42 4e 45  20 20 20 20 20 24 65 78  |3.   BNE     $ex|
00003780  69 74 0a 20 20 20 52 45  4d 20 20 20 20 20 22 25  |it.   REM     "%|
00003790  63 30 34 44 72 61 67 20  64 6f 6e 65 2c 20 69 6e  |c04Drag done, in|
000037a0  20 73 74 61 74 65 20 25  72 30 22 0a 20 20 20 53  | state %r0".   S|
000037b0  57 49 20 20 20 20 20 22  44 72 61 67 41 53 70 72  |WI     "DragASpr|
000037c0  69 74 65 5f 53 74 6f 70  22 0a 20 20 20 53 57 49  |ite_Stop".   SWI|
000037d0  20 20 20 20 20 22 57 69  6d 70 5f 47 65 74 50 6f  |     "Wimp_GetPo|
000037e0  69 6e 74 65 72 49 6e 66  6f 22 0a 20 20 20 4c 44  |interInfo".   LD|
000037f0  4d 49 41 20 20 20 72 31  2c 7b 72 32 2c 72 33 2c  |MIA   r1,{r2,r3,|
00003800  72 34 2c 72 35 2c 72 36  7d 0a 20 20 20 52 45 4d  |r4,r5,r6}.   REM|
00003810  20 20 20 20 20 22 25 52  22 0a 20 20 20 53 54 52  |     "%R".   STR|
00003820  20 20 20 20 20 72 35 2c  5b 72 31 2c 23 32 30 5d  |     r5,[r1,#20]|
00003830  20 20 20 20 20 20 3b 20  73 74 6f 72 65 20 6d 78  |      ; store mx|
00003840  0a 20 20 20 53 54 52 20  20 20 20 20 72 36 2c 5b  |.   STR     r6,[|
00003850  72 31 2c 23 32 34 5d 20  20 20 20 20 20 3b 20 73  |r1,#24]      ; s|
00003860  74 6f 72 65 20 6d 79 0a  20 20 20 53 54 52 20 20  |tore my.   STR  |
00003870  20 20 20 72 32 2c 5b 72  31 2c 23 32 38 5d 20 20  |   r2,[r1,#28]  |
00003880  20 20 20 20 3b 20 73 74  6f 72 65 20 6d 77 0a 20  |    ; store mw. |
00003890  20 20 53 54 52 20 20 20  20 20 72 33 2c 5b 72 31  |  STR     r3,[r1|
000038a0  2c 23 33 32 5d 20 20 20  20 20 20 3b 20 73 74 6f  |,#32]      ; sto|
000038b0  72 65 20 6d 69 0a 20 20  20 4d 4f 56 20 20 20 20  |re mi.   MOV    |
000038c0  20 72 32 2c 23 35 36 20  20 20 20 20 20 20 20 20  | r2,#56         |
000038d0  20 20 3b 20 62 6c 6f 63  6b 20 6c 65 6e 67 74 68  |  ; block length|
000038e0  0a 20 20 20 4d 4f 56 20  20 20 20 20 72 33 2c 23  |.   MOV     r3,#|
000038f0  30 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 74  |0            ; t|
00003900  6f 0a 20 20 20 4d 4f 56  20 20 20 20 20 72 34 2c  |o.   MOV     r4,|
00003910  23 30 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |#0            ; |
00003920  72 65 66 0a 20 20 20 4d  4f 56 20 20 20 20 20 72  |ref.   MOV     r|
00003930  35 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 20  |5,#0            |
00003940  3b 20 72 65 66 0a 20 20  20 4d 4f 56 20 20 20 20  |; ref.   MOV    |
00003950  20 72 36 2c 23 31 20 20  20 20 20 20 20 20 20 20  | r6,#1          |
00003960  20 20 3b 20 6d 65 73 73  61 67 65 0a 20 20 20 53  |  ; message.   S|
00003970  54 4d 49 41 20 20 20 72  31 2c 7b 72 32 2d 72 36  |TMIA   r1,{r2-r6|
00003980  7d 20 20 20 20 20 20 20  3b 20 73 74 6f 72 65 20  |}       ; store |
00003990  69 6e 20 62 6c 6f 63 6b  0a 20 20 20 41 44 52 20  |in block.   ADR |
000039a0  20 20 20 20 72 30 2c 60  65 73 74 6c 65 6e 20 20  |    r0,`estlen  |
000039b0  20 20 20 20 20 3b 20 61  64 64 72 65 73 73 20 6f  |     ; address o|
000039c0  66 20 65 73 74 69 6d 61  74 65 64 20 6c 65 6e 67  |f estimated leng|
000039d0  74 68 0a 20 20 20 4c 44  4d 49 41 20 20 20 72 30  |th.   LDMIA   r0|
000039e0  2c 7b 72 32 2d 72 36 7d  0a 20 20 20 41 44 44 20  |,{r2-r6}.   ADD |
000039f0  20 20 20 20 72 30 2c 72  31 2c 23 33 36 0a 20 20  |    r0,r1,#36.  |
00003a00  20 53 54 4d 49 41 20 20  20 72 30 2c 7b 72 32 2d  | STMIA   r0,{r2-|
00003a10  72 36 7d 20 20 20 20 20  20 20 3b 20 63 6f 70 79  |r6}       ; copy|
00003a20  20 69 6e 74 6f 20 62 6c  6f 63 6b 0a 20 20 20 4d  | into block.   M|
00003a30  4f 56 20 20 20 20 20 72  30 2c 23 31 38 20 20 20  |OV     r0,#18   |
00003a40  20 20 20 20 20 20 20 20  3b 20 73 65 6e 64 20 72  |        ; send r|
00003a50  65 63 6f 72 64 65 64 20  64 65 6c 69 76 65 72 79  |ecorded delivery|
00003a60  8c 0a 20 20 20 4c 44 52  20 20 20 20 20 72 32 2c  |..   LDR     r2,|
00003a70  5b 72 31 2c 23 32 30 5d  20 20 20 20 20 20 3b 20  |[r1,#20]      ; |
00003a80  67 65 74 20 77 69 6e 64  6f 77 20 74 6f 20 73 65  |get window to se|
00003a90  6e 64 20 74 6f 0a 20 20  20 4c 44 52 20 20 20 20  |nd to.   LDR    |
00003aa0  20 72 33 2c 5b 72 31 2c  23 32 34 5d 20 20 20 20  | r3,[r1,#24]    |
00003ab0  20 20 3b 20 67 65 74 20  69 63 6f 6e 20 74 6f 20  |  ; get icon to |
00003ac0  73 65 6e 64 20 74 6f 0a  20 20 20 52 45 4d 20 20  |send to.   REM  |
00003ad0  20 20 20 22 53 65 6e 64  69 6e 67 20 74 6f 20 25  |   "Sending to %|
00003ae0  26 32 22 0a 20 20 20 53  57 49 20 20 20 20 20 22  |&2".   SWI     "|
00003af0  58 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |XWimp_SendMessag|
00003b00  65 22 0a 20 20 20 4d 4f  56 56 53 20 20 20 72 30  |e".   MOVVS   r0|
00003b10  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 3b  |,#0            ;|
00003b20  20 6e 6f 74 20 64 72 61  67 67 69 6e 67 20 69 66  | not dragging if|
00003b30  20 65 72 72 6f 72 0a 20  20 20 4d 4f 56 56 43 20  | error.   MOVVC |
00003b40  20 20 72 30 2c 23 32 20  20 20 20 20 20 20 20 20  |  r0,#2         |
00003b50  20 20 20 3b 20 69 66 20  6e 6f 20 65 72 72 6f 72  |   ; if no error|
00003b60  20 74 68 65 6e 20 6f 6e  20 74 6f 20 73 61 76 65  | then on to save|
00003b70  20 64 61 74 61 20 6d 65  73 73 61 67 65 0a 20 20  | data message.  |
00003b80  20 53 54 52 57 20 20 20  20 72 30 2c 60 64 72 61  | STRW    r0,`dra|
00003b90  67 67 69 6e 67 0a 20 20  20 52 45 4d 20 20 20 20  |gging.   REM    |
00003ba0  20 22 4d 65 73 73 61 67  65 20 73 65 6e 74 2c 20  | "Message sent, |
00003bb0  6f 6b 20 3d 20 25 72 30  22 0a 24 6e 6f 61 63 74  |ok = %r0".$noact|
00003bc0  69 6f 6e 0a 20 20 20 4d  4f 56 20 20 20 20 20 72  |ion.   MOV     r|
00003bd0  30 2c 23 30 0a 20 20 20  4c 44 4d 46 44 20 20 20  |0,#0.   LDMFD   |
00003be0  28 73 70 29 21 2c 7b 72  31 2d 72 39 2c 70 63 7d  |(sp)!,{r1-r9,pc}|
00003bf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00003c00  52 65 74 75 72 6e 20 66  72 6f 6d 20 63 61 6c 6c  |Return from call|
00003c10  0a 24 65 78 69 74 0a 20  20 20 4d 4f 56 20 20 20  |.$exit.   MOV   |
00003c20  20 20 72 30 2c 23 37 0a  20 20 20 4c 44 4d 46 44  |  r0,#7.   LDMFD|
00003c30  20 20 20 28 73 70 29 21  2c 7b 72 31 2d 72 39 2c  |   (sp)!,{r1-r9,|
00003c40  70 63 7d 20 20 20 20 20  20 20 20 20 20 20 20 20  |pc}             |
00003c50  20 3b 20 52 65 74 75 72  6e 20 66 72 6f 6d 20 63  | ; Return from c|
00003c60  61 6c 6c 0a 0a 2e 60 65  73 74 6c 65 6e 0a 20 20  |all...`estlen.  |
00003c70  20 45 51 55 44 20 20 20  20 2d 31 20 3b 20 64 61  | EQUD    -1 ; da|
00003c80  74 61 20 6e 6f 74 20 73  61 66 65 0a 2e 60 74 65  |ta not safe..`te|
00003c90  78 74 74 79 70 65 0a 20  20 20 45 51 55 44 20 20  |xttype.   EQUD  |
00003ca0  20 20 26 46 46 46 0a 2e  60 73 61 76 65 6e 61 6d  |  &FFF..`savenam|
00003cb0  65 0a 20 20 20 45 51 55  53 20 20 20 20 22 49 63  |e.   EQUS    "Ic|
00003cc0  6f 6e 74 65 78 74 22 2b  43 48 52 24 30 0a 0a 2e  |ontext"+CHR$0...|
00003cd0  63 68 65 63 6b 6e 75 6c  6c 65 76 65 6e 74 0a 20  |checknullevent. |
00003ce0  20 20 4c 44 52 57 20 20  20 20 72 32 2c 60 64 72  |  LDRW    r2,`dr|
00003cf0  61 67 67 69 6e 67 0a 20  20 20 52 45 4d 20 20 20  |agging.   REM   |
00003d00  20 20 22 25 63 30 34 25  63 33 30 43 75 72 72 65  |  "%c04%c30Curre|
00003d10  6e 74 20 73 74 61 74 65  20 3d 20 25 72 32 22 0a  |nt state = %r2".|
00003d20  20 20 20 43 4d 50 20 20  20 20 20 72 32 2c 23 31  |   CMP     r2,#1|
00003d30  0a 20 20 20 42 45 51 20  20 20 20 20 69 73 6e 75  |.   BEQ     isnu|
00003d40  6c 6c 65 76 65 6e 74 0a  20 20 20 43 4d 50 20 20  |llevent.   CMP  |
00003d50  20 20 20 72 32 2c 23 33  0a 20 20 20 4c 44 4d 4e  |   r2,#3.   LDMN|
00003d60  45 46 44 20 28 73 70 29  21 2c 7b 72 31 2d 72 32  |EFD (sp)!,{r1-r2|
00003d70  2c 70 63 7d 20 20 20 20  20 20 20 20 20 3b 20 72  |,pc}         ; r|
00003d80  65 74 75 72 6e 20 69 66  20 6e 6f 74 20 61 20 73  |eturn if not a s|
00003d90  6d 61 6c 6c 20 64 72 61  67 0a 20 20 20 53 54 4d  |mall drag.   STM|
00003da0  46 44 20 20 20 28 73 70  29 21 2c 7b 72 33 2d 72  |FD   (sp)!,{r3-r|
00003db0  39 7d 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |9}            ; |
00003dc0  53 74 61 63 6b 20 72 65  67 69 73 74 65 72 73 0a  |Stack registers.|
00003dd0  20 20 20 41 44 52 57 20  20 20 20 72 31 2c 60 70  |   ADRW    r1,`p|
00003de0  74 72 62 6c 6f 63 6b 0a  20 20 20 53 57 49 20 20  |trblock.   SWI  |
00003df0  20 20 20 22 57 69 6d 70  5f 47 65 74 50 6f 69 6e  |   "Wimp_GetPoin|
00003e00  74 65 72 49 6e 66 6f 22  0a 20 20 20 4c 44 52 57  |terInfo".   LDRW|
00003e10  20 20 20 20 72 30 2c 60  6d 6f 75 73 65 62 0a 20  |    r0,`mouseb. |
00003e20  20 20 54 53 54 20 20 20  20 20 72 30 2c 23 34 0a  |  TST     r0,#4.|
00003e30  20 20 20 42 45 51 20 20  20 20 20 24 64 72 6f 70  |   BEQ     $drop|
00003e40  70 65 64 20 20 20 20 20  20 20 20 20 20 20 20 20  |ped             |
00003e50  20 20 20 20 3b 20 69 66  20 79 6f 75 20 64 72 6f  |    ; if you dro|
00003e60  70 2c 20 62 75 74 20 73  74 69 6c 6c 20 68 6f 6c  |p, but still hol|
00003e70  64 20 61 64 6a 75 73 74  0a 20 20 20 54 53 54 20  |d adjust.   TST |
00003e80  20 20 20 20 72 30 2c 23  31 20 20 20 20 20 20 20  |    r0,#1       |
00003e90  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 61  |             ; a|
00003ea0  64 6a 75 73 74 20 3f 0a  20 20 20 42 4e 45 20 20  |djust ?.   BNE  |
00003eb0  20 20 20 24 65 78 69 74  20 20 20 20 20 20 20 20  |   $exit        |
00003ec0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 69 66  |            ; if|
00003ed0  20 73 74 69 6c 6c 20 70  72 65 73 73 65 64 20 74  | still pressed t|
00003ee0  68 65 6e 20 65 78 69 74  0a 20 20 20 42 4c 20 20  |hen exit.   BL  |
00003ef0  20 20 20 20 77 61 69 74  0a 20 20 20 4c 44 52 57  |    wait.   LDRW|
00003f00  20 20 20 20 72 38 2c 60  73 61 76 65 61 64 64 72  |    r8,`saveaddr|
00003f10  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 67  |             ; g|
00003f20  65 74 20 73 61 76 65 20  61 64 64 72 65 73 73 0a  |et save address.|
00003f30  20 20 20 41 44 52 20 20  20 20 20 72 32 2c 60 74  |   ADR     r2,`t|
00003f40  65 78 74 66 69 6c 65 20  20 20 20 20 20 20 20 20  |extfile         |
00003f50  20 20 20 20 3b 20 73 77  61 70 20 62 61 63 6b 20  |    ; swap back |
00003f60  74 6f 20 62 69 67 67 79  0a 20 20 20 42 4c 20 20  |to biggy.   BL  |
00003f70  20 20 20 20 73 65 74 64  72 61 67 0a 20 20 20 4d  |    setdrag.   M|
00003f80  4f 56 20 20 20 20 20 72  30 2c 23 31 0a 20 20 20  |OV     r0,#1.   |
00003f90  53 54 52 57 20 20 20 20  72 30 2c 60 64 72 61 67  |STRW    r0,`drag|
00003fa0  67 69 6e 67 0a 20 20 20  4d 4f 56 20 20 20 20 20  |ging.   MOV     |
00003fb0  72 30 2c 23 30 0a 24 65  78 69 74 0a 20 20 20 4c  |r0,#0.$exit.   L|
00003fc0  44 4d 46 44 20 20 20 28  73 70 29 21 2c 7b 72 33  |DMFD   (sp)!,{r3|
00003fd0  2d 72 39 7d 0a 20 20 20  4c 44 4d 46 44 20 20 20  |-r9}.   LDMFD   |
00003fe0  28 73 70 29 21 2c 7b 72  31 2d 72 32 2c 70 63 7d  |(sp)!,{r1-r2,pc}|
00003ff0  20 20 20 20 20 20 20 20  20 3b 20 52 65 74 75 72  |         ; Retur|
00004000  6e 20 66 72 6f 6d 20 63  61 6c 6c 0a 24 64 72 6f  |n from call.$dro|
00004010  70 70 65 64 0a 20 20 20  4c 44 4d 46 44 20 20 20  |pped.   LDMFD   |
00004020  28 73 70 29 21 2c 7b 72  33 2d 72 39 7d 0a 20 20  |(sp)!,{r3-r9}.  |
00004030  20 4d 4f 56 20 20 20 20  20 72 30 2c 23 30 0a 20  | MOV     r0,#0. |
00004040  20 20 42 20 20 20 20 20  20 20 69 73 64 72 61 67  |  B       isdrag|
00004050  64 6f 6e 65 0a 0a 2e 69  73 6e 75 6c 6c 65 76 65  |done...isnulleve|
00004060  6e 74 0a 20 20 20 53 54  4d 46 44 20 20 20 28 73  |nt.   STMFD   (s|
00004070  70 29 21 2c 7b 72 33 2d  72 39 7d 20 20 20 20 20  |p)!,{r3-r9}     |
00004080  20 20 20 20 20 20 20 3b  20 53 74 61 63 6b 20 72  |       ; Stack r|
00004090  65 67 69 73 74 65 72 73  0a 20 20 20 53 54 52 57  |egisters.   STRW|
000040a0  20 20 20 20 72 31 2c 60  75 73 65 72 62 6c 6f 63  |    r1,`userbloc|
000040b0  6b 0a 20 20 20 41 44 52  57 20 20 20 20 72 31 2c  |k.   ADRW    r1,|
000040c0  60 70 74 72 62 6c 6f 63  6b 0a 20 20 20 53 57 49  |`ptrblock.   SWI|
000040d0  20 20 20 20 20 22 57 69  6d 70 5f 47 65 74 50 6f  |     "Wimp_GetPo|
000040e0  69 6e 74 65 72 49 6e 66  6f 22 0a 20 20 20 4c 44  |interInfo".   LD|
000040f0  52 57 20 20 20 20 72 30  2c 60 6d 6f 75 73 65 62  |RW    r0,`mouseb|
00004100  0a 20 20 20 54 53 54 20  20 20 20 20 72 30 2c 23  |.   TST     r0,#|
00004110  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
00004120  20 20 20 20 20 3b 20 61  64 6a 75 73 74 20 3f 0a  |     ; adjust ?.|
00004130  20 20 20 42 45 51 20 20  20 20 20 24 65 78 69 74  |   BEQ     $exit|
00004140  0a 20 20 20 4c 44 52 57  20 20 20 20 72 33 2c 60  |.   LDRW    r3,`|
00004150  6d 6f 75 73 65 77 0a 20  20 20 4c 44 52 57 20 20  |mousew.   LDRW  |
00004160  20 20 72 34 2c 60 6d 6f  75 73 65 69 0a 20 20 20  |  r4,`mousei.   |
00004170  42 4c 20 20 20 20 20 20  69 73 64 72 61 67 6f 6b  |BL      isdragok|
00004180  0a 20 20 20 43 4d 50 20  20 20 20 20 72 30 2c 23  |.   CMP     r0,#|
00004190  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
000041a0  20 20 20 20 20 3b 20 69  73 20 69 74 20 61 20 76  |     ; is it a v|
000041b0  61 6c 69 64 20 69 63 6f  6e 20 74 6f 20 61 64 64  |alid icon to add|
000041c0  20 3f 0a 20 20 20 42 45  51 20 20 20 20 20 24 65  | ?.   BEQ     $e|
000041d0  78 69 74 0a 20 20 20 4d  4f 56 20 20 20 20 20 72  |xit.   MOV     r|
000041e0  30 2c 23 35 20 20 20 20  20 20 20 20 20 20 20 20  |0,#5            |
000041f0  20 20 20 20 20 20 20 20  3b 20 72 65 61 64 20 63  |        ; read c|
00004200  75 72 72 65 6e 74 20 74  61 73 6b 20 68 61 6e 64  |urrent task hand|
00004210  6c 65 0a 20 20 20 53 57  49 20 20 20 20 20 22 57  |le.   SWI     "W|
00004220  69 6d 70 5f 52 65 61 64  53 79 73 49 6e 66 6f 22  |imp_ReadSysInfo"|
00004230  0a 20 20 20 4d 4f 56 20  20 20 20 20 72 39 2c 72  |.   MOV     r9,r|
00004240  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00004250  20 20 20 20 20 3b 20 72  39 3d 63 75 72 72 65 6e  |     ; r9=curren|
00004260  74 20 74 61 73 6b 0a 3b  20 72 65 61 64 20 74 61  |t task.; read ta|
00004270  73 6b 20 68 61 6e 64 6c  65 20 77 65 20 61 72 65  |sk handle we are|
00004280  20 6f 76 65 72 0a 20 20  20 4c 44 52 57 20 20 20  | over.   LDRW   |
00004290  20 72 31 2c 60 75 73 65  72 62 6c 6f 63 6b 0a 20  | r1,`userblock. |
000042a0  20 20 4d 4f 56 20 20 20  20 20 72 32 2c 72 33 0a  |  MOV     r2,r3.|
000042b0  20 20 20 4d 4f 56 20 20  20 20 20 72 33 2c 72 34  |   MOV     r3,r4|
000042c0  0a 20 20 20 4d 4f 56 20  20 20 20 20 72 30 2c 23  |.   MOV     r0,#|
000042d0  31 39 0a 20 20 20 53 57  49 20 20 20 20 20 22 58  |19.   SWI     "X|
000042e0  57 69 6d 70 5f 53 65 6e  64 4d 65 73 73 61 67 65  |Wimp_SendMessage|
000042f0  22 20 20 3b 20 66 69 6e  64 20 74 68 65 20 74 61  |"  ; find the ta|
00004300  73 6b 20 68 61 6e 64 6c  65 0a 20 20 20 52 45 4d  |sk handle.   REM|
00004310  20 20 20 20 20 43 48 52  24 34 2b 22 25 49 43 75  |     CHR$4+"%ICu|
00004320  72 72 65 6e 74 20 3d 20  25 26 39 2c 20 6f 76 65  |rrent = %&9, ove|
00004330  72 20 3d 20 25 26 32 2c  20 77 69 6e 20 3d 20 25  |r = %&2, win = %|
00004340  26 33 2c 20 69 63 6f 6e  3d 25 26 34 22 0a 20 20  |&3, icon=%&4".  |
00004350  20 43 4d 50 20 20 20 20  20 72 32 2c 72 39 20 20  | CMP     r2,r9  |
00004360  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00004370  61 72 65 20 74 68 65 79  20 74 68 65 20 73 61 6d  |are they the sam|
00004380  65 20 74 61 73 6b 20 3f  0a 20 20 20 42 45 51 20  |e task ?.   BEQ |
00004390  20 20 20 20 24 67 6f 74  61 72 65 61 20 20 20 20  |    $gotarea    |
000043a0  20 20 20 20 20 20 20 20  20 3b 20 69 66 20 74 68  |         ; if th|
000043b0  65 79 20 61 72 65 20 74  68 65 6e 20 60 73 74 72  |ey are then `str|
000043c0  20 69 73 20 69 6e 20 72  69 67 68 74 20 70 6c 61  | is in right pla|
000043d0  63 65 0a 20 20 20 4d 4f  56 20 20 20 20 20 72 30  |ce.   MOV     r0|
000043e0  2c 72 32 20 20 20 20 20  20 20 20 20 20 20 20 20  |,r2             |
000043f0  20 20 20 3b 20 72 30 3d  73 6f 75 72 63 65 20 28  |   ; r0=source (|
00004400  6f 76 65 72 29 0a 20 20  20 4c 44 52 57 20 20 20  |over).   LDRW   |
00004410  20 72 31 2c 60 73 74 72  20 20 20 20 20 20 20 20  | r1,`str        |
00004420  20 20 20 20 20 20 3b 20  72 31 3d 73 6f 75 72 63  |      ; r1=sourc|
00004430  65 20 64 61 74 61 20 28  69 6e 20 6f 76 65 72 29  |e data (in over)|
00004440  0a 20 20 20 4d 4f 56 20  20 20 20 20 72 32 2c 72  |.   MOV     r2,r|
00004450  39 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |9               |
00004460  20 3b 20 72 32 3d 64 65  73 74 20 28 63 75 72 72  | ; r2=dest (curr|
00004470  65 6e 74 29 0a 20 20 20  4c 44 52 57 20 20 20 20  |ent).   LDRW    |
00004480  72 33 2c 60 75 73 65 72  62 6c 6f 63 6b 20 20 20  |r3,`userblock   |
00004490  20 20 20 20 20 3b 20 72  33 3d 64 65 73 74 20 64  |     ; r3=dest d|
000044a0  61 74 61 20 28 69 6e 20  63 75 72 72 65 6e 74 20  |ata (in current |
000044b0  2d 20 75 73 65 72 73 20  62 6c 6f 63 6b 21 29 0a  |- users block!).|
000044c0  20 20 20 4d 4f 56 20 20  20 20 20 72 34 2c 23 32  |   MOV     r4,#2|
000044d0  35 36 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |56              |
000044e0  3b 20 72 34 3d 6c 65 6e  67 74 68 0a 20 20 20 52  |; r4=length.   R|
000044f0  45 4d 20 20 20 20 20 22  4d 6f 76 65 20 66 72 6f  |EM     "Move fro|
00004500  6d 20 54 25 26 30 20 74  6f 20 54 25 26 32 2c 20  |m T%&0 to T%&2, |
00004510  66 72 6f 6d 20 41 25 26  31 20 74 6f 20 41 25 26  |from A%&1 to A%&|
00004520  33 22 0a 20 20 20 53 57  49 20 20 20 20 20 22 57  |3".   SWI     "W|
00004530  69 6d 70 5f 54 72 61 6e  73 66 65 72 42 6c 6f 63  |imp_TransferBloc|
00004540  6b 22 0a 20 20 20 4d 4f  56 20 20 20 20 20 72 30  |k".   MOV     r0|
00004550  2c 23 30 0a 20 20 20 53  54 52 42 20 20 20 20 72  |,#0.   STRB    r|
00004560  30 2c 5b 72 33 2c 23 32  35 35 5d 20 20 20 20 20  |0,[r3,#255]     |
00004570  20 20 20 20 3b 20 61 64  64 20 61 20 74 65 72 6d  |    ; add a term|
00004580  69 6e 61 74 6f 72 20 69  6e 20 63 61 73 65 20 74  |inator in case t|
00004590  68 65 20 73 74 72 69 6e  67 20 69 73 20 6c 6f 6e  |he string is lon|
000045a0  67 0a 20 20 20 53 54 52  57 20 20 20 20 72 33 2c  |g.   STRW    r3,|
000045b0  60 73 74 72 20 20 20 20  20 20 20 20 20 20 20 20  |`str            |
000045c0  20 20 3b 20 73 74 6f 72  65 20 69 6e 20 62 6c 6f  |  ; store in blo|
000045d0  63 6b 20 73 6f 20 74 68  61 74 20 61 64 64 6c 69  |ck so that addli|
000045e0  6e 65 20 63 61 6e 20 66  69 6e 64 20 69 74 0a 24  |ne can find it.$|
000045f0  67 6f 74 61 72 65 61 0a  20 20 20 4c 44 52 57 20  |gotarea.   LDRW |
00004600  20 20 20 72 33 2c 60 73  74 72 0a 20 20 20 52 45  |   r3,`str.   RE|
00004610  4d 20 20 20 20 20 22 49  73 20 6f 6e 65 20 6f 66  |M     "Is one of|
00004620  20 6f 75 72 73 2c 20 69  73 20 25 24 33 22 0a 20  | ours, is %$3". |
00004630  20 20 4c 44 52 57 20 20  20 20 72 37 2c 60 73 61  |  LDRW    r7,`sa|
00004640  76 65 6c 65 6e 0a 20 20  20 4c 44 52 57 20 20 20  |velen.   LDRW   |
00004650  20 72 38 2c 60 73 61 76  65 61 64 64 72 0a 20 20  | r8,`saveaddr.  |
00004660  20 52 45 4d 20 20 20 20  20 22 43 75 72 72 65 6e  | REM     "Curren|
00004670  74 6c 79 20 73 61 79 73  20 25 24 38 22 0a 20 20  |tly says %$8".  |
00004680  20 42 4c 20 20 20 20 20  20 61 64 64 6c 69 6e 65  | BL      addline|
00004690  0a 20 20 20 53 54 52 57  20 20 20 20 72 38 2c 60  |.   STRW    r8,`|
000046a0  73 61 76 65 61 64 64 72  0a 20 20 20 53 54 52 57  |saveaddr.   STRW|
000046b0  20 20 20 20 72 37 2c 60  73 61 76 65 6c 65 6e 0a  |    r7,`savelen.|
000046c0  20 20 20 4c 41 44 52 20  20 20 20 72 32 2c 60 73  |   LADR    r2,`s|
000046d0  6d 61 6c 6c 66 69 6c 65  0a 20 20 20 42 4c 20 20  |mallfile.   BL  |
000046e0  20 20 20 20 73 65 74 64  72 61 67 0a 20 20 20 4d  |    setdrag.   M|
000046f0  4f 56 20 20 20 20 20 72  30 2c 23 33 0a 20 20 20  |OV     r0,#3.   |
00004700  53 54 52 57 20 20 20 20  72 30 2c 60 64 72 61 67  |STRW    r0,`drag|
00004710  67 69 6e 67 20 20 20 20  20 20 20 20 20 3b 20 6d  |ging         ; m|
00004720  61 72 6b 20 61 73 20 63  75 72 72 65 6e 74 6c 79  |ark as currently|
00004730  20 64 72 61 67 67 69 6e  67 20 73 6d 61 6c 6c 0a  | dragging small.|
00004740  24 65 78 69 74 0a 20 20  20 4d 4f 56 20 20 20 20  |$exit.   MOV    |
00004750  20 72 30 2c 23 30 0a 20  20 20 4c 44 4d 46 44 20  | r0,#0.   LDMFD |
00004760  20 20 28 73 70 29 21 2c  7b 72 33 2d 72 39 7d 20  |  (sp)!,{r3-r9} |
00004770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004780  3b 20 52 65 73 74 6f 72  65 20 72 65 67 69 73 74  |; Restore regist|
00004790  65 72 73 0a 20 20 20 4c  44 4d 46 44 20 20 20 28  |ers.   LDMFD   (|
000047a0  73 70 29 21 2c 7b 72 31  2d 72 32 2c 70 63 7d 20  |sp)!,{r1-r2,pc} |
000047b0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 52  |             ; R|
000047c0  65 74 75 72 6e 20 66 72  6f 6d 20 63 61 6c 6c 0a  |eturn from call.|
000047d0  0a 23 4c 69 62 72 61 72  79 20 22 53 74 72 69 6e  |.#Library "Strin|
000047e0  67 73 22 2c 6c 65 6e 63  74 72 6c 2e 6d 6f 76 65  |gs",lenctrl.move|
000047f0  63 74 72 6c 0a 23 20 50  4f 53 54 0a 23 20 52 55  |ctrl.# POST.# RU|
00004800  4e 20 3c 43 4f 44 45 3e  0a 23 20 45 4e 44 0a 0a  |N <CODE>.# END..|
00004810