Home » Archimedes archive » Acorn User » Acorn User - Updated Shareware Collection (1994).adf » Programs » AppEnsure/Source/AppEnsure

AppEnsure/Source/AppEnsure

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » Acorn User - Updated Shareware Collection (1994).adf » Programs
Filename: AppEnsure/Source/AppEnsure
Read OK:
File size: 1122 bytes
Load address: 0000
Exec address: 0000
File contents
    1REM  >AppEnsure
    2REM    Execute * command if application not active
    3REM     LEN Cy Booker 1993
    4
    5LIBRARY "Source:Constants"
    6LIBRARY "Source:MakeUtil"
    7:
    8ON ERROR : ERROR EXT ERR, REPORT$ + " ["+ STR$(ERL)+ "]"
    9code_size% = 2*1024
   10DIM code% code_size%-1
   11::
   12debug_AppEnsure = FALSE
   13::
   14PROC_Define_Constants
   15::
   16PROC_Make_Code("AppEnsure", "AppEnsure", &FF8)
   17PROC_Test_AppEnsure
   18END
   19:
   20:REM*********************************************************************
   21:REM**************************** AppEnsure **********************************
   22:REM*********************************************************************
   23:
   24DEF PROC_Test_AppEnsure
   25  IF debug_AppEnsure THEN
   26    DIM B% 256
   27    $B% = """Debug viewer"" <pd>.Desktop.Utils.!BugView"+ CHR$(0)
   28    DIM A% 1024
   29    OSCLI("BreakSet "+ STR$~(code%+break))
   30    CALL code%
   31  ENDIF
   32ENDPROC
   33:
   34DEF FN_assemble_AppEnsure
   35LOCAL loop, lp, cmp
   36  bufsiz% = 512
   37  argsiz% = 256
   38[OPT pass%
   39\Cy J Booker
   40\12.06.1993 - Wrote (as utility --- failed)
   41\19.06.1993 - as an application
   42\
   43\ Syntax. *AppEnsure [-Title] <title> [-Command] <command>
   44\
   45;       Note - no stack!
   46        ADR     R12, buffer
   47        SUB     R0, R12, #&8000 - (argsiz% + bufsiz%)
   48        MVN     R1, #0
   49        SWI     "XWimp_SlotSize"                ; Ensure buffer exists!
   50        SWIvc   "XOS_GetEnv"
   51        Bvs     error
   52        LDRB    R2, [R0, #0]
   53        CMP     R2, #ASC(" ")
   54        Bls     help                    \ Give help
   55        MOV     R1, R0
   56        ADR     R0, args
   57        MOV     R2, R12
   58        MOV     R3, #bufsiz%
   59        SWI     "XOS_ReadArgs"
   60        Bvs     help
   61        MOV     R0, #0
   62.loop   ADD     R1, R12, #argsiz%
   63        MOV     R2, #bufsiz%
   64        SWI     "XTaskManager_EnumerateTasks"
   65        Bvs     error
   66        ADD     R3, R12, #argsiz% - 16
   67.lp     ADD     R3, R3, #16                     ; pointer to 16-byte word-aligned block for task
   68        CMP     R3, R1
   69        Bhs     enumerated_chunk
   70        LDR     R4, [R3, #4]                    ; pointer to task name
   71        LDR     R5, [R12, #4]                   ; pointer to title
   72.cmp    LDRB    R6, [R4], #1
   73        LDRB    R7, [R5], #1
   74        CMP     R6, #ASC" "
   75        Blo     endcmp
   76        TEQ     R6, R7
   77        Beq     cmp
   78        B       lp
   79.endcmp
   80        CMP     R7, #ASC" "
   81        Bhs     lp
   82.quit   MOV     R0, #0
   83        LDR     R1, value_ABEX
   84        MOV     R2, #0
   85        SWI     "OS_Exit"
   86.value_ABEX
   87        EQUS    "ABEX"
   88.value_TASK
   89        EQUS    "TASK"
   90.enumerated_chunk
   91        CMP     R0, #0
   92        Bgt     loop
   93        MOV     R0, #300
   94        ADD     R0, R0, #10
   95        LDR     R1, value_TASK
   96        ADR     R2, title
   97        ADR     R3, messages
   98        SWI     "XWimp_Initialise"              ; R1 --> task handle
   99        Bvs     error
  100        LDR     R0, [R12, #8]                   ; Execute command
  101        SWI     "XWimp_StartTask"
  102        MOVvs   R2, R0
  103        MOV     R3, pc
  104        MOV     R0, R1
  105        LDR     R1, value_TASK
  106        SWI     "XWimp_CloseDown"
  107        MOVvc   R0, R2
  108        TEQvcP  R3, #0
  109        Bvc     quit
  110.error  LDR     R1, value_ABEX
  111        MOV     R2, #1
  112        SWI     "OS_Exit"
  113;
  114.messages
  115        EQUD    0
  116.title  EQUS    "AppEnsure"+ CHR$0
  117.args   EQUS    "/a,Title/a,Command/a"+ CHR$0
  118\
  119        ALIGN
  120.help   ADR     R0, help_text
  121        MOV     R1, #0                  \ Use system dictionary
  122        ADR     R2, help_name
  123        SWI     "XOS_PrettyPrint"
  124        Bvc     quit
  125        B       error
  126\
  127
  128.help_name
  129        EQUS    "AppEnsure"
  130        EQUB    0
  131.help_text
  132        EQUS    "*"+ name$+ " will load the Wimp task using the given command if "
  133        EQUS    "that task is not already loaded. <title> is the name as listed in "
  134        EQUS    "the task manager window, and <command> is something that will be "
  135        EQUS    "Wimp_StartTask'ed if necessary (<command is usually the diretory "
  136        EQUS    "of the application)."
  137        EQUS    nl$
  138        EQUS    syntax$+ " [-Title] <title> [-Command] <command>"
  139        EQUS    nl$
  140        EQUB    0
  141        ALIGN
  142.buffer
  143]:= 0
  144:
�  >AppEnsure
4�    Execute * command if application not active
�     � Cy Booker 1993

ț "Source:Constants"
ț "Source:MakeUtil"
:
%� � : � � �, �$ + " ["+ �(�)+ "]"
	code_size% = 2*1024

� code% code_size%-1
::
debug_AppEnsure = �

::
�_Define_Constants
::
/�_Make_Code("AppEnsure", "AppEnsure", &FF8)
�_Test_AppEnsure
�
:
K:�*********************************************************************
O:�**************************** AppEnsure **********************************
K:�*********************************************************************
:
� �_Test_AppEnsure
  � debug_AppEnsure �
    � B% 256
B    $B% = """Debug viewer"" <pd>.Desktop.Utils.!BugView"+ �(0)
    � A% 1024
'    �("BreakSet "+ �~(code%+break))
    � code%
  �
 �
!:
"� �_assemble_AppEnsure
#� loop, lp, cmp
$  bufsiz% = 512
%  argsiz% = 256
&[OPT pass%
'\Cy J Booker
(/\12.06.1993 - Wrote (as utility --- failed)
)#\19.06.1993 - as an application
*\
+>\ Syntax. *AppEnsure [-Title] <title> [-Command] <command>
,\
-;       Note - no stack!
.        ADR     R12, buffer
/9        SUB     R0, R12, #&8000 - (argsiz% + bufsiz%)
0        MVN     R1, #0
1K        SWI     "XWimp_SlotSize"                ; Ensure buffer exists!
2         SWIvc   "XOS_GetEnv"
3        Bvs     error
4         LDRB    R2, [R0, #0]
5        CMP     R2, #�(" ")
67        Bls     help                    \ Give help
7        MOV     R1, R0
8        ADR     R0, args
9        MOV     R2, R12
:         MOV     R3, #bufsiz%
;"        SWI     "XOS_ReadArgs"
<        Bvs     help
=        MOV     R0, #0
>%.loop   ADD     R1, R12, #argsiz%
?         MOV     R2, #bufsiz%
@1        SWI     "XTaskManager_EnumerateTasks"
A        Bvs     error
B*        ADD     R3, R12, #argsiz% - 16
Cd.lp     ADD     R3, R3, #16                     ; pointer to 16-byte word-aligned block for task
D        CMP     R3, R1
E$        Bhs     enumerated_chunk
FJ        LDR     R4, [R3, #4]                    ; pointer to task name
GF        LDR     R5, [R12, #4]                   ; pointer to title
H .cmp    LDRB    R6, [R4], #1
I         LDRB    R7, [R5], #1
J        CMP     R6, #�" "
K        Blo     endcmp
L        TEQ     R6, R7
M        Beq     cmp
N        B       lp
O.endcmp
P        CMP     R7, #�" "
Q        Bhs     lp
R.quit   MOV     R0, #0
S"        LDR     R1, value_ABEX
T        MOV     R2, #0
U        SWI     "OS_Exit"
V.value_ABEX
W        EQUS    "ABEX"
X.value_TASK
Y        EQUS    "TASK"
Z.enumerated_chunk
[        CMP     R0, #0
\        Bgt     loop
]        MOV     R0, #300
^        ADD     R0, R0, #10
_"        LDR     R1, value_TASK
`        ADR     R2, title
a         ADR     R3, messages
bH        SWI     "XWimp_Initialise"              ; R1 --> task handle
c        Bvs     error
dE        LDR     R0, [R12, #8]                   ; Execute command
e%        SWI     "XWimp_StartTask"
f        MOVvs   R2, R0
g        MOV     R3, pc
h        MOV     R0, R1
i"        LDR     R1, value_TASK
j%        SWI     "XWimp_CloseDown"
k        MOVvc   R0, R2
l        TEQvcP  R3, #0
m        Bvc     quit
n".error  LDR     R1, value_ABEX
o        MOV     R2, #1
p        SWI     "OS_Exit"
q;
r
.messages
s        EQUD    0
t#.title  EQUS    "AppEnsure"+ �0
u..args   EQUS    "/a,Title/a,Command/a"+ �0
v\
w        ALIGN
x!.help   ADR     R0, help_text
yC        MOV     R1, #0                  \ Use system dictionary
z!        ADR     R2, help_name
{%        SWI     "XOS_PrettyPrint"
|        Bvc     quit
}        B       error
~\

�.help_name
�        EQUS    "AppEnsure"
�        EQUB    0
�.help_text
�V        EQUS    "*"+ name$+ " will load the Wimp task using the given command if "
�X        EQUS    "that task is not already loaded. <title> is the name as listed in "
�W        EQUS    "the task manager window, and <command> is something that will be "
�W        EQUS    "Wimp_StartTask'ed if necessary (<command is usually the diretory "
�*        EQUS    "of the application)."
�        EQUS    nl$
�E        EQUS    syntax$+ " [-Title] <title> [-Command] <command>"
�        EQUS    nl$
�        EQUB    0
�        ALIGN
�.buffer
�	]:= 0
�:
�
00000000  0d 00 01 11 f4 20 20 3e  41 70 70 45 6e 73 75 72  |.....  >AppEnsur|
00000010  65 0d 00 02 34 f4 20 20  20 20 45 78 65 63 75 74  |e...4.    Execut|
00000020  65 20 2a 20 63 6f 6d 6d  61 6e 64 20 69 66 20 61  |e * command if a|
00000030  70 70 6c 69 63 61 74 69  6f 6e 20 6e 6f 74 20 61  |pplication not a|
00000040  63 74 69 76 65 0d 00 03  1a f4 20 20 20 20 20 a9  |ctive.....     .|
00000050  20 43 79 20 42 6f 6f 6b  65 72 20 31 39 39 33 0d  | Cy Booker 1993.|
00000060  00 04 04 0d 00 05 19 c8  9b 20 22 53 6f 75 72 63  |......... "Sourc|
00000070  65 3a 43 6f 6e 73 74 61  6e 74 73 22 0d 00 06 18  |e:Constants"....|
00000080  c8 9b 20 22 53 6f 75 72  63 65 3a 4d 61 6b 65 55  |.. "Source:MakeU|
00000090  74 69 6c 22 0d 00 07 05  3a 0d 00 08 25 ee 20 85  |til"....:...%. .|
000000a0  20 3a 20 85 20 a2 20 9f  2c 20 f6 24 20 2b 20 22  | : . . ., .$ + "|
000000b0  20 5b 22 2b 20 c3 28 9e  29 2b 20 22 5d 22 0d 00  | ["+ .(.)+ "]"..|
000000c0  09 17 63 6f 64 65 5f 73  69 7a 65 25 20 3d 20 32  |..code_size% = 2|
000000d0  2a 31 30 32 34 0d 00 0a  18 de 20 63 6f 64 65 25  |*1024..... code%|
000000e0  20 63 6f 64 65 5f 73 69  7a 65 25 2d 31 0d 00 0b  | code_size%-1...|
000000f0  06 3a 3a 0d 00 0c 17 64  65 62 75 67 5f 41 70 70  |.::....debug_App|
00000100  45 6e 73 75 72 65 20 3d  20 a3 0d 00 0d 06 3a 3a  |Ensure = .....::|
00000110  0d 00 0e 16 f2 5f 44 65  66 69 6e 65 5f 43 6f 6e  |....._Define_Con|
00000120  73 74 61 6e 74 73 0d 00  0f 06 3a 3a 0d 00 10 2f  |stants....::.../|
00000130  f2 5f 4d 61 6b 65 5f 43  6f 64 65 28 22 41 70 70  |._Make_Code("App|
00000140  45 6e 73 75 72 65 22 2c  20 22 41 70 70 45 6e 73  |Ensure", "AppEns|
00000150  75 72 65 22 2c 20 26 46  46 38 29 0d 00 11 14 f2  |ure", &FF8).....|
00000160  5f 54 65 73 74 5f 41 70  70 45 6e 73 75 72 65 0d  |_Test_AppEnsure.|
00000170  00 12 05 e0 0d 00 13 05  3a 0d 00 14 4b 3a f4 2a  |........:...K:.*|
00000180  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000001c0  2a 2a 2a 2a 0d 00 15 4f  3a f4 2a 2a 2a 2a 2a 2a  |****...O:.******|
000001d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
000001e0  2a 2a 2a 2a 2a 2a 20 41  70 70 45 6e 73 75 72 65  |****** AppEnsure|
000001f0  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
00000200  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000210  2a 2a 2a 0d 00 16 4b 3a  f4 2a 2a 2a 2a 2a 2a 2a  |***...K:.*******|
00000220  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000250  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 0d 00  |**************..|
00000260  17 05 3a 0d 00 18 16 dd  20 f2 5f 54 65 73 74 5f  |..:..... ._Test_|
00000270  41 70 70 45 6e 73 75 72  65 0d 00 19 19 20 20 e7  |AppEnsure....  .|
00000280  20 64 65 62 75 67 5f 41  70 70 45 6e 73 75 72 65  | debug_AppEnsure|
00000290  20 8c 0d 00 1a 10 20 20  20 20 de 20 42 25 20 32  | .....    . B% 2|
000002a0  35 36 0d 00 1b 42 20 20  20 20 24 42 25 20 3d 20  |56...B    $B% = |
000002b0  22 22 22 44 65 62 75 67  20 76 69 65 77 65 72 22  |"""Debug viewer"|
000002c0  22 20 3c 70 64 3e 2e 44  65 73 6b 74 6f 70 2e 55  |" <pd>.Desktop.U|
000002d0  74 69 6c 73 2e 21 42 75  67 56 69 65 77 22 2b 20  |tils.!BugView"+ |
000002e0  bd 28 30 29 0d 00 1c 11  20 20 20 20 de 20 41 25  |.(0)....    . A%|
000002f0  20 31 30 32 34 0d 00 1d  27 20 20 20 20 ff 28 22  | 1024...'    .("|
00000300  42 72 65 61 6b 53 65 74  20 22 2b 20 c3 7e 28 63  |BreakSet "+ .~(c|
00000310  6f 64 65 25 2b 62 72 65  61 6b 29 29 0d 00 1e 0f  |ode%+break))....|
00000320  20 20 20 20 d6 20 63 6f  64 65 25 0d 00 1f 07 20  |    . code%.... |
00000330  20 cd 0d 00 20 05 e1 0d  00 21 05 3a 0d 00 22 1a  | ... ....!.:..".|
00000340  dd 20 a4 5f 61 73 73 65  6d 62 6c 65 5f 41 70 70  |. ._assemble_App|
00000350  45 6e 73 75 72 65 0d 00  23 13 ea 20 6c 6f 6f 70  |Ensure..#.. loop|
00000360  2c 20 6c 70 2c 20 63 6d  70 0d 00 24 13 20 20 62  |, lp, cmp..$.  b|
00000370  75 66 73 69 7a 25 20 3d  20 35 31 32 0d 00 25 13  |ufsiz% = 512..%.|
00000380  20 20 61 72 67 73 69 7a  25 20 3d 20 32 35 36 0d  |  argsiz% = 256.|
00000390  00 26 0e 5b 4f 50 54 20  70 61 73 73 25 0d 00 27  |.&.[OPT pass%..'|
000003a0  10 5c 43 79 20 4a 20 42  6f 6f 6b 65 72 0d 00 28  |.\Cy J Booker..(|
000003b0  2f 5c 31 32 2e 30 36 2e  31 39 39 33 20 2d 20 57  |/\12.06.1993 - W|
000003c0  72 6f 74 65 20 28 61 73  20 75 74 69 6c 69 74 79  |rote (as utility|
000003d0  20 2d 2d 2d 20 66 61 69  6c 65 64 29 0d 00 29 23  | --- failed)..)#|
000003e0  5c 31 39 2e 30 36 2e 31  39 39 33 20 2d 20 61 73  |\19.06.1993 - as|
000003f0  20 61 6e 20 61 70 70 6c  69 63 61 74 69 6f 6e 0d  | an application.|
00000400  00 2a 05 5c 0d 00 2b 3e  5c 20 53 79 6e 74 61 78  |.*.\..+>\ Syntax|
00000410  2e 20 2a 41 70 70 45 6e  73 75 72 65 20 5b 2d 54  |. *AppEnsure [-T|
00000420  69 74 6c 65 5d 20 3c 74  69 74 6c 65 3e 20 5b 2d  |itle] <title> [-|
00000430  43 6f 6d 6d 61 6e 64 5d  20 3c 63 6f 6d 6d 61 6e  |Command] <comman|
00000440  64 3e 0d 00 2c 05 5c 0d  00 2d 1c 3b 20 20 20 20  |d>..,.\..-.;    |
00000450  20 20 20 4e 6f 74 65 20  2d 20 6e 6f 20 73 74 61  |   Note - no sta|
00000460  63 6b 21 0d 00 2e 1f 20  20 20 20 20 20 20 20 41  |ck!....        A|
00000470  44 52 20 20 20 20 20 52  31 32 2c 20 62 75 66 66  |DR     R12, buff|
00000480  65 72 0d 00 2f 39 20 20  20 20 20 20 20 20 53 55  |er../9        SU|
00000490  42 20 20 20 20 20 52 30  2c 20 52 31 32 2c 20 23  |B     R0, R12, #|
000004a0  26 38 30 30 30 20 2d 20  28 61 72 67 73 69 7a 25  |&8000 - (argsiz%|
000004b0  20 2b 20 62 75 66 73 69  7a 25 29 0d 00 30 1a 20  | + bufsiz%)..0. |
000004c0  20 20 20 20 20 20 20 4d  56 4e 20 20 20 20 20 52  |       MVN     R|
000004d0  31 2c 20 23 30 0d 00 31  4b 20 20 20 20 20 20 20  |1, #0..1K       |
000004e0  20 53 57 49 20 20 20 20  20 22 58 57 69 6d 70 5f  | SWI     "XWimp_|
000004f0  53 6c 6f 74 53 69 7a 65  22 20 20 20 20 20 20 20  |SlotSize"       |
00000500  20 20 20 20 20 20 20 20  20 3b 20 45 6e 73 75 72  |         ; Ensur|
00000510  65 20 62 75 66 66 65 72  20 65 78 69 73 74 73 21  |e buffer exists!|
00000520  0d 00 32 20 20 20 20 20  20 20 20 20 53 57 49 76  |..2         SWIv|
00000530  63 20 20 20 22 58 4f 53  5f 47 65 74 45 6e 76 22  |c   "XOS_GetEnv"|
00000540  0d 00 33 19 20 20 20 20  20 20 20 20 42 76 73 20  |..3.        Bvs |
00000550  20 20 20 20 65 72 72 6f  72 0d 00 34 20 20 20 20  |    error..4    |
00000560  20 20 20 20 20 4c 44 52  42 20 20 20 20 52 32 2c  |     LDRB    R2,|
00000570  20 5b 52 30 2c 20 23 30  5d 0d 00 35 1f 20 20 20  | [R0, #0]..5.   |
00000580  20 20 20 20 20 43 4d 50  20 20 20 20 20 52 32 2c  |     CMP     R2,|
00000590  20 23 97 28 22 20 22 29  0d 00 36 37 20 20 20 20  | #.(" ")..67    |
000005a0  20 20 20 20 42 6c 73 20  20 20 20 20 68 65 6c 70  |    Bls     help|
000005b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000005c0  20 20 20 20 5c 20 47 69  76 65 20 68 65 6c 70 0d  |    \ Give help.|
000005d0  00 37 1a 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |.7.        MOV  |
000005e0  20 20 20 52 31 2c 20 52  30 0d 00 38 1c 20 20 20  |   R1, R0..8.   |
000005f0  20 20 20 20 20 41 44 52  20 20 20 20 20 52 30 2c  |     ADR     R0,|
00000600  20 61 72 67 73 0d 00 39  1b 20 20 20 20 20 20 20  | args..9.       |
00000610  20 4d 4f 56 20 20 20 20  20 52 32 2c 20 52 31 32  | MOV     R2, R12|
00000620  0d 00 3a 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |..:         MOV |
00000630  20 20 20 20 52 33 2c 20  23 62 75 66 73 69 7a 25  |    R3, #bufsiz%|
00000640  0d 00 3b 22 20 20 20 20  20 20 20 20 53 57 49 20  |..;"        SWI |
00000650  20 20 20 20 22 58 4f 53  5f 52 65 61 64 41 72 67  |    "XOS_ReadArg|
00000660  73 22 0d 00 3c 18 20 20  20 20 20 20 20 20 42 76  |s"..<.        Bv|
00000670  73 20 20 20 20 20 68 65  6c 70 0d 00 3d 1a 20 20  |s     help..=.  |
00000680  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 30  |      MOV     R0|
00000690  2c 20 23 30 0d 00 3e 25  2e 6c 6f 6f 70 20 20 20  |, #0..>%.loop   |
000006a0  41 44 44 20 20 20 20 20  52 31 2c 20 52 31 32 2c  |ADD     R1, R12,|
000006b0  20 23 61 72 67 73 69 7a  25 0d 00 3f 20 20 20 20  | #argsiz%..?    |
000006c0  20 20 20 20 20 4d 4f 56  20 20 20 20 20 52 32 2c  |     MOV     R2,|
000006d0  20 23 62 75 66 73 69 7a  25 0d 00 40 31 20 20 20  | #bufsiz%..@1   |
000006e0  20 20 20 20 20 53 57 49  20 20 20 20 20 22 58 54  |     SWI     "XT|
000006f0  61 73 6b 4d 61 6e 61 67  65 72 5f 45 6e 75 6d 65  |askManager_Enume|
00000700  72 61 74 65 54 61 73 6b  73 22 0d 00 41 19 20 20  |rateTasks"..A.  |
00000710  20 20 20 20 20 20 42 76  73 20 20 20 20 20 65 72  |      Bvs     er|
00000720  72 6f 72 0d 00 42 2a 20  20 20 20 20 20 20 20 41  |ror..B*        A|
00000730  44 44 20 20 20 20 20 52  33 2c 20 52 31 32 2c 20  |DD     R3, R12, |
00000740  23 61 72 67 73 69 7a 25  20 2d 20 31 36 0d 00 43  |#argsiz% - 16..C|
00000750  64 2e 6c 70 20 20 20 20  20 41 44 44 20 20 20 20  |d.lp     ADD    |
00000760  20 52 33 2c 20 52 33 2c  20 23 31 36 20 20 20 20  | R3, R3, #16    |
00000770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000780  20 3b 20 70 6f 69 6e 74  65 72 20 74 6f 20 31 36  | ; pointer to 16|
00000790  2d 62 79 74 65 20 77 6f  72 64 2d 61 6c 69 67 6e  |-byte word-align|
000007a0  65 64 20 62 6c 6f 63 6b  20 66 6f 72 20 74 61 73  |ed block for tas|
000007b0  6b 0d 00 44 1a 20 20 20  20 20 20 20 20 43 4d 50  |k..D.        CMP|
000007c0  20 20 20 20 20 52 33 2c  20 52 31 0d 00 45 24 20  |     R3, R1..E$ |
000007d0  20 20 20 20 20 20 20 42  68 73 20 20 20 20 20 65  |       Bhs     e|
000007e0  6e 75 6d 65 72 61 74 65  64 5f 63 68 75 6e 6b 0d  |numerated_chunk.|
000007f0  00 46 4a 20 20 20 20 20  20 20 20 4c 44 52 20 20  |.FJ        LDR  |
00000800  20 20 20 52 34 2c 20 5b  52 33 2c 20 23 34 5d 20  |   R4, [R3, #4] |
00000810  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000820  20 20 20 3b 20 70 6f 69  6e 74 65 72 20 74 6f 20  |   ; pointer to |
00000830  74 61 73 6b 20 6e 61 6d  65 0d 00 47 46 20 20 20  |task name..GF   |
00000840  20 20 20 20 20 4c 44 52  20 20 20 20 20 52 35 2c  |     LDR     R5,|
00000850  20 5b 52 31 32 2c 20 23  34 5d 20 20 20 20 20 20  | [R12, #4]      |
00000860  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 70  |             ; p|
00000870  6f 69 6e 74 65 72 20 74  6f 20 74 69 74 6c 65 0d  |ointer to title.|
00000880  00 48 20 2e 63 6d 70 20  20 20 20 4c 44 52 42 20  |.H .cmp    LDRB |
00000890  20 20 20 52 36 2c 20 5b  52 34 5d 2c 20 23 31 0d  |   R6, [R4], #1.|
000008a0  00 49 20 20 20 20 20 20  20 20 20 4c 44 52 42 20  |.I         LDRB |
000008b0  20 20 20 52 37 2c 20 5b  52 35 5d 2c 20 23 31 0d  |   R7, [R5], #1.|
000008c0  00 4a 1d 20 20 20 20 20  20 20 20 43 4d 50 20 20  |.J.        CMP  |
000008d0  20 20 20 52 36 2c 20 23  97 22 20 22 0d 00 4b 1a  |   R6, #." "..K.|
000008e0  20 20 20 20 20 20 20 20  42 6c 6f 20 20 20 20 20  |        Blo     |
000008f0  65 6e 64 63 6d 70 0d 00  4c 1a 20 20 20 20 20 20  |endcmp..L.      |
00000900  20 20 54 45 51 20 20 20  20 20 52 36 2c 20 52 37  |  TEQ     R6, R7|
00000910  0d 00 4d 17 20 20 20 20  20 20 20 20 42 65 71 20  |..M.        Beq |
00000920  20 20 20 20 63 6d 70 0d  00 4e 16 20 20 20 20 20  |    cmp..N.     |
00000930  20 20 20 42 20 20 20 20  20 20 20 6c 70 0d 00 4f  |   B       lp..O|
00000940  0b 2e 65 6e 64 63 6d 70  0d 00 50 1d 20 20 20 20  |..endcmp..P.    |
00000950  20 20 20 20 43 4d 50 20  20 20 20 20 52 37 2c 20  |    CMP     R7, |
00000960  23 97 22 20 22 0d 00 51  16 20 20 20 20 20 20 20  |#." "..Q.       |
00000970  20 42 68 73 20 20 20 20  20 6c 70 0d 00 52 1a 2e  | Bhs     lp..R..|
00000980  71 75 69 74 20 20 20 4d  4f 56 20 20 20 20 20 52  |quit   MOV     R|
00000990  30 2c 20 23 30 0d 00 53  22 20 20 20 20 20 20 20  |0, #0..S"       |
000009a0  20 4c 44 52 20 20 20 20  20 52 31 2c 20 76 61 6c  | LDR     R1, val|
000009b0  75 65 5f 41 42 45 58 0d  00 54 1a 20 20 20 20 20  |ue_ABEX..T.     |
000009c0  20 20 20 4d 4f 56 20 20  20 20 20 52 32 2c 20 23  |   MOV     R2, #|
000009d0  30 0d 00 55 1d 20 20 20  20 20 20 20 20 53 57 49  |0..U.        SWI|
000009e0  20 20 20 20 20 22 4f 53  5f 45 78 69 74 22 0d 00  |     "OS_Exit"..|
000009f0  56 0f 2e 76 61 6c 75 65  5f 41 42 45 58 0d 00 57  |V..value_ABEX..W|
00000a00  1a 20 20 20 20 20 20 20  20 45 51 55 53 20 20 20  |.        EQUS   |
00000a10  20 22 41 42 45 58 22 0d  00 58 0f 2e 76 61 6c 75  | "ABEX"..X..valu|
00000a20  65 5f 54 41 53 4b 0d 00  59 1a 20 20 20 20 20 20  |e_TASK..Y.      |
00000a30  20 20 45 51 55 53 20 20  20 20 22 54 41 53 4b 22  |  EQUS    "TASK"|
00000a40  0d 00 5a 15 2e 65 6e 75  6d 65 72 61 74 65 64 5f  |..Z..enumerated_|
00000a50  63 68 75 6e 6b 0d 00 5b  1a 20 20 20 20 20 20 20  |chunk..[.       |
00000a60  20 43 4d 50 20 20 20 20  20 52 30 2c 20 23 30 0d  | CMP     R0, #0.|
00000a70  00 5c 18 20 20 20 20 20  20 20 20 42 67 74 20 20  |.\.        Bgt  |
00000a80  20 20 20 6c 6f 6f 70 0d  00 5d 1c 20 20 20 20 20  |   loop..].     |
00000a90  20 20 20 4d 4f 56 20 20  20 20 20 52 30 2c 20 23  |   MOV     R0, #|
00000aa0  33 30 30 0d 00 5e 1f 20  20 20 20 20 20 20 20 41  |300..^.        A|
00000ab0  44 44 20 20 20 20 20 52  30 2c 20 52 30 2c 20 23  |DD     R0, R0, #|
00000ac0  31 30 0d 00 5f 22 20 20  20 20 20 20 20 20 4c 44  |10.._"        LD|
00000ad0  52 20 20 20 20 20 52 31  2c 20 76 61 6c 75 65 5f  |R     R1, value_|
00000ae0  54 41 53 4b 0d 00 60 1d  20 20 20 20 20 20 20 20  |TASK..`.        |
00000af0  41 44 52 20 20 20 20 20  52 32 2c 20 74 69 74 6c  |ADR     R2, titl|
00000b00  65 0d 00 61 20 20 20 20  20 20 20 20 20 41 44 52  |e..a         ADR|
00000b10  20 20 20 20 20 52 33 2c  20 6d 65 73 73 61 67 65  |     R3, message|
00000b20  73 0d 00 62 48 20 20 20  20 20 20 20 20 53 57 49  |s..bH        SWI|
00000b30  20 20 20 20 20 22 58 57  69 6d 70 5f 49 6e 69 74  |     "XWimp_Init|
00000b40  69 61 6c 69 73 65 22 20  20 20 20 20 20 20 20 20  |ialise"         |
00000b50  20 20 20 20 20 3b 20 52  31 20 2d 2d 3e 20 74 61  |     ; R1 --> ta|
00000b60  73 6b 20 68 61 6e 64 6c  65 0d 00 63 19 20 20 20  |sk handle..c.   |
00000b70  20 20 20 20 20 42 76 73  20 20 20 20 20 65 72 72  |     Bvs     err|
00000b80  6f 72 0d 00 64 45 20 20  20 20 20 20 20 20 4c 44  |or..dE        LD|
00000b90  52 20 20 20 20 20 52 30  2c 20 5b 52 31 32 2c 20  |R     R0, [R12, |
00000ba0  23 38 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |#8]             |
00000bb0  20 20 20 20 20 20 3b 20  45 78 65 63 75 74 65 20  |      ; Execute |
00000bc0  63 6f 6d 6d 61 6e 64 0d  00 65 25 20 20 20 20 20  |command..e%     |
00000bd0  20 20 20 53 57 49 20 20  20 20 20 22 58 57 69 6d  |   SWI     "XWim|
00000be0  70 5f 53 74 61 72 74 54  61 73 6b 22 0d 00 66 1a  |p_StartTask"..f.|
00000bf0  20 20 20 20 20 20 20 20  4d 4f 56 76 73 20 20 20  |        MOVvs   |
00000c00  52 32 2c 20 52 30 0d 00  67 1a 20 20 20 20 20 20  |R2, R0..g.      |
00000c10  20 20 4d 4f 56 20 20 20  20 20 52 33 2c 20 70 63  |  MOV     R3, pc|
00000c20  0d 00 68 1a 20 20 20 20  20 20 20 20 4d 4f 56 20  |..h.        MOV |
00000c30  20 20 20 20 52 30 2c 20  52 31 0d 00 69 22 20 20  |    R0, R1..i"  |
00000c40  20 20 20 20 20 20 4c 44  52 20 20 20 20 20 52 31  |      LDR     R1|
00000c50  2c 20 76 61 6c 75 65 5f  54 41 53 4b 0d 00 6a 25  |, value_TASK..j%|
00000c60  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 20  |        SWI     |
00000c70  22 58 57 69 6d 70 5f 43  6c 6f 73 65 44 6f 77 6e  |"XWimp_CloseDown|
00000c80  22 0d 00 6b 1a 20 20 20  20 20 20 20 20 4d 4f 56  |"..k.        MOV|
00000c90  76 63 20 20 20 52 30 2c  20 52 32 0d 00 6c 1a 20  |vc   R0, R2..l. |
00000ca0  20 20 20 20 20 20 20 54  45 51 76 63 50 20 20 52  |       TEQvcP  R|
00000cb0  33 2c 20 23 30 0d 00 6d  18 20 20 20 20 20 20 20  |3, #0..m.       |
00000cc0  20 42 76 63 20 20 20 20  20 71 75 69 74 0d 00 6e  | Bvc     quit..n|
00000cd0  22 2e 65 72 72 6f 72 20  20 4c 44 52 20 20 20 20  |".error  LDR    |
00000ce0  20 52 31 2c 20 76 61 6c  75 65 5f 41 42 45 58 0d  | R1, value_ABEX.|
00000cf0  00 6f 1a 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |.o.        MOV  |
00000d00  20 20 20 52 32 2c 20 23  31 0d 00 70 1d 20 20 20  |   R2, #1..p.   |
00000d10  20 20 20 20 20 53 57 49  20 20 20 20 20 22 4f 53  |     SWI     "OS|
00000d20  5f 45 78 69 74 22 0d 00  71 05 3b 0d 00 72 0d 2e  |_Exit"..q.;..r..|
00000d30  6d 65 73 73 61 67 65 73  0d 00 73 15 20 20 20 20  |messages..s.    |
00000d40  20 20 20 20 45 51 55 44  20 20 20 20 30 0d 00 74  |    EQUD    0..t|
00000d50  23 2e 74 69 74 6c 65 20  20 45 51 55 53 20 20 20  |#.title  EQUS   |
00000d60  20 22 41 70 70 45 6e 73  75 72 65 22 2b 20 bd 30  | "AppEnsure"+ .0|
00000d70  0d 00 75 2e 2e 61 72 67  73 20 20 20 45 51 55 53  |..u..args   EQUS|
00000d80  20 20 20 20 22 2f 61 2c  54 69 74 6c 65 2f 61 2c  |    "/a,Title/a,|
00000d90  43 6f 6d 6d 61 6e 64 2f  61 22 2b 20 bd 30 0d 00  |Command/a"+ .0..|
00000da0  76 05 5c 0d 00 77 11 20  20 20 20 20 20 20 20 41  |v.\..w.        A|
00000db0  4c 49 47 4e 0d 00 78 21  2e 68 65 6c 70 20 20 20  |LIGN..x!.help   |
00000dc0  41 44 52 20 20 20 20 20  52 30 2c 20 68 65 6c 70  |ADR     R0, help|
00000dd0  5f 74 65 78 74 0d 00 79  43 20 20 20 20 20 20 20  |_text..yC       |
00000de0  20 4d 4f 56 20 20 20 20  20 52 31 2c 20 23 30 20  | MOV     R1, #0 |
00000df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e00  20 5c 20 55 73 65 20 73  79 73 74 65 6d 20 64 69  | \ Use system di|
00000e10  63 74 69 6f 6e 61 72 79  0d 00 7a 21 20 20 20 20  |ctionary..z!    |
00000e20  20 20 20 20 41 44 52 20  20 20 20 20 52 32 2c 20  |    ADR     R2, |
00000e30  68 65 6c 70 5f 6e 61 6d  65 0d 00 7b 25 20 20 20  |help_name..{%   |
00000e40  20 20 20 20 20 53 57 49  20 20 20 20 20 22 58 4f  |     SWI     "XO|
00000e50  53 5f 50 72 65 74 74 79  50 72 69 6e 74 22 0d 00  |S_PrettyPrint"..|
00000e60  7c 18 20 20 20 20 20 20  20 20 42 76 63 20 20 20  ||.        Bvc   |
00000e70  20 20 71 75 69 74 0d 00  7d 19 20 20 20 20 20 20  |  quit..}.      |
00000e80  20 20 42 20 20 20 20 20  20 20 65 72 72 6f 72 0d  |  B       error.|
00000e90  00 7e 05 5c 0d 00 7f 04  0d 00 80 0e 2e 68 65 6c  |.~.\.........hel|
00000ea0  70 5f 6e 61 6d 65 0d 00  81 1f 20 20 20 20 20 20  |p_name....      |
00000eb0  20 20 45 51 55 53 20 20  20 20 22 41 70 70 45 6e  |  EQUS    "AppEn|
00000ec0  73 75 72 65 22 0d 00 82  15 20 20 20 20 20 20 20  |sure"....       |
00000ed0  20 45 51 55 42 20 20 20  20 30 0d 00 83 0e 2e 68  | EQUB    0.....h|
00000ee0  65 6c 70 5f 74 65 78 74  0d 00 84 56 20 20 20 20  |elp_text...V    |
00000ef0  20 20 20 20 45 51 55 53  20 20 20 20 22 2a 22 2b  |    EQUS    "*"+|
00000f00  20 6e 61 6d 65 24 2b 20  22 20 77 69 6c 6c 20 6c  | name$+ " will l|
00000f10  6f 61 64 20 74 68 65 20  57 69 6d 70 20 74 61 73  |oad the Wimp tas|
00000f20  6b 20 75 73 69 6e 67 20  74 68 65 20 67 69 76 65  |k using the give|
00000f30  6e 20 63 6f 6d 6d 61 6e  64 20 69 66 20 22 0d 00  |n command if "..|
00000f40  85 58 20 20 20 20 20 20  20 20 45 51 55 53 20 20  |.X        EQUS  |
00000f50  20 20 22 74 68 61 74 20  74 61 73 6b 20 69 73 20  |  "that task is |
00000f60  6e 6f 74 20 61 6c 72 65  61 64 79 20 6c 6f 61 64  |not already load|
00000f70  65 64 2e 20 3c 74 69 74  6c 65 3e 20 69 73 20 74  |ed. <title> is t|
00000f80  68 65 20 6e 61 6d 65 20  61 73 20 6c 69 73 74 65  |he name as liste|
00000f90  64 20 69 6e 20 22 0d 00  86 57 20 20 20 20 20 20  |d in "...W      |
00000fa0  20 20 45 51 55 53 20 20  20 20 22 74 68 65 20 74  |  EQUS    "the t|
00000fb0  61 73 6b 20 6d 61 6e 61  67 65 72 20 77 69 6e 64  |ask manager wind|
00000fc0  6f 77 2c 20 61 6e 64 20  3c 63 6f 6d 6d 61 6e 64  |ow, and <command|
00000fd0  3e 20 69 73 20 73 6f 6d  65 74 68 69 6e 67 20 74  |> is something t|
00000fe0  68 61 74 20 77 69 6c 6c  20 62 65 20 22 0d 00 87  |hat will be "...|
00000ff0  57 20 20 20 20 20 20 20  20 45 51 55 53 20 20 20  |W        EQUS   |
00001000  20 22 57 69 6d 70 5f 53  74 61 72 74 54 61 73 6b  | "Wimp_StartTask|
00001010  27 65 64 20 69 66 20 6e  65 63 65 73 73 61 72 79  |'ed if necessary|
00001020  20 28 3c 63 6f 6d 6d 61  6e 64 20 69 73 20 75 73  | (<command is us|
00001030  75 61 6c 6c 79 20 74 68  65 20 64 69 72 65 74 6f  |ually the direto|
00001040  72 79 20 22 0d 00 88 2a  20 20 20 20 20 20 20 20  |ry "...*        |
00001050  45 51 55 53 20 20 20 20  22 6f 66 20 74 68 65 20  |EQUS    "of the |
00001060  61 70 70 6c 69 63 61 74  69 6f 6e 29 2e 22 0d 00  |application)."..|
00001070  89 17 20 20 20 20 20 20  20 20 45 51 55 53 20 20  |..        EQUS  |
00001080  20 20 6e 6c 24 0d 00 8a  45 20 20 20 20 20 20 20  |  nl$...E       |
00001090  20 45 51 55 53 20 20 20  20 73 79 6e 74 61 78 24  | EQUS    syntax$|
000010a0  2b 20 22 20 5b 2d 54 69  74 6c 65 5d 20 3c 74 69  |+ " [-Title] <ti|
000010b0  74 6c 65 3e 20 5b 2d 43  6f 6d 6d 61 6e 64 5d 20  |tle> [-Command] |
000010c0  3c 63 6f 6d 6d 61 6e 64  3e 22 0d 00 8b 17 20 20  |<command>"....  |
000010d0  20 20 20 20 20 20 45 51  55 53 20 20 20 20 6e 6c  |      EQUS    nl|
000010e0  24 0d 00 8c 15 20 20 20  20 20 20 20 20 45 51 55  |$....        EQU|
000010f0  42 20 20 20 20 30 0d 00  8d 11 20 20 20 20 20 20  |B    0....      |
00001100  20 20 41 4c 49 47 4e 0d  00 8e 0b 2e 62 75 66 66  |  ALIGN.....buff|
00001110  65 72 0d 00 8f 09 5d 3a  3d 20 30 0d 00 90 05 3a  |er....]:= 0....:|
00001120  0d ff                                             |..|
00001122