Home » Archimedes archive » Acorn Computing » 1994 02 subscription disc.adf » 9402s » PD/TaskEnsure/s/taskensure
PD/TaskEnsure/s/taskensure
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 Computing » 1994 02 subscription disc.adf » 9402s |
Filename: | PD/TaskEnsure/s/taskensure |
Read OK: | ✔ |
File size: | 0C67 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
; ************ TaskEnsure code ; Project title: TaskEnsure ; Purpose: Ensure a WIMP task is present ; File name: s.taskensure ; Last modified: 11/8/93 ; Author: Ben Summers ; Version: 0.00 ; Dependancies: none false EQU 1 true EQU 0 XTaskManager_EnumerateTasks EQU &62681 OS_Exit EQU &11 OS_CLI EQU &5 OS_GenerateError EQU &2B ; r0 = pointer to command line ; r12 = pointer to workspace taskensure ; can't use OS_ReadArgs. Pity. MOV R1,#false STR R1,inverse [ module = 0 ; it seems that what actually happens isn't as it is described in the PRM te_l1 ; for a module start entry, the module name is NOT passed as the first entry LDRB R1,[R0],#1 CMP R1,#0 BEQ bad_params CMP R1,#' ' BNE te_l1 ] LDRB R1,[R0] CMP R1,#'-' BNE Jte_2 LDRB R1,[R0,#1] CMP R1,#'p' CMPNE R1,#'P' BNE bad_params MOV R1,#true STR R1,inverse te_l2 LDRB R1,[R0],#1 CMP R1,#0 BEQ bad_params CMP R1,#' ' BNE te_l2 Jte_2 ; next on the line is the task name... first check... does it start with "? LDRB R1,[R0] CMP R1,#'"' ADR R1,taskname BEQ Ste_1 te_l3 LDRB R2,[R0],#1 CMP R2,#0 BEQ bad_params CMP R2,#' ' STRNEB R2,[R1],#1 BNE te_l3 MOV R2,#0 STRB R2,[R1] Rte_1 ; one way or the other, the task name is in taskname ; now copy the rest of the command line to the command line. Unsafe to use it 'in situ' ADR R1,command te_l4 LDRB R2,[R0],#1 STRB R2,[R1],#1 CMP R2,#0 BNE te_l4 ; right then, task name in taskname, rest of command line in command, and ; inverse set correctly ; go though task names to see if it is present MOV R0,#0 te_l5 ADR R1,buffer MOV R2,#buffer_end - buffer SWI XTaskManager_EnumerateTasks BVS task_not_present ; ie under OS2 assume that the task is not present ; compare names note: case sensitive LDR R1,buffer_name ADR R2,taskname te_l5_1 LDRB R3,[R1],#1 LDRB R4,[R2],#1 CMP R3,#32 MOVLT R3,#0 ; force R3 (from task name from TaskManager) to 0 if it is a control code CMP R3,R4 BNE Ate_l5_1 CMP R3,#0 BNE te_l5_1 B task_present Ate_l5_1 CMP R0,#0 BGE te_l5 task_not_present LDR R0,inverse CMP R0,#true SWIEQ OS_Exit run_command ADR R0,command SWI OS_CLI SWI OS_Exit ; in case CLI returns, which it is not unlikely to do DCB 10,10,"� Ben Summers 1993",10,10 ALIGN task_present LDR R0,inverse CMP R0,#true SWINE OS_Exit B run_command bad_params_err DCD 0 DCB "Bad arguments, syntax: TaskEnsure [-p] <task name> <command>",0 ALIGN bad_params ADR R0,bad_params_err SWI OS_GenerateError Ste_1 Ste_1_l1 LDRB R2,[R0,#1]! CMP R2,#0 BEQ bad_params CMP R2,#'"' STRNEB R2,[R1],#1 BNE Ste_1_l1 MOV R2,#0 STRB R2,[R1] LDRB R2,[R0,#1] ; char after " CMP R2,#' ' BNE bad_params ADD R0,R0,#2 ; jump over '" ' B Rte_1 LTORG ^ 0,R12 taskname # 64 inverse # 4 command # 256 buffer # 0 buffer_handle # 4 buffer_name # 4 buffer_memory # 4 buffer_flags # 4 buffer_end # 0 END
00000000 20 20 3b 20 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a | ; ************| 00000010 20 54 61 73 6b 45 6e 73 75 72 65 20 63 6f 64 65 | TaskEnsure code| 00000020 0a 0a 20 20 3b 20 50 72 6f 6a 65 63 74 20 74 69 |.. ; Project ti| 00000030 74 6c 65 3a 20 54 61 73 6b 45 6e 73 75 72 65 0a |tle: TaskEnsure.| 00000040 20 20 3b 20 50 75 72 70 6f 73 65 3a 20 20 20 20 | ; Purpose: | 00000050 20 20 20 45 6e 73 75 72 65 20 61 20 57 49 4d 50 | Ensure a WIMP| 00000060 20 74 61 73 6b 20 69 73 20 70 72 65 73 65 6e 74 | task is present| 00000070 0a 20 20 3b 20 46 69 6c 65 20 6e 61 6d 65 3a 20 |. ; File name: | 00000080 20 20 20 20 73 2e 74 61 73 6b 65 6e 73 75 72 65 | s.taskensure| 00000090 0a 20 20 3b 20 4c 61 73 74 20 6d 6f 64 69 66 69 |. ; Last modifi| 000000a0 65 64 3a 20 31 31 2f 38 2f 39 33 0a 20 20 3b 20 |ed: 11/8/93. ; | 000000b0 41 75 74 68 6f 72 3a 20 20 20 20 20 20 20 20 42 |Author: B| 000000c0 65 6e 20 53 75 6d 6d 65 72 73 0a 20 20 3b 20 56 |en Summers. ; V| 000000d0 65 72 73 69 6f 6e 3a 20 20 20 20 20 20 20 30 2e |ersion: 0.| 000000e0 30 30 0a 20 20 3b 20 44 65 70 65 6e 64 61 6e 63 |00. ; Dependanc| 000000f0 69 65 73 3a 20 20 6e 6f 6e 65 0a 0a 66 61 6c 73 |ies: none..fals| 00000100 65 20 45 51 55 20 31 0a 74 72 75 65 20 20 45 51 |e EQU 1.true EQ| 00000110 55 20 30 0a 0a 58 54 61 73 6b 4d 61 6e 61 67 65 |U 0..XTaskManage| 00000120 72 5f 45 6e 75 6d 65 72 61 74 65 54 61 73 6b 73 |r_EnumerateTasks| 00000130 20 45 51 55 20 26 36 32 36 38 31 0a 4f 53 5f 45 | EQU &62681.OS_E| 00000140 78 69 74 20 45 51 55 20 26 31 31 0a 4f 53 5f 43 |xit EQU &11.OS_C| 00000150 4c 49 20 45 51 55 20 26 35 0a 4f 53 5f 47 65 6e |LI EQU &5.OS_Gen| 00000160 65 72 61 74 65 45 72 72 6f 72 20 45 51 55 20 26 |erateError EQU &| 00000170 32 42 0a 0a 20 20 3b 20 72 30 20 3d 20 70 6f 69 |2B.. ; r0 = poi| 00000180 6e 74 65 72 20 74 6f 20 63 6f 6d 6d 61 6e 64 20 |nter to command | 00000190 6c 69 6e 65 0a 20 20 3b 20 72 31 32 20 3d 20 70 |line. ; r12 = p| 000001a0 6f 69 6e 74 65 72 20 74 6f 20 77 6f 72 6b 73 70 |ointer to worksp| 000001b0 61 63 65 0a 74 61 73 6b 65 6e 73 75 72 65 0a 20 |ace.taskensure. | 000001c0 20 3b 20 63 61 6e 27 74 20 75 73 65 20 4f 53 5f | ; can't use OS_| 000001d0 52 65 61 64 41 72 67 73 2e 20 50 69 74 79 2e 0a |ReadArgs. Pity..| 000001e0 20 4d 4f 56 20 20 20 52 31 2c 23 66 61 6c 73 65 | MOV R1,#false| 000001f0 0a 20 53 54 52 20 20 20 52 31 2c 69 6e 76 65 72 |. STR R1,inver| 00000200 73 65 0a 20 5b 20 6d 6f 64 75 6c 65 20 3d 20 30 |se. [ module = 0| 00000210 20 20 20 20 20 20 20 3b 20 69 74 20 73 65 65 6d | ; it seem| 00000220 73 20 74 68 61 74 20 77 68 61 74 20 61 63 74 75 |s that what actu| 00000230 61 6c 6c 79 20 68 61 70 70 65 6e 73 20 69 73 6e |ally happens isn| 00000240 27 74 20 61 73 20 69 74 20 69 73 20 64 65 73 63 |'t as it is desc| 00000250 72 69 62 65 64 20 69 6e 20 74 68 65 20 50 52 4d |ribed in the PRM| 00000260 0a 74 65 5f 6c 31 20 20 20 20 20 20 20 20 20 20 |.te_l1 | 00000270 20 20 20 20 20 3b 20 66 6f 72 20 61 20 6d 6f 64 | ; for a mod| 00000280 75 6c 65 20 73 74 61 72 74 20 65 6e 74 72 79 2c |ule start entry,| 00000290 20 74 68 65 20 6d 6f 64 75 6c 65 20 6e 61 6d 65 | the module name| 000002a0 20 69 73 20 4e 4f 54 20 70 61 73 73 65 64 20 61 | is NOT passed a| 000002b0 73 20 74 68 65 20 66 69 72 73 74 20 65 6e 74 72 |s the first entr| 000002c0 79 0a 20 20 4c 44 52 42 20 20 52 31 2c 5b 52 30 |y. LDRB R1,[R0| 000002d0 5d 2c 23 31 0a 20 20 43 4d 50 20 20 20 52 31 2c |],#1. CMP R1,| 000002e0 23 30 0a 20 20 42 45 51 20 20 20 62 61 64 5f 70 |#0. BEQ bad_p| 000002f0 61 72 61 6d 73 0a 20 20 43 4d 50 20 20 20 52 31 |arams. CMP R1| 00000300 2c 23 27 20 27 0a 20 42 4e 45 20 20 20 74 65 5f |,#' '. BNE te_| 00000310 6c 31 0a 20 5d 0a 20 4c 44 52 42 20 20 52 31 2c |l1. ]. LDRB R1,| 00000320 5b 52 30 5d 0a 20 43 4d 50 20 20 20 52 31 2c 23 |[R0]. CMP R1,#| 00000330 27 2d 27 0a 20 42 4e 45 20 20 20 4a 74 65 5f 32 |'-'. BNE Jte_2| 00000340 0a 20 4c 44 52 42 20 20 52 31 2c 5b 52 30 2c 23 |. LDRB R1,[R0,#| 00000350 31 5d 0a 20 43 4d 50 20 20 20 52 31 2c 23 27 70 |1]. CMP R1,#'p| 00000360 27 0a 20 43 4d 50 4e 45 20 52 31 2c 23 27 50 27 |'. CMPNE R1,#'P'| 00000370 0a 20 42 4e 45 20 20 20 62 61 64 5f 70 61 72 61 |. BNE bad_para| 00000380 6d 73 0a 20 4d 4f 56 20 20 20 52 31 2c 23 74 72 |ms. MOV R1,#tr| 00000390 75 65 0a 20 53 54 52 20 20 20 52 31 2c 69 6e 76 |ue. STR R1,inv| 000003a0 65 72 73 65 0a 74 65 5f 6c 32 0a 20 20 4c 44 52 |erse.te_l2. LDR| 000003b0 42 20 20 52 31 2c 5b 52 30 5d 2c 23 31 0a 20 20 |B R1,[R0],#1. | 000003c0 43 4d 50 20 20 20 52 31 2c 23 30 0a 20 20 42 45 |CMP R1,#0. BE| 000003d0 51 20 20 20 62 61 64 5f 70 61 72 61 6d 73 0a 20 |Q bad_params. | 000003e0 20 43 4d 50 20 20 20 52 31 2c 23 27 20 27 0a 20 | CMP R1,#' '. | 000003f0 42 4e 45 20 20 20 74 65 5f 6c 32 0a 4a 74 65 5f |BNE te_l2.Jte_| 00000400 32 0a 20 20 3b 20 6e 65 78 74 20 6f 6e 20 74 68 |2. ; next on th| 00000410 65 20 6c 69 6e 65 20 69 73 20 74 68 65 20 74 61 |e line is the ta| 00000420 73 6b 20 6e 61 6d 65 2e 2e 2e 20 66 69 72 73 74 |sk name... first| 00000430 20 63 68 65 63 6b 2e 2e 2e 20 64 6f 65 73 20 69 | check... does i| 00000440 74 20 73 74 61 72 74 20 77 69 74 68 20 22 3f 0a |t start with "?.| 00000450 20 4c 44 52 42 20 20 52 31 2c 5b 52 30 5d 0a 20 | LDRB R1,[R0]. | 00000460 43 4d 50 20 20 20 52 31 2c 23 27 22 27 0a 20 41 |CMP R1,#'"'. A| 00000470 44 52 20 20 20 52 31 2c 74 61 73 6b 6e 61 6d 65 |DR R1,taskname| 00000480 0a 20 42 45 51 20 20 20 53 74 65 5f 31 0a 74 65 |. BEQ Ste_1.te| 00000490 5f 6c 33 0a 20 20 4c 44 52 42 20 20 52 32 2c 5b |_l3. LDRB R2,[| 000004a0 52 30 5d 2c 23 31 0a 20 20 43 4d 50 20 20 20 52 |R0],#1. CMP R| 000004b0 32 2c 23 30 0a 20 20 42 45 51 20 20 20 62 61 64 |2,#0. BEQ bad| 000004c0 5f 70 61 72 61 6d 73 0a 20 20 43 4d 50 20 20 20 |_params. CMP | 000004d0 52 32 2c 23 27 20 27 0a 20 20 53 54 52 4e 45 42 |R2,#' '. STRNEB| 000004e0 20 52 32 2c 5b 52 31 5d 2c 23 31 0a 20 42 4e 45 | R2,[R1],#1. BNE| 000004f0 20 20 20 74 65 5f 6c 33 0a 20 4d 4f 56 20 20 20 | te_l3. MOV | 00000500 52 32 2c 23 30 0a 20 53 54 52 42 20 20 52 32 2c |R2,#0. STRB R2,| 00000510 5b 52 31 5d 0a 52 74 65 5f 31 0a 20 20 20 3b 20 |[R1].Rte_1. ; | 00000520 6f 6e 65 20 77 61 79 20 6f 72 20 74 68 65 20 6f |one way or the o| 00000530 74 68 65 72 2c 20 74 68 65 20 74 61 73 6b 20 6e |ther, the task n| 00000540 61 6d 65 20 69 73 20 69 6e 20 74 61 73 6b 6e 61 |ame is in taskna| 00000550 6d 65 0a 20 20 20 3b 20 6e 6f 77 20 63 6f 70 79 |me. ; now copy| 00000560 20 74 68 65 20 72 65 73 74 20 6f 66 20 74 68 65 | the rest of the| 00000570 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 74 6f | command line to| 00000580 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e | the command lin| 00000590 65 2e 20 55 6e 73 61 66 65 20 74 6f 20 75 73 65 |e. Unsafe to use| 000005a0 20 69 74 20 27 69 6e 20 73 69 74 75 27 0a 20 41 | it 'in situ'. A| 000005b0 44 52 20 20 20 52 31 2c 63 6f 6d 6d 61 6e 64 0a |DR R1,command.| 000005c0 74 65 5f 6c 34 0a 20 20 4c 44 52 42 20 20 52 32 |te_l4. LDRB R2| 000005d0 2c 5b 52 30 5d 2c 23 31 0a 20 20 53 54 52 42 20 |,[R0],#1. STRB | 000005e0 20 52 32 2c 5b 52 31 5d 2c 23 31 0a 20 20 43 4d | R2,[R1],#1. CM| 000005f0 50 20 20 20 52 32 2c 23 30 0a 20 42 4e 45 20 20 |P R2,#0. BNE | 00000600 20 74 65 5f 6c 34 0a 0a 20 20 20 3b 20 72 69 67 | te_l4.. ; rig| 00000610 68 74 20 74 68 65 6e 2c 20 74 61 73 6b 20 6e 61 |ht then, task na| 00000620 6d 65 20 69 6e 20 74 61 73 6b 6e 61 6d 65 2c 20 |me in taskname, | 00000630 72 65 73 74 20 6f 66 20 63 6f 6d 6d 61 6e 64 20 |rest of command | 00000640 6c 69 6e 65 20 69 6e 20 63 6f 6d 6d 61 6e 64 2c |line in command,| 00000650 20 61 6e 64 0a 20 20 20 3b 20 69 6e 76 65 72 73 | and. ; invers| 00000660 65 20 73 65 74 20 63 6f 72 72 65 63 74 6c 79 0a |e set correctly.| 00000670 20 20 20 3b 20 67 6f 20 74 68 6f 75 67 68 20 74 | ; go though t| 00000680 61 73 6b 20 6e 61 6d 65 73 20 74 6f 20 73 65 65 |ask names to see| 00000690 20 69 66 20 69 74 20 69 73 20 70 72 65 73 65 6e | if it is presen| 000006a0 74 0a 20 4d 4f 56 20 20 20 52 30 2c 23 30 0a 74 |t. MOV R0,#0.t| 000006b0 65 5f 6c 35 0a 20 20 41 44 52 20 20 20 52 31 2c |e_l5. ADR R1,| 000006c0 62 75 66 66 65 72 0a 20 20 4d 4f 56 20 20 20 52 |buffer. MOV R| 000006d0 32 2c 23 62 75 66 66 65 72 5f 65 6e 64 20 2d 20 |2,#buffer_end - | 000006e0 62 75 66 66 65 72 0a 20 20 53 57 49 20 20 20 58 |buffer. SWI X| 000006f0 54 61 73 6b 4d 61 6e 61 67 65 72 5f 45 6e 75 6d |TaskManager_Enum| 00000700 65 72 61 74 65 54 61 73 6b 73 0a 20 20 42 56 53 |erateTasks. BVS| 00000710 20 20 20 74 61 73 6b 5f 6e 6f 74 5f 70 72 65 73 | task_not_pres| 00000720 65 6e 74 20 20 20 20 20 20 20 20 20 20 20 20 20 |ent | 00000730 20 3b 20 69 65 20 75 6e 64 65 72 20 4f 53 32 20 | ; ie under OS2 | 00000740 61 73 73 75 6d 65 20 74 68 61 74 20 74 68 65 20 |assume that the | 00000750 74 61 73 6b 20 69 73 20 6e 6f 74 20 70 72 65 73 |task is not pres| 00000760 65 6e 74 0a 0a 20 20 20 3b 20 63 6f 6d 70 61 72 |ent.. ; compar| 00000770 65 20 6e 61 6d 65 73 20 20 20 6e 6f 74 65 3a 20 |e names note: | 00000780 63 61 73 65 20 73 65 6e 73 69 74 69 76 65 0a 20 |case sensitive. | 00000790 20 4c 44 52 20 20 20 52 31 2c 62 75 66 66 65 72 | LDR R1,buffer| 000007a0 5f 6e 61 6d 65 0a 20 20 41 44 52 20 20 20 52 32 |_name. ADR R2| 000007b0 2c 74 61 73 6b 6e 61 6d 65 0a 74 65 5f 6c 35 5f |,taskname.te_l5_| 000007c0 31 0a 20 20 20 4c 44 52 42 20 20 52 33 2c 5b 52 |1. LDRB R3,[R| 000007d0 31 5d 2c 23 31 0a 20 20 20 4c 44 52 42 20 20 52 |1],#1. LDRB R| 000007e0 34 2c 5b 52 32 5d 2c 23 31 0a 20 20 20 43 4d 50 |4,[R2],#1. CMP| 000007f0 20 20 20 52 33 2c 23 33 32 0a 20 20 20 4d 4f 56 | R3,#32. MOV| 00000800 4c 54 20 52 33 2c 23 30 20 20 20 20 20 20 20 3b |LT R3,#0 ;| 00000810 20 66 6f 72 63 65 20 52 33 20 28 66 72 6f 6d 20 | force R3 (from | 00000820 74 61 73 6b 20 6e 61 6d 65 20 66 72 6f 6d 20 54 |task name from T| 00000830 61 73 6b 4d 61 6e 61 67 65 72 29 20 74 6f 20 30 |askManager) to 0| 00000840 20 69 66 20 69 74 20 69 73 20 61 20 63 6f 6e 74 | if it is a cont| 00000850 72 6f 6c 20 63 6f 64 65 0a 20 20 20 43 4d 50 20 |rol code. CMP | 00000860 20 20 52 33 2c 52 34 0a 20 20 20 42 4e 45 20 20 | R3,R4. BNE | 00000870 20 41 74 65 5f 6c 35 5f 31 0a 20 20 20 43 4d 50 | Ate_l5_1. CMP| 00000880 20 20 20 52 33 2c 23 30 0a 20 20 42 4e 45 20 20 | R3,#0. BNE | 00000890 20 74 65 5f 6c 35 5f 31 0a 20 20 42 20 20 20 20 | te_l5_1. B | 000008a0 20 74 61 73 6b 5f 70 72 65 73 65 6e 74 0a 41 74 | task_present.At| 000008b0 65 5f 6c 35 5f 31 0a 20 20 43 4d 50 20 20 20 52 |e_l5_1. CMP R| 000008c0 30 2c 23 30 0a 20 42 47 45 20 20 20 74 65 5f 6c |0,#0. BGE te_l| 000008d0 35 0a 0a 74 61 73 6b 5f 6e 6f 74 5f 70 72 65 73 |5..task_not_pres| 000008e0 65 6e 74 0a 20 4c 44 52 20 20 20 52 30 2c 69 6e |ent. LDR R0,in| 000008f0 76 65 72 73 65 0a 20 43 4d 50 20 20 20 52 30 2c |verse. CMP R0,| 00000900 23 74 72 75 65 0a 20 53 57 49 45 51 20 4f 53 5f |#true. SWIEQ OS_| 00000910 45 78 69 74 0a 72 75 6e 5f 63 6f 6d 6d 61 6e 64 |Exit.run_command| 00000920 0a 20 41 44 52 20 20 20 52 30 2c 63 6f 6d 6d 61 |. ADR R0,comma| 00000930 6e 64 0a 20 53 57 49 20 20 20 4f 53 5f 43 4c 49 |nd. SWI OS_CLI| 00000940 0a 20 53 57 49 20 20 20 4f 53 5f 45 78 69 74 20 |. SWI OS_Exit | 00000950 20 20 3b 20 69 6e 20 63 61 73 65 20 43 4c 49 20 | ; in case CLI | 00000960 72 65 74 75 72 6e 73 2c 20 77 68 69 63 68 20 69 |returns, which i| 00000970 74 20 69 73 20 6e 6f 74 20 75 6e 6c 69 6b 65 6c |t is not unlikel| 00000980 79 20 74 6f 20 64 6f 0a 0a 20 44 43 42 20 31 30 |y to do.. DCB 10| 00000990 2c 31 30 2c 22 a9 20 42 65 6e 20 53 75 6d 6d 65 |,10,". Ben Summe| 000009a0 72 73 20 31 39 39 33 22 2c 31 30 2c 31 30 0a 20 |rs 1993",10,10. | 000009b0 41 4c 49 47 4e 0a 0a 74 61 73 6b 5f 70 72 65 73 |ALIGN..task_pres| 000009c0 65 6e 74 0a 20 4c 44 52 20 20 20 52 30 2c 69 6e |ent. LDR R0,in| 000009d0 76 65 72 73 65 0a 20 43 4d 50 20 20 20 52 30 2c |verse. CMP R0,| 000009e0 23 74 72 75 65 0a 20 53 57 49 4e 45 20 4f 53 5f |#true. SWINE OS_| 000009f0 45 78 69 74 0a 20 42 20 20 20 20 20 72 75 6e 5f |Exit. B run_| 00000a00 63 6f 6d 6d 61 6e 64 0a 0a 62 61 64 5f 70 61 72 |command..bad_par| 00000a10 61 6d 73 5f 65 72 72 0a 20 44 43 44 20 30 0a 20 |ams_err. DCD 0. | 00000a20 44 43 42 20 22 42 61 64 20 61 72 67 75 6d 65 6e |DCB "Bad argumen| 00000a30 74 73 2c 20 73 79 6e 74 61 78 3a 20 54 61 73 6b |ts, syntax: Task| 00000a40 45 6e 73 75 72 65 20 5b 2d 70 5d 20 3c 74 61 73 |Ensure [-p] <tas| 00000a50 6b 20 6e 61 6d 65 3e 20 3c 63 6f 6d 6d 61 6e 64 |k name> <command| 00000a60 3e 22 2c 30 0a 20 41 4c 49 47 4e 0a 0a 62 61 64 |>",0. ALIGN..bad| 00000a70 5f 70 61 72 61 6d 73 0a 20 41 44 52 20 20 20 52 |_params. ADR R| 00000a80 30 2c 62 61 64 5f 70 61 72 61 6d 73 5f 65 72 72 |0,bad_params_err| 00000a90 0a 20 53 57 49 20 20 20 4f 53 5f 47 65 6e 65 72 |. SWI OS_Gener| 00000aa0 61 74 65 45 72 72 6f 72 0a 0a 53 74 65 5f 31 0a |ateError..Ste_1.| 00000ab0 53 74 65 5f 31 5f 6c 31 0a 20 20 4c 44 52 42 20 |Ste_1_l1. LDRB | 00000ac0 20 52 32 2c 5b 52 30 2c 23 31 5d 21 0a 20 20 43 | R2,[R0,#1]!. C| 00000ad0 4d 50 20 20 20 52 32 2c 23 30 0a 20 20 42 45 51 |MP R2,#0. BEQ| 00000ae0 20 20 20 62 61 64 5f 70 61 72 61 6d 73 0a 20 20 | bad_params. | 00000af0 43 4d 50 20 20 20 52 32 2c 23 27 22 27 0a 20 20 |CMP R2,#'"'. | 00000b00 53 54 52 4e 45 42 20 52 32 2c 5b 52 31 5d 2c 23 |STRNEB R2,[R1],#| 00000b10 31 0a 20 42 4e 45 20 20 20 53 74 65 5f 31 5f 6c |1. BNE Ste_1_l| 00000b20 31 0a 20 4d 4f 56 20 20 20 52 32 2c 23 30 0a 20 |1. MOV R2,#0. | 00000b30 53 54 52 42 20 20 52 32 2c 5b 52 31 5d 0a 20 4c |STRB R2,[R1]. L| 00000b40 44 52 42 20 20 52 32 2c 5b 52 30 2c 23 31 5d 20 |DRB R2,[R0,#1] | 00000b50 20 20 20 3b 20 63 68 61 72 20 61 66 74 65 72 20 | ; char after | 00000b60 22 0a 20 43 4d 50 20 20 20 52 32 2c 23 27 20 27 |". CMP R2,#' '| 00000b70 0a 20 42 4e 45 20 20 20 62 61 64 5f 70 61 72 61 |. BNE bad_para| 00000b80 6d 73 0a 20 41 44 44 20 20 20 52 30 2c 52 30 2c |ms. ADD R0,R0,| 00000b90 23 32 20 20 20 20 20 20 3b 20 6a 75 6d 70 20 6f |#2 ; jump o| 00000ba0 76 65 72 20 27 22 20 27 0a 20 42 20 20 20 20 20 |ver '" '. B | 00000bb0 52 74 65 5f 31 0a 0a 20 4c 54 4f 52 47 0a 20 5e |Rte_1.. LTORG. ^| 00000bc0 20 30 2c 52 31 32 0a 0a 74 61 73 6b 6e 61 6d 65 | 0,R12..taskname| 00000bd0 20 23 20 36 34 0a 69 6e 76 65 72 73 65 20 20 23 | # 64.inverse #| 00000be0 20 34 0a 63 6f 6d 6d 61 6e 64 20 20 23 20 32 35 | 4.command # 25| 00000bf0 36 0a 0a 62 75 66 66 65 72 20 20 20 20 20 20 20 |6..buffer | 00000c00 20 23 20 30 0a 62 75 66 66 65 72 5f 68 61 6e 64 | # 0.buffer_hand| 00000c10 6c 65 20 23 20 34 0a 62 75 66 66 65 72 5f 6e 61 |le # 4.buffer_na| 00000c20 6d 65 20 20 20 23 20 34 0a 62 75 66 66 65 72 5f |me # 4.buffer_| 00000c30 6d 65 6d 6f 72 79 20 23 20 34 0a 62 75 66 66 65 |memory # 4.buffe| 00000c40 72 5f 66 6c 61 67 73 20 20 23 20 34 0a 62 75 66 |r_flags # 4.buf| 00000c50 66 65 72 5f 65 6e 64 20 20 20 20 23 20 30 0a 0a |fer_end # 0..| 00000c60 20 45 4e 44 0a 0a 0a | END...| 00000c67