Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199607.adf » Regulars » StarInfo/Bloch/!AutoType/Source

StarInfo/Bloch/!AutoType/Source

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_199607.adf » Regulars
Filename: StarInfo/Bloch/!AutoType/Source
Read OK:
File size: 1A6B bytes
Load address: 0000
Exec address: 0000
File contents
   10REM Source code for AutoType
   20REM by Matthew Bloch, 1st April 1996
   30:
   40ON ERROR REPORT:PRINT" at line ";ERL:END
   50:
   60limit%=2048
   70R0=0:R1=1:R2=2:R3=3:R4=4:R5=5
   80DIM code% limit%
   90DIM check_fail%(255)
  100FOR pass%=12 TO 14 STEP 2
  110P%=0:O%=code%:L%=code%+limit%:t%=0
  120[OPT pass%
  130           EQUD      0
  140           EQUD      init%
  150           EQUD      final%
  160           EQUD      0
  170           EQUD      title%
  180           EQUD      help%
  190           EQUD      0
  200           :
  210.title%    EQUS      "AutoType":EQUB 0
  220.help%     EQUS      "AutoType":EQUB 9:EQUB 9:EQUS "1.00 (1st April 1996)":EQUB 13:EQUB 13
  221           EQUS "This module guesses at filetypes... read the !Help file for full details":EQUB 0
  222           ALIGN
  230.varval%   EQUS     "AutoType$Dir":EQUB 0
  231           ALIGN
  240.name_var% EQUS     "AutoType$File"
  250.name_let% EQUS     "@"
  251           EQUB     0
  252           ALIGN
  260.head_var% EQUS     "AutoTypeHeader"
  270.head_let% EQUS     "@"
  271           EQUB     0
  272           ALIGN
  280.run_type_prog%
  290           EQUS      "RunTypeProg"
  291           EQUB      0
  300           ALIGN
  310          :
  320.add_letters%
  330          STMFD     R13!,{R0,R14}
  340          LDRB      R0,head_let%
  350          ADD       R0,R0,#1
  360          CMP       R0,#91
  370          MOVEQ     R0,#65
  380          STRB      R0,head_let%
  390          STRB      R0,name_let%
  400          LDMFD     R13!,{R0,PC}^
  410          :
  420.init%    STMFD     R13!,{R14}
  430          MOV       R0,#&D              ; OS_Find vector
  440          ADR       R1,findv%
  450          MOV       R2,R12
  460          SWI       "XOS_Claim"
  470          MOV       R0,#&8              ; OS_File vector
  480          ADR       R1,filev%
  490          MOV       R2,R12
  500          SWI       "XOS_Claim"
  510          BVS       init_error%
  520          MOV       R0,#6
  530          MOV       R3,#2048
  540          SWI       "XOS_Module"
  550          BVS       init_error%
  560          STR       R2,[R12]
  570.init_error%
  580          LDMFD     R13!,{PC}
  590          :
  600.final%   STMFD     R13!,{R14}
  610          MOV       R0,#&D
  620          ADR       R1,findv%
  630          MOV       R2,R12
  640          SWI       "XOS_Release"
  650          BVS       final_error%
  660          MOV       R0,#&8
  670          ADR       R1,filev%
  680          MOV       R2,R12
  690          SWI       "XOS_Release"
  700          BVS       final_error%
  710          MOV       R0,#7
  720          LDR       R2,[R12]
  730          SWI       "XOS_Module"
  740          BVS       final_error%
  750.final_error%
  760          LDMFD     R13!,{PC}
  770          :
  780.findv%   CMP       R0,#0
  790          MOVNES    PC,R14              ; Reason code 0 = close files
  800          CMP       R2,#27
  810          MOVEQS    PC,R14
  820          STMFD     R13!,{R0-R7,R12,R14}
  830          LDR       R12,[R12]
  840          MOV       R6,R1               ; Keep file handle in R6
  850          MOV       R0,#7
  860          MOV       R2,R12              ; workspace+0 > name buffer for file
  870          MOV       R5,#256
  880          SWI       "XOS_Args"          ; Get filename from handle
  890          MOV       R7,R5
  900          MOV       R0,#254
  910          MOV       R1,R6
  920          SWI       "XOS_Args"
  930          TST       R2,#%100000
  940          LDMNEFD   R13!,{R0-R7,R12,PC}^  ; Can't be a directory
  950          :
  960          ADR      R0,varval%
  970          ADD       R1,R12,#256         ; workspace+256 > downloads folder name
  980          MOV       R2,#256
  990          MOV       R3,#0
 1000          SWI       "XOS_ReadVarVal"    ; Get downloads folder name from sysvar
 1010          MOV       R0,#0
 1020          STRB      R0,[R1,R2]
 1030          LDMVSFD   R13!,{R0-R7,R12,PC}^; Exit quietly if variable not set
 1040          :
 1050          MOV       R1,R12
 1060          ADD       R0,R1,#256
 1070.compare_strings%
 1080          LDRB      R2,[R0],#1
 1090          LDRB      R3,[R1],#1
 1100          CMP       R2,#0
 1110          BEQ       compare_okay%
 1120          CMP       R2,R3
 1130          LDMNEFD   R13!,{R0-R7,R12,PC}^; Exit quietly if not downloads folder
 1140          B         compare_strings%
 1150.compare_okay%
 1160          LDRB      R3,[R1],#1
 1170          CMP       R3,#ASC"."
 1180          LDMEQFD   R13!,{R0-R7,R12,PC}^; Exit quietly if further down
 1190          CMP       R3,#0
 1200          BNE       compare_okay%
 1210          :
 1220          MOV       R0,#3
 1230          MOV       R1,R6
 1240          ADD       R2,R12,#256         ; workspace+256 > buffer for file header
 1250          MOV       R3,#1536
 1260          MOV       R4,#0
 1270          SWI       "XOS_GBPB"          ; Get top 1536 bytes of file
 1280          :
 1290          BL        add_letters%
 1300          ADR      R0,head_var%
 1310          ADD       R1,R12,#256
 1320          MOV       R2,#1536
 1330          MOV       R3,#0
 1340          MOV       R4,#4
 1350          SWI       "XOS_SetVarVal"
 1360          ADR      R0,name_var%
 1370          MOV       R1,R12
 1380          MOV       R2,R7
 1390          MOV       R3,#0
 1400          MOV       R4,#0
 1410          SWI       "XOS_SetVarVal"
 1420          ADR       R0,type_callback%
 1430          MOV       R1,#0
 1440          SWI       "XOS_AddCallBack"
 1450          LDMFD     R13!,{R0-R7,R12,PC}^
 1460          :
 1470.filev%   CMP       R0,#18
 1480          MOVNE     PC,R14
 1490          CMP       R3,#27
 1500          MOVEQ     PC,R14
 1510          STMFD     R13!,{R0-R3,R14}
 1520          SWI       "XOS_Mouse"
 1530          TST       R2,#%100
 1540          LDMFD     R13!,{R0-R3,R14}
 1550          MOVEQS    PC,R14
 1560          STMFD     R13!,{R0-R7,R12,R14}
 1570          SWI       &107
 1580          LDR       R12,[R12]
 1590          MOV       R7,R2                   ; Preserve filetype to set
 1600          MOV       R0,#23
 1610          SWI       "XOS_File"
 1620          CMP       R6,R7
 1630          LDMNEFD   R13!,{R0-R7,R12,PC}^    ; Return if explicitly setting type
 1640          BL        add_letters%
 1650          MOV       R2,#0
 1660.find_length_loop%                          ; Bloody OS_SetVarVal ;-)
 1670          LDRB      R0,[R1,R2]
 1680          CMP       R0,#32
 1690          ADDGE     R2,R2,#1
 1700          BGE       find_length_loop%
 1710          ADR      R0,name_var%
 1720          MOV       R3,#0
 1730          MOV       R4,#4
 1740          SWI       "XOS_SetVarVal"         ; Name variable
 1750          ADR       R0,type_callback%
 1760          MOV       R1,#0
 1770          SWI       "XOS_AddCallBack"
 1780          LDMFD     R13!,{R0-R7,R12,PC}^
 1790          :
 1800.type_callback%
 1810          STMFD     R13!,{R0,R14}
 1820          ADR      R0,run_type_prog%
 1830          SWI       "XOS_CLI"
 1840          LDMFD     R13!,{R0,PC}^
 1850]:NEXT
 1860SYS "OS_File",10,"AutoType",&FFA,,code%,O%
 1870END

� Source code for AutoType
&� by Matthew Bloch, 1st April 1996
:
(� � �:�" at line ";�:�
2:
<limit%=2048
F!R0=0:R1=1:R2=2:R3=3:R4=4:R5=5
P� code% limit%
Z� check_fail%(255)
d� pass%=12 � 14 � 2
n&P%=0:O%=code%:L%=code%+limit%:t%=0
x[OPT pass%
�           EQUD      0
�           EQUD      init%
�           EQUD      final%
�           EQUD      0
�           EQUD      title%
�           EQUD      help%
�           EQUD      0
�           :
�*.title%    EQUS      "AutoType":EQUB 0
�^.help%     EQUS      "AutoType":EQUB 9:EQUB 9:EQUS "1.00 (1st April 1996)":EQUB 13:EQUB 13
�e           EQUS "This module guesses at filetypes... read the !Help file for full details":EQUB 0
�           ALIGN
�-.varval%   EQUS     "AutoType$Dir":EQUB 0
�           ALIGN
�'.name_var% EQUS     "AutoType$File"
�.name_let% EQUS     "@"
�           EQUB     0
�           ALIGN
(.head_var% EQUS     "AutoTypeHeader"
.head_let% EQUS     "@"
           EQUB     0
           ALIGN
.run_type_prog%
"&           EQUS      "RunTypeProg"
#           EQUB      0
,           ALIGN
6          :
@.add_letters%
J%          STMFD     R13!,{R0,R14}
T$          LDRB      R0,head_let%
^           ADD       R0,R0,#1
h          CMP       R0,#91
r          �Q     R0,#65
|$          STRB      R0,head_let%
�$          STRB      R0,name_let%
�%          LDMFD     R13!,{R0,PC}^
�          :
�".init%    STMFD     R13!,{R14}
�<          MOV       R0,#&D              ; OS_Find vector
�!          ADR       R1,findv%
�          MOV       R2,R12
�#          SWI       "XOS_Claim"
�<          MOV       R0,#&8              ; OS_File vector
�!          ADR       R1,filev%
�          MOV       R2,R12
�#          SWI       "XOS_Claim"
�#          BVS       init_error%
          MOV       R0,#6
           MOV       R3,#2048
$          SWI       "XOS_Module"
&#          BVS       init_error%
0           STR       R2,[R12]
:.init_error%
D!          LDMFD     R13!,{PC}
N          :
X".final%   STMFD     R13!,{R14}
b          MOV       R0,#&D
l!          ADR       R1,findv%
v          MOV       R2,R12
�%          SWI       "XOS_Release"
�$          BVS       final_error%
�          MOV       R0,#&8
�!          ADR       R1,filev%
�          MOV       R2,R12
�%          SWI       "XOS_Release"
�$          BVS       final_error%
�          MOV       R0,#7
�           LDR       R2,[R12]
�$          SWI       "XOS_Module"
�$          BVS       final_error%
�.final_error%
�!          LDMFD     R13!,{PC}
          :
.findv%   CMP       R0,#0
I          MOVNES    PC,R14              ; Reason code 0 = close files
           CMP       R2,#27
*          �QS    PC,R14
4,          STMFD     R13!,{R0-R7,R12,R14}
>!          LDR       R12,[R12]
HD          MOV       R6,R1               ; Keep file handle in R6
R          MOV       R0,#7
\P          MOV       R2,R12              ; workspace+0 > name buffer for file
f          MOV       R5,#256
pF          SWI       "XOS_Args"          ; Get filename from handle
z          MOV       R7,R5
�          MOV       R0,#254
�          MOV       R1,R6
�"          SWI       "XOS_Args"
�#          TST       R2,#%100000
�D          LDMNEFD   R13!,{R0-R7,R12,PC}^  ; Can't be a directory
�          :
�!          ADR      R0,varval%
�S          ADD       R1,R12,#256         ; workspace+256 > downloads folder name
�          MOV       R2,#256
�          MOV       R3,#0
�S          SWI       "XOS_ReadVarVal"    ; Get downloads folder name from sysvar
�          MOV       R0,#0
�"          STRB      R0,[R1,R2]
N          LDMVSFD   R13!,{R0-R7,R12,PC}^; Exit quietly if variable not set
          :
          MOV       R1,R12
$"          ADD       R0,R1,#256
..compare_strings%
8"          LDRB      R2,[R0],#1
B"          LDRB      R3,[R1],#1
L          CMP       R2,#0
V%          BEQ       compare_okay%
`          CMP       R2,R3
jR          LDMNEFD   R13!,{R0-R7,R12,PC}^; Exit quietly if not downloads folder
t(          B         compare_strings%
~.compare_okay%
�"          LDRB      R3,[R1],#1
�           CMP       R3,#�"."
�J          LDMEQFD   R13!,{R0-R7,R12,PC}^; Exit quietly if further down
�          CMP       R3,#0
�%          BNE       compare_okay%
�          :
�          MOV       R0,#3
�          MOV       R1,R6
�T          ADD       R2,R12,#256         ; workspace+256 > buffer for file header
�           MOV       R3,#1536
�          MOV       R4,#0
�H          SWI       "XOS_GBPB"          ; Get top 1536 bytes of file
          :

$          BL        add_letters%
#          ADR      R0,head_var%
#          ADD       R1,R12,#256
(           MOV       R2,#1536
2          MOV       R3,#0
<          MOV       R4,#4
F'          SWI       "XOS_SetVarVal"
P#          ADR      R0,name_var%
Z          MOV       R1,R12
d          MOV       R2,R7
n          MOV       R3,#0
x          MOV       R4,#0
�'          SWI       "XOS_SetVarVal"
�)          ADR       R0,type_callback%
�          MOV       R1,#0
�)          SWI       "XOS_AddCallBack"
�,          LDMFD     R13!,{R0-R7,R12,PC}^
�          :
�.filev%   CMP       R0,#18
�          MOVNE     PC,R14
�          CMP       R3,#27
�          �Q     PC,R14
�(          STMFD     R13!,{R0-R3,R14}
�#          SWI       "XOS_Mouse"
�           TST       R2,#%100
(          LDMFD     R13!,{R0-R3,R14}
          �QS    PC,R14
,          STMFD     R13!,{R0-R7,R12,R14}
"          SWI       &107
,!          LDR       R12,[R12]
6J          MOV       R7,R2                   ; Preserve filetype to set
@          MOV       R0,#23
J"          SWI       "XOS_File"
T          CMP       R6,R7
^S          LDMNEFD   R13!,{R0-R7,R12,PC}^    ; Return if explicitly setting type
h$          BL        add_letters%
r          MOV       R2,#0
|I.find_length_loop%                          ; Bloody OS_SetVarVal ;-)
�"          LDRB      R0,[R1,R2]
�          CMP       R0,#32
�           ADDGE     R2,R2,#1
�)          BGE       find_length_loop%
�#          ADR      R0,name_var%
�          MOV       R3,#0
�          MOV       R4,#4
�?          SWI       "XOS_SetVarVal"         ; Name variable
�)          ADR       R0,type_callback%
�          MOV       R1,#0
�)          SWI       "XOS_AddCallBack"
�,          LDMFD     R13!,{R0-R7,R12,PC}^
�          :
.type_callback%
%          STMFD     R13!,{R0,R14}
(          ADR      R0,run_type_prog%
&!          SWI       "XOS_CLI"
0%          LDMFD     R13!,{R0,PC}^
:]:�
D-ș "OS_File",10,"AutoType",&FFA,,code%,O%
N�
�
00000000  0d 00 0a 1e f4 20 53 6f  75 72 63 65 20 63 6f 64  |..... Source cod|
00000010  65 20 66 6f 72 20 41 75  74 6f 54 79 70 65 0d 00  |e for AutoType..|
00000020  14 26 f4 20 62 79 20 4d  61 74 74 68 65 77 20 42  |.&. by Matthew B|
00000030  6c 6f 63 68 2c 20 31 73  74 20 41 70 72 69 6c 20  |loch, 1st April |
00000040  31 39 39 36 0d 00 1e 05  3a 0d 00 28 1a ee 20 85  |1996....:..(.. .|
00000050  20 f6 3a f1 22 20 61 74  20 6c 69 6e 65 20 22 3b  | .:." at line ";|
00000060  9e 3a e0 0d 00 32 05 3a  0d 00 3c 0f 6c 69 6d 69  |.:...2.:..<.limi|
00000070  74 25 3d 32 30 34 38 0d  00 46 21 52 30 3d 30 3a  |t%=2048..F!R0=0:|
00000080  52 31 3d 31 3a 52 32 3d  32 3a 52 33 3d 33 3a 52  |R1=1:R2=2:R3=3:R|
00000090  34 3d 34 3a 52 35 3d 35  0d 00 50 12 de 20 63 6f  |4=4:R5=5..P.. co|
000000a0  64 65 25 20 6c 69 6d 69  74 25 0d 00 5a 16 de 20  |de% limit%..Z.. |
000000b0  63 68 65 63 6b 5f 66 61  69 6c 25 28 32 35 35 29  |check_fail%(255)|
000000c0  0d 00 64 17 e3 20 70 61  73 73 25 3d 31 32 20 b8  |..d.. pass%=12 .|
000000d0  20 31 34 20 88 20 32 0d  00 6e 26 50 25 3d 30 3a  | 14 . 2..n&P%=0:|
000000e0  4f 25 3d 63 6f 64 65 25  3a 4c 25 3d 63 6f 64 65  |O%=code%:L%=code|
000000f0  25 2b 6c 69 6d 69 74 25  3a 74 25 3d 30 0d 00 78  |%+limit%:t%=0..x|
00000100  0e 5b 4f 50 54 20 70 61  73 73 25 0d 00 82 1a 20  |.[OPT pass%.... |
00000110  20 20 20 20 20 20 20 20  20 20 45 51 55 44 20 20  |          EQUD  |
00000120  20 20 20 20 30 0d 00 8c  1e 20 20 20 20 20 20 20  |    0....       |
00000130  20 20 20 20 45 51 55 44  20 20 20 20 20 20 69 6e  |    EQUD      in|
00000140  69 74 25 0d 00 96 1f 20  20 20 20 20 20 20 20 20  |it%....         |
00000150  20 20 45 51 55 44 20 20  20 20 20 20 66 69 6e 61  |  EQUD      fina|
00000160  6c 25 0d 00 a0 1a 20 20  20 20 20 20 20 20 20 20  |l%....          |
00000170  20 45 51 55 44 20 20 20  20 20 20 30 0d 00 aa 1f  | EQUD      0....|
00000180  20 20 20 20 20 20 20 20  20 20 20 45 51 55 44 20  |           EQUD |
00000190  20 20 20 20 20 74 69 74  6c 65 25 0d 00 b4 1e 20  |     title%.... |
000001a0  20 20 20 20 20 20 20 20  20 20 45 51 55 44 20 20  |          EQUD  |
000001b0  20 20 20 20 68 65 6c 70  25 0d 00 be 1a 20 20 20  |    help%....   |
000001c0  20 20 20 20 20 20 20 20  45 51 55 44 20 20 20 20  |        EQUD    |
000001d0  20 20 30 0d 00 c8 10 20  20 20 20 20 20 20 20 20  |  0....         |
000001e0  20 20 3a 0d 00 d2 2a 2e  74 69 74 6c 65 25 20 20  |  :...*.title%  |
000001f0  20 20 45 51 55 53 20 20  20 20 20 20 22 41 75 74  |  EQUS      "Aut|
00000200  6f 54 79 70 65 22 3a 45  51 55 42 20 30 0d 00 dc  |oType":EQUB 0...|
00000210  5e 2e 68 65 6c 70 25 20  20 20 20 20 45 51 55 53  |^.help%     EQUS|
00000220  20 20 20 20 20 20 22 41  75 74 6f 54 79 70 65 22  |      "AutoType"|
00000230  3a 45 51 55 42 20 39 3a  45 51 55 42 20 39 3a 45  |:EQUB 9:EQUB 9:E|
00000240  51 55 53 20 22 31 2e 30  30 20 28 31 73 74 20 41  |QUS "1.00 (1st A|
00000250  70 72 69 6c 20 31 39 39  36 29 22 3a 45 51 55 42  |pril 1996)":EQUB|
00000260  20 31 33 3a 45 51 55 42  20 31 33 0d 00 dd 65 20  | 13:EQUB 13...e |
00000270  20 20 20 20 20 20 20 20  20 20 45 51 55 53 20 22  |          EQUS "|
00000280  54 68 69 73 20 6d 6f 64  75 6c 65 20 67 75 65 73  |This module gues|
00000290  73 65 73 20 61 74 20 66  69 6c 65 74 79 70 65 73  |ses at filetypes|
000002a0  2e 2e 2e 20 72 65 61 64  20 74 68 65 20 21 48 65  |... read the !He|
000002b0  6c 70 20 66 69 6c 65 20  66 6f 72 20 66 75 6c 6c  |lp file for full|
000002c0  20 64 65 74 61 69 6c 73  22 3a 45 51 55 42 20 30  | details":EQUB 0|
000002d0  0d 00 de 14 20 20 20 20  20 20 20 20 20 20 20 41  |....           A|
000002e0  4c 49 47 4e 0d 00 e6 2d  2e 76 61 72 76 61 6c 25  |LIGN...-.varval%|
000002f0  20 20 20 45 51 55 53 20  20 20 20 20 22 41 75 74  |   EQUS     "Aut|
00000300  6f 54 79 70 65 24 44 69  72 22 3a 45 51 55 42 20  |oType$Dir":EQUB |
00000310  30 0d 00 e7 14 20 20 20  20 20 20 20 20 20 20 20  |0....           |
00000320  41 4c 49 47 4e 0d 00 f0  27 2e 6e 61 6d 65 5f 76  |ALIGN...'.name_v|
00000330  61 72 25 20 45 51 55 53  20 20 20 20 20 22 41 75  |ar% EQUS     "Au|
00000340  74 6f 54 79 70 65 24 46  69 6c 65 22 0d 00 fa 1b  |toType$File"....|
00000350  2e 6e 61 6d 65 5f 6c 65  74 25 20 45 51 55 53 20  |.name_let% EQUS |
00000360  20 20 20 20 22 40 22 0d  00 fb 19 20 20 20 20 20  |    "@"....     |
00000370  20 20 20 20 20 20 45 51  55 42 20 20 20 20 20 30  |      EQUB     0|
00000380  0d 00 fc 14 20 20 20 20  20 20 20 20 20 20 20 41  |....           A|
00000390  4c 49 47 4e 0d 01 04 28  2e 68 65 61 64 5f 76 61  |LIGN...(.head_va|
000003a0  72 25 20 45 51 55 53 20  20 20 20 20 22 41 75 74  |r% EQUS     "Aut|
000003b0  6f 54 79 70 65 48 65 61  64 65 72 22 0d 01 0e 1b  |oTypeHeader"....|
000003c0  2e 68 65 61 64 5f 6c 65  74 25 20 45 51 55 53 20  |.head_let% EQUS |
000003d0  20 20 20 20 22 40 22 0d  01 0f 19 20 20 20 20 20  |    "@"....     |
000003e0  20 20 20 20 20 20 45 51  55 42 20 20 20 20 20 30  |      EQUB     0|
000003f0  0d 01 10 14 20 20 20 20  20 20 20 20 20 20 20 41  |....           A|
00000400  4c 49 47 4e 0d 01 18 13  2e 72 75 6e 5f 74 79 70  |LIGN.....run_typ|
00000410  65 5f 70 72 6f 67 25 0d  01 22 26 20 20 20 20 20  |e_prog%.."&     |
00000420  20 20 20 20 20 20 45 51  55 53 20 20 20 20 20 20  |      EQUS      |
00000430  22 52 75 6e 54 79 70 65  50 72 6f 67 22 0d 01 23  |"RunTypeProg"..#|
00000440  1a 20 20 20 20 20 20 20  20 20 20 20 45 51 55 42  |.           EQUB|
00000450  20 20 20 20 20 20 30 0d  01 2c 14 20 20 20 20 20  |      0..,.     |
00000460  20 20 20 20 20 20 41 4c  49 47 4e 0d 01 36 0f 20  |      ALIGN..6. |
00000470  20 20 20 20 20 20 20 20  20 3a 0d 01 40 11 2e 61  |         :..@..a|
00000480  64 64 5f 6c 65 74 74 65  72 73 25 0d 01 4a 25 20  |dd_letters%..J% |
00000490  20 20 20 20 20 20 20 20  20 53 54 4d 46 44 20 20  |         STMFD  |
000004a0  20 20 20 52 31 33 21 2c  7b 52 30 2c 52 31 34 7d  |   R13!,{R0,R14}|
000004b0  0d 01 54 24 20 20 20 20  20 20 20 20 20 20 4c 44  |..T$          LD|
000004c0  52 42 20 20 20 20 20 20  52 30 2c 68 65 61 64 5f  |RB      R0,head_|
000004d0  6c 65 74 25 0d 01 5e 20  20 20 20 20 20 20 20 20  |let%..^         |
000004e0  20 20 41 44 44 20 20 20  20 20 20 20 52 30 2c 52  |  ADD       R0,R|
000004f0  30 2c 23 31 0d 01 68 1e  20 20 20 20 20 20 20 20  |0,#1..h.        |
00000500  20 20 43 4d 50 20 20 20  20 20 20 20 52 30 2c 23  |  CMP       R0,#|
00000510  39 31 0d 01 72 1b 20 20  20 20 20 20 20 20 20 20  |91..r.          |
00000520  ec 51 20 20 20 20 20 52  30 2c 23 36 35 0d 01 7c  |.Q     R0,#65..||
00000530  24 20 20 20 20 20 20 20  20 20 20 53 54 52 42 20  |$          STRB |
00000540  20 20 20 20 20 52 30 2c  68 65 61 64 5f 6c 65 74  |     R0,head_let|
00000550  25 0d 01 86 24 20 20 20  20 20 20 20 20 20 20 53  |%...$          S|
00000560  54 52 42 20 20 20 20 20  20 52 30 2c 6e 61 6d 65  |TRB      R0,name|
00000570  5f 6c 65 74 25 0d 01 90  25 20 20 20 20 20 20 20  |_let%...%       |
00000580  20 20 20 4c 44 4d 46 44  20 20 20 20 20 52 31 33  |   LDMFD     R13|
00000590  21 2c 7b 52 30 2c 50 43  7d 5e 0d 01 9a 0f 20 20  |!,{R0,PC}^....  |
000005a0  20 20 20 20 20 20 20 20  3a 0d 01 a4 22 2e 69 6e  |        :...".in|
000005b0  69 74 25 20 20 20 20 53  54 4d 46 44 20 20 20 20  |it%    STMFD    |
000005c0  20 52 31 33 21 2c 7b 52  31 34 7d 0d 01 ae 3c 20  | R13!,{R14}...< |
000005d0  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
000005e0  20 20 20 52 30 2c 23 26  44 20 20 20 20 20 20 20  |   R0,#&D       |
000005f0  20 20 20 20 20 20 20 3b  20 4f 53 5f 46 69 6e 64  |       ; OS_Find|
00000600  20 76 65 63 74 6f 72 0d  01 b8 21 20 20 20 20 20  | vector...!     |
00000610  20 20 20 20 20 41 44 52  20 20 20 20 20 20 20 52  |     ADR       R|
00000620  31 2c 66 69 6e 64 76 25  0d 01 c2 1e 20 20 20 20  |1,findv%....    |
00000630  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 20 20  |      MOV       |
00000640  52 32 2c 52 31 32 0d 01  cc 23 20 20 20 20 20 20  |R2,R12...#      |
00000650  20 20 20 20 53 57 49 20  20 20 20 20 20 20 22 58  |    SWI       "X|
00000660  4f 53 5f 43 6c 61 69 6d  22 0d 01 d6 3c 20 20 20  |OS_Claim"...<   |
00000670  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 20  |       MOV      |
00000680  20 52 30 2c 23 26 38 20  20 20 20 20 20 20 20 20  | R0,#&8         |
00000690  20 20 20 20 20 3b 20 4f  53 5f 46 69 6c 65 20 76  |     ; OS_File v|
000006a0  65 63 74 6f 72 0d 01 e0  21 20 20 20 20 20 20 20  |ector...!       |
000006b0  20 20 20 41 44 52 20 20  20 20 20 20 20 52 31 2c  |   ADR       R1,|
000006c0  66 69 6c 65 76 25 0d 01  ea 1e 20 20 20 20 20 20  |filev%....      |
000006d0  20 20 20 20 4d 4f 56 20  20 20 20 20 20 20 52 32  |    MOV       R2|
000006e0  2c 52 31 32 0d 01 f4 23  20 20 20 20 20 20 20 20  |,R12...#        |
000006f0  20 20 53 57 49 20 20 20  20 20 20 20 22 58 4f 53  |  SWI       "XOS|
00000700  5f 43 6c 61 69 6d 22 0d  01 fe 23 20 20 20 20 20  |_Claim"...#     |
00000710  20 20 20 20 20 42 56 53  20 20 20 20 20 20 20 69  |     BVS       i|
00000720  6e 69 74 5f 65 72 72 6f  72 25 0d 02 08 1d 20 20  |nit_error%....  |
00000730  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
00000740  20 20 52 30 2c 23 36 0d  02 12 20 20 20 20 20 20  |  R0,#6...      |
00000750  20 20 20 20 20 4d 4f 56  20 20 20 20 20 20 20 52  |     MOV       R|
00000760  33 2c 23 32 30 34 38 0d  02 1c 24 20 20 20 20 20  |3,#2048...$     |
00000770  20 20 20 20 20 53 57 49  20 20 20 20 20 20 20 22  |     SWI       "|
00000780  58 4f 53 5f 4d 6f 64 75  6c 65 22 0d 02 26 23 20  |XOS_Module"..&# |
00000790  20 20 20 20 20 20 20 20  20 42 56 53 20 20 20 20  |         BVS    |
000007a0  20 20 20 69 6e 69 74 5f  65 72 72 6f 72 25 0d 02  |   init_error%..|
000007b0  30 20 20 20 20 20 20 20  20 20 20 20 53 54 52 20  |0           STR |
000007c0  20 20 20 20 20 20 52 32  2c 5b 52 31 32 5d 0d 02  |      R2,[R12]..|
000007d0  3a 10 2e 69 6e 69 74 5f  65 72 72 6f 72 25 0d 02  |:..init_error%..|
000007e0  44 21 20 20 20 20 20 20  20 20 20 20 4c 44 4d 46  |D!          LDMF|
000007f0  44 20 20 20 20 20 52 31  33 21 2c 7b 50 43 7d 0d  |D     R13!,{PC}.|
00000800  02 4e 0f 20 20 20 20 20  20 20 20 20 20 3a 0d 02  |.N.          :..|
00000810  58 22 2e 66 69 6e 61 6c  25 20 20 20 53 54 4d 46  |X".final%   STMF|
00000820  44 20 20 20 20 20 52 31  33 21 2c 7b 52 31 34 7d  |D     R13!,{R14}|
00000830  0d 02 62 1e 20 20 20 20  20 20 20 20 20 20 4d 4f  |..b.          MO|
00000840  56 20 20 20 20 20 20 20  52 30 2c 23 26 44 0d 02  |V       R0,#&D..|
00000850  6c 21 20 20 20 20 20 20  20 20 20 20 41 44 52 20  |l!          ADR |
00000860  20 20 20 20 20 20 52 31  2c 66 69 6e 64 76 25 0d  |      R1,findv%.|
00000870  02 76 1e 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |.v.          MOV|
00000880  20 20 20 20 20 20 20 52  32 2c 52 31 32 0d 02 80  |       R2,R12...|
00000890  25 20 20 20 20 20 20 20  20 20 20 53 57 49 20 20  |%          SWI  |
000008a0  20 20 20 20 20 22 58 4f  53 5f 52 65 6c 65 61 73  |     "XOS_Releas|
000008b0  65 22 0d 02 8a 24 20 20  20 20 20 20 20 20 20 20  |e"...$          |
000008c0  42 56 53 20 20 20 20 20  20 20 66 69 6e 61 6c 5f  |BVS       final_|
000008d0  65 72 72 6f 72 25 0d 02  94 1e 20 20 20 20 20 20  |error%....      |
000008e0  20 20 20 20 4d 4f 56 20  20 20 20 20 20 20 52 30  |    MOV       R0|
000008f0  2c 23 26 38 0d 02 9e 21  20 20 20 20 20 20 20 20  |,#&8...!        |
00000900  20 20 41 44 52 20 20 20  20 20 20 20 52 31 2c 66  |  ADR       R1,f|
00000910  69 6c 65 76 25 0d 02 a8  1e 20 20 20 20 20 20 20  |ilev%....       |
00000920  20 20 20 4d 4f 56 20 20  20 20 20 20 20 52 32 2c  |   MOV       R2,|
00000930  52 31 32 0d 02 b2 25 20  20 20 20 20 20 20 20 20  |R12...%         |
00000940  20 53 57 49 20 20 20 20  20 20 20 22 58 4f 53 5f  | SWI       "XOS_|
00000950  52 65 6c 65 61 73 65 22  0d 02 bc 24 20 20 20 20  |Release"...$    |
00000960  20 20 20 20 20 20 42 56  53 20 20 20 20 20 20 20  |      BVS       |
00000970  66 69 6e 61 6c 5f 65 72  72 6f 72 25 0d 02 c6 1d  |final_error%....|
00000980  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00000990  20 20 20 20 52 30 2c 23  37 0d 02 d0 20 20 20 20  |    R0,#7...    |
000009a0  20 20 20 20 20 20 20 4c  44 52 20 20 20 20 20 20  |       LDR      |
000009b0  20 52 32 2c 5b 52 31 32  5d 0d 02 da 24 20 20 20  | R2,[R12]...$   |
000009c0  20 20 20 20 20 20 20 53  57 49 20 20 20 20 20 20  |       SWI      |
000009d0  20 22 58 4f 53 5f 4d 6f  64 75 6c 65 22 0d 02 e4  | "XOS_Module"...|
000009e0  24 20 20 20 20 20 20 20  20 20 20 42 56 53 20 20  |$          BVS  |
000009f0  20 20 20 20 20 66 69 6e  61 6c 5f 65 72 72 6f 72  |     final_error|
00000a00  25 0d 02 ee 11 2e 66 69  6e 61 6c 5f 65 72 72 6f  |%.....final_erro|
00000a10  72 25 0d 02 f8 21 20 20  20 20 20 20 20 20 20 20  |r%...!          |
00000a20  4c 44 4d 46 44 20 20 20  20 20 52 31 33 21 2c 7b  |LDMFD     R13!,{|
00000a30  50 43 7d 0d 03 02 0f 20  20 20 20 20 20 20 20 20  |PC}....         |
00000a40  20 3a 0d 03 0c 1d 2e 66  69 6e 64 76 25 20 20 20  | :.....findv%   |
00000a50  43 4d 50 20 20 20 20 20  20 20 52 30 2c 23 30 0d  |CMP       R0,#0.|
00000a60  03 16 49 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |..I          MOV|
00000a70  4e 45 53 20 20 20 20 50  43 2c 52 31 34 20 20 20  |NES    PC,R14   |
00000a80  20 20 20 20 20 20 20 20  20 20 20 3b 20 52 65 61  |           ; Rea|
00000a90  73 6f 6e 20 63 6f 64 65  20 30 20 3d 20 63 6c 6f  |son code 0 = clo|
00000aa0  73 65 20 66 69 6c 65 73  0d 03 20 1e 20 20 20 20  |se files.. .    |
00000ab0  20 20 20 20 20 20 43 4d  50 20 20 20 20 20 20 20  |      CMP       |
00000ac0  52 32 2c 23 32 37 0d 03  2a 1b 20 20 20 20 20 20  |R2,#27..*.      |
00000ad0  20 20 20 20 ec 51 53 20  20 20 20 50 43 2c 52 31  |    .QS    PC,R1|
00000ae0  34 0d 03 34 2c 20 20 20  20 20 20 20 20 20 20 53  |4..4,          S|
00000af0  54 4d 46 44 20 20 20 20  20 52 31 33 21 2c 7b 52  |TMFD     R13!,{R|
00000b00  30 2d 52 37 2c 52 31 32  2c 52 31 34 7d 0d 03 3e  |0-R7,R12,R14}..>|
00000b10  21 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |!          LDR  |
00000b20  20 20 20 20 20 52 31 32  2c 5b 52 31 32 5d 0d 03  |     R12,[R12]..|
00000b30  48 44 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |HD          MOV |
00000b40  20 20 20 20 20 20 52 36  2c 52 31 20 20 20 20 20  |      R6,R1     |
00000b50  20 20 20 20 20 20 20 20  20 20 3b 20 4b 65 65 70  |          ; Keep|
00000b60  20 66 69 6c 65 20 68 61  6e 64 6c 65 20 69 6e 20  | file handle in |
00000b70  52 36 0d 03 52 1d 20 20  20 20 20 20 20 20 20 20  |R6..R.          |
00000b80  4d 4f 56 20 20 20 20 20  20 20 52 30 2c 23 37 0d  |MOV       R0,#7.|
00000b90  03 5c 50 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |.\P          MOV|
00000ba0  20 20 20 20 20 20 20 52  32 2c 52 31 32 20 20 20  |       R2,R12   |
00000bb0  20 20 20 20 20 20 20 20  20 20 20 3b 20 77 6f 72  |           ; wor|
00000bc0  6b 73 70 61 63 65 2b 30  20 3e 20 6e 61 6d 65 20  |kspace+0 > name |
00000bd0  62 75 66 66 65 72 20 66  6f 72 20 66 69 6c 65 0d  |buffer for file.|
00000be0  03 66 1f 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |.f.          MOV|
00000bf0  20 20 20 20 20 20 20 52  35 2c 23 32 35 36 0d 03  |       R5,#256..|
00000c00  70 46 20 20 20 20 20 20  20 20 20 20 53 57 49 20  |pF          SWI |
00000c10  20 20 20 20 20 20 22 58  4f 53 5f 41 72 67 73 22  |      "XOS_Args"|
00000c20  20 20 20 20 20 20 20 20  20 20 3b 20 47 65 74 20  |          ; Get |
00000c30  66 69 6c 65 6e 61 6d 65  20 66 72 6f 6d 20 68 61  |filename from ha|
00000c40  6e 64 6c 65 0d 03 7a 1d  20 20 20 20 20 20 20 20  |ndle..z.        |
00000c50  20 20 4d 4f 56 20 20 20  20 20 20 20 52 37 2c 52  |  MOV       R7,R|
00000c60  35 0d 03 84 1f 20 20 20  20 20 20 20 20 20 20 4d  |5....          M|
00000c70  4f 56 20 20 20 20 20 20  20 52 30 2c 23 32 35 34  |OV       R0,#254|
00000c80  0d 03 8e 1d 20 20 20 20  20 20 20 20 20 20 4d 4f  |....          MO|
00000c90  56 20 20 20 20 20 20 20  52 31 2c 52 36 0d 03 98  |V       R1,R6...|
00000ca0  22 20 20 20 20 20 20 20  20 20 20 53 57 49 20 20  |"          SWI  |
00000cb0  20 20 20 20 20 22 58 4f  53 5f 41 72 67 73 22 0d  |     "XOS_Args".|
00000cc0  03 a2 23 20 20 20 20 20  20 20 20 20 20 54 53 54  |..#          TST|
00000cd0  20 20 20 20 20 20 20 52  32 2c 23 25 31 30 30 30  |       R2,#%1000|
00000ce0  30 30 0d 03 ac 44 20 20  20 20 20 20 20 20 20 20  |00...D          |
00000cf0  4c 44 4d 4e 45 46 44 20  20 20 52 31 33 21 2c 7b  |LDMNEFD   R13!,{|
00000d00  52 30 2d 52 37 2c 52 31  32 2c 50 43 7d 5e 20 20  |R0-R7,R12,PC}^  |
00000d10  3b 20 43 61 6e 27 74 20  62 65 20 61 20 64 69 72  |; Can't be a dir|
00000d20  65 63 74 6f 72 79 0d 03  b6 0f 20 20 20 20 20 20  |ectory....      |
00000d30  20 20 20 20 3a 0d 03 c0  21 20 20 20 20 20 20 20  |    :...!       |
00000d40  20 20 20 41 44 52 20 20  20 20 20 20 52 30 2c 76  |   ADR      R0,v|
00000d50  61 72 76 61 6c 25 0d 03  ca 53 20 20 20 20 20 20  |arval%...S      |
00000d60  20 20 20 20 41 44 44 20  20 20 20 20 20 20 52 31  |    ADD       R1|
00000d70  2c 52 31 32 2c 23 32 35  36 20 20 20 20 20 20 20  |,R12,#256       |
00000d80  20 20 3b 20 77 6f 72 6b  73 70 61 63 65 2b 32 35  |  ; workspace+25|
00000d90  36 20 3e 20 64 6f 77 6e  6c 6f 61 64 73 20 66 6f  |6 > downloads fo|
00000da0  6c 64 65 72 20 6e 61 6d  65 0d 03 d4 1f 20 20 20  |lder name....   |
00000db0  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 20  |       MOV      |
00000dc0  20 52 32 2c 23 32 35 36  0d 03 de 1d 20 20 20 20  | R2,#256....    |
00000dd0  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 20 20  |      MOV       |
00000de0  52 33 2c 23 30 0d 03 e8  53 20 20 20 20 20 20 20  |R3,#0...S       |
00000df0  20 20 20 53 57 49 20 20  20 20 20 20 20 22 58 4f  |   SWI       "XO|
00000e00  53 5f 52 65 61 64 56 61  72 56 61 6c 22 20 20 20  |S_ReadVarVal"   |
00000e10  20 3b 20 47 65 74 20 64  6f 77 6e 6c 6f 61 64 73  | ; Get downloads|
00000e20  20 66 6f 6c 64 65 72 20  6e 61 6d 65 20 66 72 6f  | folder name fro|
00000e30  6d 20 73 79 73 76 61 72  0d 03 f2 1d 20 20 20 20  |m sysvar....    |
00000e40  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 20 20  |      MOV       |
00000e50  52 30 2c 23 30 0d 03 fc  22 20 20 20 20 20 20 20  |R0,#0..."       |
00000e60  20 20 20 53 54 52 42 20  20 20 20 20 20 52 30 2c  |   STRB      R0,|
00000e70  5b 52 31 2c 52 32 5d 0d  04 06 4e 20 20 20 20 20  |[R1,R2]...N     |
00000e80  20 20 20 20 20 4c 44 4d  56 53 46 44 20 20 20 52  |     LDMVSFD   R|
00000e90  31 33 21 2c 7b 52 30 2d  52 37 2c 52 31 32 2c 50  |13!,{R0-R7,R12,P|
00000ea0  43 7d 5e 3b 20 45 78 69  74 20 71 75 69 65 74 6c  |C}^; Exit quietl|
00000eb0  79 20 69 66 20 76 61 72  69 61 62 6c 65 20 6e 6f  |y if variable no|
00000ec0  74 20 73 65 74 0d 04 10  0f 20 20 20 20 20 20 20  |t set....       |
00000ed0  20 20 20 3a 0d 04 1a 1e  20 20 20 20 20 20 20 20  |   :....        |
00000ee0  20 20 4d 4f 56 20 20 20  20 20 20 20 52 31 2c 52  |  MOV       R1,R|
00000ef0  31 32 0d 04 24 22 20 20  20 20 20 20 20 20 20 20  |12..$"          |
00000f00  41 44 44 20 20 20 20 20  20 20 52 30 2c 52 31 2c  |ADD       R0,R1,|
00000f10  23 32 35 36 0d 04 2e 15  2e 63 6f 6d 70 61 72 65  |#256.....compare|
00000f20  5f 73 74 72 69 6e 67 73  25 0d 04 38 22 20 20 20  |_strings%..8"   |
00000f30  20 20 20 20 20 20 20 4c  44 52 42 20 20 20 20 20  |       LDRB     |
00000f40  20 52 32 2c 5b 52 30 5d  2c 23 31 0d 04 42 22 20  | R2,[R0],#1..B" |
00000f50  20 20 20 20 20 20 20 20  20 4c 44 52 42 20 20 20  |         LDRB   |
00000f60  20 20 20 52 33 2c 5b 52  31 5d 2c 23 31 0d 04 4c  |   R3,[R1],#1..L|
00000f70  1d 20 20 20 20 20 20 20  20 20 20 43 4d 50 20 20  |.          CMP  |
00000f80  20 20 20 20 20 52 32 2c  23 30 0d 04 56 25 20 20  |     R2,#0..V%  |
00000f90  20 20 20 20 20 20 20 20  42 45 51 20 20 20 20 20  |        BEQ     |
00000fa0  20 20 63 6f 6d 70 61 72  65 5f 6f 6b 61 79 25 0d  |  compare_okay%.|
00000fb0  04 60 1d 20 20 20 20 20  20 20 20 20 20 43 4d 50  |.`.          CMP|
00000fc0  20 20 20 20 20 20 20 52  32 2c 52 33 0d 04 6a 52  |       R2,R3..jR|
00000fd0  20 20 20 20 20 20 20 20  20 20 4c 44 4d 4e 45 46  |          LDMNEF|
00000fe0  44 20 20 20 52 31 33 21  2c 7b 52 30 2d 52 37 2c  |D   R13!,{R0-R7,|
00000ff0  52 31 32 2c 50 43 7d 5e  3b 20 45 78 69 74 20 71  |R12,PC}^; Exit q|
00001000  75 69 65 74 6c 79 20 69  66 20 6e 6f 74 20 64 6f  |uietly if not do|
00001010  77 6e 6c 6f 61 64 73 20  66 6f 6c 64 65 72 0d 04  |wnloads folder..|
00001020  74 28 20 20 20 20 20 20  20 20 20 20 42 20 20 20  |t(          B   |
00001030  20 20 20 20 20 20 63 6f  6d 70 61 72 65 5f 73 74  |      compare_st|
00001040  72 69 6e 67 73 25 0d 04  7e 12 2e 63 6f 6d 70 61  |rings%..~..compa|
00001050  72 65 5f 6f 6b 61 79 25  0d 04 88 22 20 20 20 20  |re_okay%..."    |
00001060  20 20 20 20 20 20 4c 44  52 42 20 20 20 20 20 20  |      LDRB      |
00001070  52 33 2c 5b 52 31 5d 2c  23 31 0d 04 92 20 20 20  |R3,[R1],#1...   |
00001080  20 20 20 20 20 20 20 20  43 4d 50 20 20 20 20 20  |        CMP     |
00001090  20 20 52 33 2c 23 97 22  2e 22 0d 04 9c 4a 20 20  |  R3,#."."...J  |
000010a0  20 20 20 20 20 20 20 20  4c 44 4d 45 51 46 44 20  |        LDMEQFD |
000010b0  20 20 52 31 33 21 2c 7b  52 30 2d 52 37 2c 52 31  |  R13!,{R0-R7,R1|
000010c0  32 2c 50 43 7d 5e 3b 20  45 78 69 74 20 71 75 69  |2,PC}^; Exit qui|
000010d0  65 74 6c 79 20 69 66 20  66 75 72 74 68 65 72 20  |etly if further |
000010e0  64 6f 77 6e 0d 04 a6 1d  20 20 20 20 20 20 20 20  |down....        |
000010f0  20 20 43 4d 50 20 20 20  20 20 20 20 52 33 2c 23  |  CMP       R3,#|
00001100  30 0d 04 b0 25 20 20 20  20 20 20 20 20 20 20 42  |0...%          B|
00001110  4e 45 20 20 20 20 20 20  20 63 6f 6d 70 61 72 65  |NE       compare|
00001120  5f 6f 6b 61 79 25 0d 04  ba 0f 20 20 20 20 20 20  |_okay%....      |
00001130  20 20 20 20 3a 0d 04 c4  1d 20 20 20 20 20 20 20  |    :....       |
00001140  20 20 20 4d 4f 56 20 20  20 20 20 20 20 52 30 2c  |   MOV       R0,|
00001150  23 33 0d 04 ce 1d 20 20  20 20 20 20 20 20 20 20  |#3....          |
00001160  4d 4f 56 20 20 20 20 20  20 20 52 31 2c 52 36 0d  |MOV       R1,R6.|
00001170  04 d8 54 20 20 20 20 20  20 20 20 20 20 41 44 44  |..T          ADD|
00001180  20 20 20 20 20 20 20 52  32 2c 52 31 32 2c 23 32  |       R2,R12,#2|
00001190  35 36 20 20 20 20 20 20  20 20 20 3b 20 77 6f 72  |56         ; wor|
000011a0  6b 73 70 61 63 65 2b 32  35 36 20 3e 20 62 75 66  |kspace+256 > buf|
000011b0  66 65 72 20 66 6f 72 20  66 69 6c 65 20 68 65 61  |fer for file hea|
000011c0  64 65 72 0d 04 e2 20 20  20 20 20 20 20 20 20 20  |der...          |
000011d0  20 4d 4f 56 20 20 20 20  20 20 20 52 33 2c 23 31  | MOV       R3,#1|
000011e0  35 33 36 0d 04 ec 1d 20  20 20 20 20 20 20 20 20  |536....         |
000011f0  20 4d 4f 56 20 20 20 20  20 20 20 52 34 2c 23 30  | MOV       R4,#0|
00001200  0d 04 f6 48 20 20 20 20  20 20 20 20 20 20 53 57  |...H          SW|
00001210  49 20 20 20 20 20 20 20  22 58 4f 53 5f 47 42 50  |I       "XOS_GBP|
00001220  42 22 20 20 20 20 20 20  20 20 20 20 3b 20 47 65  |B"          ; Ge|
00001230  74 20 74 6f 70 20 31 35  33 36 20 62 79 74 65 73  |t top 1536 bytes|
00001240  20 6f 66 20 66 69 6c 65  0d 05 00 0f 20 20 20 20  | of file....    |
00001250  20 20 20 20 20 20 3a 0d  05 0a 24 20 20 20 20 20  |      :...$     |
00001260  20 20 20 20 20 42 4c 20  20 20 20 20 20 20 20 61  |     BL        a|
00001270  64 64 5f 6c 65 74 74 65  72 73 25 0d 05 14 23 20  |dd_letters%...# |
00001280  20 20 20 20 20 20 20 20  20 41 44 52 20 20 20 20  |         ADR    |
00001290  20 20 52 30 2c 68 65 61  64 5f 76 61 72 25 0d 05  |  R0,head_var%..|
000012a0  1e 23 20 20 20 20 20 20  20 20 20 20 41 44 44 20  |.#          ADD |
000012b0  20 20 20 20 20 20 52 31  2c 52 31 32 2c 23 32 35  |      R1,R12,#25|
000012c0  36 0d 05 28 20 20 20 20  20 20 20 20 20 20 20 4d  |6..(           M|
000012d0  4f 56 20 20 20 20 20 20  20 52 32 2c 23 31 35 33  |OV       R2,#153|
000012e0  36 0d 05 32 1d 20 20 20  20 20 20 20 20 20 20 4d  |6..2.          M|
000012f0  4f 56 20 20 20 20 20 20  20 52 33 2c 23 30 0d 05  |OV       R3,#0..|
00001300  3c 1d 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |<.          MOV |
00001310  20 20 20 20 20 20 52 34  2c 23 34 0d 05 46 27 20  |      R4,#4..F' |
00001320  20 20 20 20 20 20 20 20  20 53 57 49 20 20 20 20  |         SWI    |
00001330  20 20 20 22 58 4f 53 5f  53 65 74 56 61 72 56 61  |   "XOS_SetVarVa|
00001340  6c 22 0d 05 50 23 20 20  20 20 20 20 20 20 20 20  |l"..P#          |
00001350  41 44 52 20 20 20 20 20  20 52 30 2c 6e 61 6d 65  |ADR      R0,name|
00001360  5f 76 61 72 25 0d 05 5a  1e 20 20 20 20 20 20 20  |_var%..Z.       |
00001370  20 20 20 4d 4f 56 20 20  20 20 20 20 20 52 31 2c  |   MOV       R1,|
00001380  52 31 32 0d 05 64 1d 20  20 20 20 20 20 20 20 20  |R12..d.         |
00001390  20 4d 4f 56 20 20 20 20  20 20 20 52 32 2c 52 37  | MOV       R2,R7|
000013a0  0d 05 6e 1d 20 20 20 20  20 20 20 20 20 20 4d 4f  |..n.          MO|
000013b0  56 20 20 20 20 20 20 20  52 33 2c 23 30 0d 05 78  |V       R3,#0..x|
000013c0  1d 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |.          MOV  |
000013d0  20 20 20 20 20 52 34 2c  23 30 0d 05 82 27 20 20  |     R4,#0...'  |
000013e0  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 20  |        SWI     |
000013f0  20 20 22 58 4f 53 5f 53  65 74 56 61 72 56 61 6c  |  "XOS_SetVarVal|
00001400  22 0d 05 8c 29 20 20 20  20 20 20 20 20 20 20 41  |"...)          A|
00001410  44 52 20 20 20 20 20 20  20 52 30 2c 74 79 70 65  |DR       R0,type|
00001420  5f 63 61 6c 6c 62 61 63  6b 25 0d 05 96 1d 20 20  |_callback%....  |
00001430  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
00001440  20 20 52 31 2c 23 30 0d  05 a0 29 20 20 20 20 20  |  R1,#0...)     |
00001450  20 20 20 20 20 53 57 49  20 20 20 20 20 20 20 22  |     SWI       "|
00001460  58 4f 53 5f 41 64 64 43  61 6c 6c 42 61 63 6b 22  |XOS_AddCallBack"|
00001470  0d 05 aa 2c 20 20 20 20  20 20 20 20 20 20 4c 44  |...,          LD|
00001480  4d 46 44 20 20 20 20 20  52 31 33 21 2c 7b 52 30  |MFD     R13!,{R0|
00001490  2d 52 37 2c 52 31 32 2c  50 43 7d 5e 0d 05 b4 0f  |-R7,R12,PC}^....|
000014a0  20 20 20 20 20 20 20 20  20 20 3a 0d 05 be 1e 2e  |          :.....|
000014b0  66 69 6c 65 76 25 20 20  20 43 4d 50 20 20 20 20  |filev%   CMP    |
000014c0  20 20 20 52 30 2c 23 31  38 0d 05 c8 1e 20 20 20  |   R0,#18....   |
000014d0  20 20 20 20 20 20 20 4d  4f 56 4e 45 20 20 20 20  |       MOVNE    |
000014e0  20 50 43 2c 52 31 34 0d  05 d2 1e 20 20 20 20 20  | PC,R14....     |
000014f0  20 20 20 20 20 43 4d 50  20 20 20 20 20 20 20 52  |     CMP       R|
00001500  33 2c 23 32 37 0d 05 dc  1b 20 20 20 20 20 20 20  |3,#27....       |
00001510  20 20 20 ec 51 20 20 20  20 20 50 43 2c 52 31 34  |   .Q     PC,R14|
00001520  0d 05 e6 28 20 20 20 20  20 20 20 20 20 20 53 54  |...(          ST|
00001530  4d 46 44 20 20 20 20 20  52 31 33 21 2c 7b 52 30  |MFD     R13!,{R0|
00001540  2d 52 33 2c 52 31 34 7d  0d 05 f0 23 20 20 20 20  |-R3,R14}...#    |
00001550  20 20 20 20 20 20 53 57  49 20 20 20 20 20 20 20  |      SWI       |
00001560  22 58 4f 53 5f 4d 6f 75  73 65 22 0d 05 fa 20 20  |"XOS_Mouse"...  |
00001570  20 20 20 20 20 20 20 20  20 54 53 54 20 20 20 20  |         TST    |
00001580  20 20 20 52 32 2c 23 25  31 30 30 0d 06 04 28 20  |   R2,#%100...( |
00001590  20 20 20 20 20 20 20 20  20 4c 44 4d 46 44 20 20  |         LDMFD  |
000015a0  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 33 2c 52  |   R13!,{R0-R3,R|
000015b0  31 34 7d 0d 06 0e 1b 20  20 20 20 20 20 20 20 20  |14}....         |
000015c0  20 ec 51 53 20 20 20 20  50 43 2c 52 31 34 0d 06  | .QS    PC,R14..|
000015d0  18 2c 20 20 20 20 20 20  20 20 20 20 53 54 4d 46  |.,          STMF|
000015e0  44 20 20 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |D     R13!,{R0-R|
000015f0  37 2c 52 31 32 2c 52 31  34 7d 0d 06 22 1c 20 20  |7,R12,R14}..".  |
00001600  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 20  |        SWI     |
00001610  20 20 26 31 30 37 0d 06  2c 21 20 20 20 20 20 20  |  &107..,!      |
00001620  20 20 20 20 4c 44 52 20  20 20 20 20 20 20 52 31  |    LDR       R1|
00001630  32 2c 5b 52 31 32 5d 0d  06 36 4a 20 20 20 20 20  |2,[R12]..6J     |
00001640  20 20 20 20 20 4d 4f 56  20 20 20 20 20 20 20 52  |     MOV       R|
00001650  37 2c 52 32 20 20 20 20  20 20 20 20 20 20 20 20  |7,R2            |
00001660  20 20 20 20 20 20 20 3b  20 50 72 65 73 65 72 76  |       ; Preserv|
00001670  65 20 66 69 6c 65 74 79  70 65 20 74 6f 20 73 65  |e filetype to se|
00001680  74 0d 06 40 1e 20 20 20  20 20 20 20 20 20 20 4d  |t..@.          M|
00001690  4f 56 20 20 20 20 20 20  20 52 30 2c 23 32 33 0d  |OV       R0,#23.|
000016a0  06 4a 22 20 20 20 20 20  20 20 20 20 20 53 57 49  |.J"          SWI|
000016b0  20 20 20 20 20 20 20 22  58 4f 53 5f 46 69 6c 65  |       "XOS_File|
000016c0  22 0d 06 54 1d 20 20 20  20 20 20 20 20 20 20 43  |"..T.          C|
000016d0  4d 50 20 20 20 20 20 20  20 52 36 2c 52 37 0d 06  |MP       R6,R7..|
000016e0  5e 53 20 20 20 20 20 20  20 20 20 20 4c 44 4d 4e  |^S          LDMN|
000016f0  45 46 44 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |EFD   R13!,{R0-R|
00001700  37 2c 52 31 32 2c 50 43  7d 5e 20 20 20 20 3b 20  |7,R12,PC}^    ; |
00001710  52 65 74 75 72 6e 20 69  66 20 65 78 70 6c 69 63  |Return if explic|
00001720  69 74 6c 79 20 73 65 74  74 69 6e 67 20 74 79 70  |itly setting typ|
00001730  65 0d 06 68 24 20 20 20  20 20 20 20 20 20 20 42  |e..h$          B|
00001740  4c 20 20 20 20 20 20 20  20 61 64 64 5f 6c 65 74  |L        add_let|
00001750  74 65 72 73 25 0d 06 72  1d 20 20 20 20 20 20 20  |ters%..r.       |
00001760  20 20 20 4d 4f 56 20 20  20 20 20 20 20 52 32 2c  |   MOV       R2,|
00001770  23 30 0d 06 7c 49 2e 66  69 6e 64 5f 6c 65 6e 67  |#0..|I.find_leng|
00001780  74 68 5f 6c 6f 6f 70 25  20 20 20 20 20 20 20 20  |th_loop%        |
00001790  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000017a0  20 20 3b 20 42 6c 6f 6f  64 79 20 4f 53 5f 53 65  |  ; Bloody OS_Se|
000017b0  74 56 61 72 56 61 6c 20  3b 2d 29 0d 06 86 22 20  |tVarVal ;-)..." |
000017c0  20 20 20 20 20 20 20 20  20 4c 44 52 42 20 20 20  |         LDRB   |
000017d0  20 20 20 52 30 2c 5b 52  31 2c 52 32 5d 0d 06 90  |   R0,[R1,R2]...|
000017e0  1e 20 20 20 20 20 20 20  20 20 20 43 4d 50 20 20  |.          CMP  |
000017f0  20 20 20 20 20 52 30 2c  23 33 32 0d 06 9a 20 20  |     R0,#32...  |
00001800  20 20 20 20 20 20 20 20  20 41 44 44 47 45 20 20  |         ADDGE  |
00001810  20 20 20 52 32 2c 52 32  2c 23 31 0d 06 a4 29 20  |   R2,R2,#1...) |
00001820  20 20 20 20 20 20 20 20  20 42 47 45 20 20 20 20  |         BGE    |
00001830  20 20 20 66 69 6e 64 5f  6c 65 6e 67 74 68 5f 6c  |   find_length_l|
00001840  6f 6f 70 25 0d 06 ae 23  20 20 20 20 20 20 20 20  |oop%...#        |
00001850  20 20 41 44 52 20 20 20  20 20 20 52 30 2c 6e 61  |  ADR      R0,na|
00001860  6d 65 5f 76 61 72 25 0d  06 b8 1d 20 20 20 20 20  |me_var%....     |
00001870  20 20 20 20 20 4d 4f 56  20 20 20 20 20 20 20 52  |     MOV       R|
00001880  33 2c 23 30 0d 06 c2 1d  20 20 20 20 20 20 20 20  |3,#0....        |
00001890  20 20 4d 4f 56 20 20 20  20 20 20 20 52 34 2c 23  |  MOV       R4,#|
000018a0  34 0d 06 cc 3f 20 20 20  20 20 20 20 20 20 20 53  |4...?          S|
000018b0  57 49 20 20 20 20 20 20  20 22 58 4f 53 5f 53 65  |WI       "XOS_Se|
000018c0  74 56 61 72 56 61 6c 22  20 20 20 20 20 20 20 20  |tVarVal"        |
000018d0  20 3b 20 4e 61 6d 65 20  76 61 72 69 61 62 6c 65  | ; Name variable|
000018e0  0d 06 d6 29 20 20 20 20  20 20 20 20 20 20 41 44  |...)          AD|
000018f0  52 20 20 20 20 20 20 20  52 30 2c 74 79 70 65 5f  |R       R0,type_|
00001900  63 61 6c 6c 62 61 63 6b  25 0d 06 e0 1d 20 20 20  |callback%....   |
00001910  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 20  |       MOV      |
00001920  20 52 31 2c 23 30 0d 06  ea 29 20 20 20 20 20 20  | R1,#0...)      |
00001930  20 20 20 20 53 57 49 20  20 20 20 20 20 20 22 58  |    SWI       "X|
00001940  4f 53 5f 41 64 64 43 61  6c 6c 42 61 63 6b 22 0d  |OS_AddCallBack".|
00001950  06 f4 2c 20 20 20 20 20  20 20 20 20 20 4c 44 4d  |..,          LDM|
00001960  46 44 20 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |FD     R13!,{R0-|
00001970  52 37 2c 52 31 32 2c 50  43 7d 5e 0d 06 fe 0f 20  |R7,R12,PC}^.... |
00001980  20 20 20 20 20 20 20 20  20 3a 0d 07 08 13 2e 74  |         :.....t|
00001990  79 70 65 5f 63 61 6c 6c  62 61 63 6b 25 0d 07 12  |ype_callback%...|
000019a0  25 20 20 20 20 20 20 20  20 20 20 53 54 4d 46 44  |%          STMFD|
000019b0  20 20 20 20 20 52 31 33  21 2c 7b 52 30 2c 52 31  |     R13!,{R0,R1|
000019c0  34 7d 0d 07 1c 28 20 20  20 20 20 20 20 20 20 20  |4}...(          |
000019d0  41 44 52 20 20 20 20 20  20 52 30 2c 72 75 6e 5f  |ADR      R0,run_|
000019e0  74 79 70 65 5f 70 72 6f  67 25 0d 07 26 21 20 20  |type_prog%..&!  |
000019f0  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 20  |        SWI     |
00001a00  20 20 22 58 4f 53 5f 43  4c 49 22 0d 07 30 25 20  |  "XOS_CLI"..0% |
00001a10  20 20 20 20 20 20 20 20  20 4c 44 4d 46 44 20 20  |         LDMFD  |
00001a20  20 20 20 52 31 33 21 2c  7b 52 30 2c 50 43 7d 5e  |   R13!,{R0,PC}^|
00001a30  0d 07 3a 07 5d 3a ed 0d  07 44 2d c8 99 20 22 4f  |..:.]:...D-.. "O|
00001a40  53 5f 46 69 6c 65 22 2c  31 30 2c 22 41 75 74 6f  |S_File",10,"Auto|
00001a50  54 79 70 65 22 2c 26 46  46 41 2c 2c 63 6f 64 65  |Type",&FFA,,code|
00001a60  25 2c 4f 25 0d 07 4e 05  e0 0d ff                 |%,O%..N....|
00001a6b