Home » Archimedes archive » Acorn User » AU 1996-03 B.adf » Regulars » StarInfo/Fletcher/!TaskKill/PatchBas

StarInfo/Fletcher/!TaskKill/PatchBas

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

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

Tape/disk: Home » Archimedes archive » Acorn User » AU 1996-03 B.adf » Regulars
Filename: StarInfo/Fletcher/!TaskKill/PatchBas
Read OK:
File size: 2EAB bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > Patch for memory compilation
   20REM Created by JFPatch LEN Justin Fletcher, 05 Sep 1995
   30REM Intermediate code file created 23 Sep 1995
   40ON ERROR PROCError:END
   50PROCpatch_loadfile
   60:
   70REM **** User pre-assembly ****
   80DIM message_buffer% 256
   90*| Set Risc OS Version number
  100*Set RO$Version 311
  110*RmEnsure UtilityModule 3.11 Set RO$Version 300
  120*RmEnsure UtilityModule 3.00 Set RO$Version 200
  130riscos$=FNsystemvar("RO$Version")
  140REM These numbers count from top left of keyboard to bottom right
  150REM ie Esc = 0, f1=1, f2=2, f3=3, .. f12=12, Print=13, ScrLock=14
  160REM    Break =14, ~=15, 1=16, 2=17,
  170REM    TAB   = 38, LCtrl = 58, LShift= 75, Caps= 92
  180REM
  190k1=&60:REM Right Alt key
  200IF riscos$="311" THENk2=&F :k2$="Break"
  210IF riscos$="300" THENk2=&E :k2$="Scroll-Lock"
  220k3=0  :REM Escape key
  230k4=36 :REM Keypad *
  240 PRINT "Do you want to assemble the wimp command prompt window ? (y/n) ";
  250 REPEAT:SYS "OS_Confirm" TO g:g$=CHR$g:UNTILINSTR("yn",g$)>0
  260 PRINTg$
  270 cond_enablewimp=INSTR("yY",g$)>0
  280REM # COND SET enablewimp FALSE
  290:
  300REM **** Main assembly routine ****
  310sp=13:link=14:pc=15
  320vbit=1<<28:cbit=1<<29:zbit=1<<30:nbit=1<<31
  330P%=&0:O%=MC%
  340FOR pass%=4 TO 6 STEP2
  350REM **** Start of main code ****
  360PROCpatch_setpc(0)
  370[OPT pass%
  380          ; **** Add module header ****
  390   EQUD 0                  ; Start offset
  400   EQUD initcode%          ; Initialisation offset
  410   EQUD finalcode%         ; Finalisation offset
  420   EQUD srvcode%           ; Service request offset
  430   EQUD module_title       ; Title string offset
  440   EQUD module_help        ; Help string offset
  450   EQUD module_commands    ; Help and command keyword table offset
  460:
  470.module_title
  480   EQUS "TaskKiller"+CHR$0
  490   ALIGN
  500:
  510.module_help
  520   EQUS "TaskKiller"+CHR$9+"1.06 ("+MID$(TIME$,5,11)+") � Justin Fletcher"+CHR$0
  530   ALIGN
  540:
  550; ***** Module commands table
  560.module_commands
  570   EQUS "TaskKiller"       ; Command name
  580   EQUB 0:ALIGN
  590   EQUD 0                  ; Code to call
  600   EQUD &0                 ; Flags
  610   EQUD 0                  ; Syntax pointer
  620   EQUD help_taskkiller    ; Help pointer
  630   EQUB 0
  640   ALIGN
  650:
  660; ***** Help and Syntax messages
  670.help_taskkiller
  680   EQUS "The Task killer module will attempt to kill a task which has crashed. "
  690   EQUS "When a task stops responding, use these keys, in order of priority :"+CHR$13
  700   EQUS "�1. Use Right-Alt and Escape to exit using error handler"+CHR$13
  710   EQUS "�2. Use Right-Alt and "+k2$+" to kill the task with a machette!"+CHR$13+CHR$13
  720   EQUS "�WARNING : Do NOT use these in a correctly functioning desktop"+CHR$13+CHR$13
  730   EQUS "The Task killer module can also be used to initiate a command prompt "
  740   EQUS "by Right-Alt-Keypad *. "
  750   EQUB 0
  760   ALIGN
  770:
  780          ; **** End of module header ****
  790:
  800.initcode%
  810    STMFD   (sp)!,{link}
  820    BL      doclaim
  830    LDMFD   (sp)!,{pc}
  840:
  850.srvcode%
  860    MOV     pc,link     ; ie return immediately
  870;    TEQ     R1,#&27    ; reset module
  880;    MOVNE   pc,link
  890:
  900.doclaim
  910    STMFD   (sp)!,{R0-R2,link}
  920    MOV     link,#0
  930    STR     link,doingnow
  940    STR     link,key1pressed
  950    STR     link,key2pressed
  960    STR     link,key3pressed
  970    STR     link,key4pressed
  980    MOV     R0,#&10               ; vector &10 ?
  990    ADR     R1,newvector%         ; to be processed at newvector%
 1000    BL      claimvector%
 1010    MOV     R0,#&0E
 1020    MOV     R1,#&0B
 1030    SWI     "XOS_Byte"            ; enable keypress vector
 1040    MOV     R0,#0
 1050    STRB    R0,[R12,#8]
 1060    LDMFD   (sp)!,{R0-R2,pc}
 1070:
 1080.finalcode%
 1090    STMFD   (sp)!,{R0-R2,link}
 1100    MOV     R0,#&0D
 1110    MOV     R1,#&0B
 1120    SWI     "XOS_Byte"            ; disable keypress vector
 1130    LDR     R12,[R12,#0]
 1140    MOV     R0,#&10
 1150    ADR     R1,newvector%
 1160    BL      releasevector%
 1170    LDMFD   (sp)!,{R0-R2,pc}
 1180:
 1190.claimvector%
 1200    STMFD   (sp)!,{R2,link}
 1210    BL      releasevector%
 1220    MOV     R2,#0
 1230    SWI     "XOS_Claim"
 1240    LDMFD   (sp)!,{R2,pc}^
 1250:
 1260.releasevector%
 1270    STMFD   (sp)!,{R0-R2,link}
 1280.retryrelease%
 1290    LDMFD   sp,{R0,R1}
 1300    MOV     R2,#0
 1310    SWI     "XOS_Release"
 1320    BVC     retryrelease%
 1330    CMP     pc,#0
 1340    LDMFD   (sp)!,{R0-R2,pc}
 1350:
 1360.newvector%
 1370    CMP     R0,#&0B                ; is this a keypress ?
 1380    MOVNE   pc,link                 ; if not exit
 1390    STMFD   (sp)!,{R0-r2,R4,R5,link} ; stack regs
 1400    MOV     r4,#0
 1410    CMP     R2,#k1                 ; code for key 1 (controlling key)
 1420    STREQ   R1,key1pressed
 1430    MOVEQ   r4,#1
 1440    BEQ     whichkeys%
 1450    CMP     R2,#k2                 ; code for key 2 (Kill task)
 1460    STREQ   R1,key2pressed
 1470    MOVEQ   r4,#1
 1480    CMP     R2,#k3                 ; code for key 3 (Error)
 1490    STREQ   R1,key3pressed
 1500    MOVEQ   r4,#1
 1510    CMP     R2,#k4                 ; code for key 4 (OSCLI)
 1520    STREQ   R1,key4pressed
 1530    MOVEQ   r4,#1
 1540    CMP     r4,#1
 1550    LDMNEFD (sp)!,{R0-R2,R4,R5,pc}
 1560:
 1570.whichkeys%
 1580    LDR     R2,key1pressed
 1590    TEQ     R2,#0
 1600    LDMEQFD (sp)!,{R0-R2,R4,R5,pc}
 1610    LDR     R2,key2pressed
 1620    TEQ     R2,#0
 1630    BEQ     testforkey3
 1640    ADR     r1,doexitcode%         ; r1=address to jump to
 1650.setupjump
 1660    MOV     R5,pc
 1670    BIC     R4,R5,#1
 1680    TEQP    R4,#1
 1690    MOV     R0,R0
 1700    STMFD   (sp)!,{link}
 1710    LDRB    R0,doingnow
 1720    TEQ     R0,#0
 1730    BNE     alreadydoing
 1740    MOV     r0,r1                  ; r0=address
 1750    MOV     R1,#0
 1760    SWI     "XOS_AddCallBack"
 1770    MOVVC   R0,#1
 1780    STRVCB  R0,doingnow          ; if ok then set doing
 1790.alreadydoing
 1800    LDMFD   (sp)!,{link}
 1810    TEQP    R5,#0
 1820    MOV     R0,R0
 1830    LDMFD   (sp)!,{R0-R2,R4,R5,pc}
 1840.testforkey3                     ; check that key 3 is pressed (Error)
 1850    LDR     R2,key3pressed
 1860    TEQ     R2,#0
 1870    BEQ     testforkey4
 1880    ADR     r1,doerrorcode%
 1890    B       setupjump
 1900:
 1910.testforkey4                     ; check that key 4 is pressed (OSCLI)
 1920    LDR     R2,key4pressed
 1930    TEQ     R2,#0
 1940    LDMEQFD (sp)!,{R0-R2,R4,R5,pc}
 1950    ADR     r1,doosclicode%
 1960    B       setupjump
 1970:
 1980.doexitcode%
 1990    STMFD   (sp)!,{link}
 2000    BL      delinkapplication
 2010    BL      restorebreak
 2020    MOV     R0,#0
 2030    STRB    R0,doingnow
 2040; code goes here -
 2050;   SWI     "OS_EnterOS"
 2060    SWI     "OS_Exit"
 2070; - to here
 2080    LDMFD   (sp)!,{pc}
 2090:
 2100.doerrorcode%
 2110    STMFD   (sp)!,{link}
 2120    BL      delinkapplication
 2130    BL      restorebreak
 2140    MOV     R0,#0
 2150    STRB    R0,doingnow
 2160; code goes here -
 2170 FNerror("Program terminated")
 2180; - to here
 2190    LDMFD   (sp)!,{pc}
 2200:
 2210.delinkapplication
 2220    STMFD   (sp)!,{r0-r12,link}
 2230    FNset_as_svc(pass%)
 2240.dla_loop
 2250    ADR     r0,buffer               ; buffer for previously linked vectors ?
 2260    MOV     r1,#32                  ; length of buffer
 2270    SWI     "XOS_DelinkApplication" ; remove any vectors used by application
 2280    CMP     r1,#0                   ; was the buffer full ?
 2290    BEQ     dla_loop                ; if it was, then go around again
 2300    FNrestore_mode(pass%)
 2310    LDMFD   (sp)!,{r0-r12,pc}^
 2320.buffer
 2330 FNreserve(32)
 2340          ; space for vector storage
 2350:
 2360:
 2370.doosclicode%
 2380    STMFD   (sp)!,{r0-r12,link}
 2390    FNset_as_svc(pass%)
 2400    BL      restorebreak
 2410; code goes here -
 2420    ADR     r0,wimpvar              ; address of wimp variable
 2430    ADR     r1,oscliline            ; address of buffer
 2440    MOV     r2,#255                 ; buffer length
 2450    MOV     r3,#0                   ; ?
 2460    MOV     r4,#3                   ; ?
 2470    SWI     "XOS_ReadVarVal"        ; read variable
 2480    BVS     exitoscli               ; exit if error
 2490    LDR     r0,[r1,#0]              ; get first word
 2500    LDR     r2,commandstring        ; read what it should be for comm
 2510    CMP     r0,r2                   ; compare
 2520    LDRNE   r0,[r1,#0]              ; get second word
 2530    LDRNE   r2,commandstring+4      ; read what it should be for ands
 2540    CMPNE   r0,r2                   ; compare
 2550    BNE     wimprunning
 2560.oscliloop
 2570    SWI     &100+ASC("*")
 2580    ADR     r0,oscliline        ; addr of buffer
 2590    MOV     r1,#&100            ; length of buffer
 2600    MOV     r2,#&20             ; min ascii accepted
 2610    MOV     r3,#&FF             ; max ascii accepted
 2620    SWI     "XOS_ReadLine"
 2630    BVS     osclierror          ; if error then process
 2640    CMP     r1,#0               ; if no characters typed then exit
 2650    BEQ     exitoscli
 2660    SWI     "XOS_CLI"           ; do command
 2670    BVC     oscliloop           ; if no error then loop around
 2680.osclierror
 2690    ADD     r0,r0,#4            ; skip error code byte
 2700    SWI     "OS_Write0"         ; write to screen
 2710    SWI     "OS_NewLine"
 2720    B       oscliloop
 2730.exitoscli
 2740    MOV     R0,#0
 2750    STRB    R0,doingnow
 2760; - to here
 2770    FNrestore_mode(pass%)
 2780    LDMFD   (sp)!,{r0-r12,pc}^
 2790:
 2800.wimprunning
 2810]
 2820IF cond_enablewimp THEN
 2830[ OPT pass%
 2840    ADR     r0,wimpcommand
 2850    SWI     "Wimp_StartTask"
 2860]
 2870ENDIF
 2880[ OPT pass%
 2890    B       exitoscli
 2900:
 2910.restorebreak
 2920    STMFD   (sp)!,{r8-r9,link}
 2930    FNset_as_svc(pass%)
 2940    MOV     r0,#200
 2950    MOV     r1,#0
 2960    SWI     "OS_Byte"            ; Clear Break/Escape disabled
 2970    MOV     r0,#229
 2980    MOV     r1,#0
 2990    SWI     "OS_Byte"            ; Enable Escape
 3000    FNrestore_mode(pass%)
 3010    LDMFD   (sp)!,{r8-r9,pc}
 3020:
 3030; variables
 3040.doingnow   :EQUD 0
 3050.key1pressed:EQUD 0
 3060.key2pressed:EQUD 0
 3070.key3pressed:EQUD 0
 3080.key4pressed:EQUD 0
 3090.oscliline
 3100 FNreserve(256)
 3110.wimpcommand:EQUS "GOS"+CHR$0:ALIGN
 3120.wimpvar    :EQUS "Wimp$State"+CHR$0:ALIGN
 3130.commandstring:EQUS "commands":ALIGN
 3140:
 3150]
 3160REM **** End of main code ****
 3170REM Set final pointer to find the length of the code
 3180PROCpatch_setpc(0)
 3190NEXT pass%
 3200PROCpatch_savefile
 3230REM **** Post-assembly user code *****
 3240REM *Run <TaskKiller$Dir>.TaskKiller
 3250END
 3260:
 3270:
 3280REM FNsystemvar : Return the contents of any string system var
 3290DEFFNsystemvar(Var$):LOCAL addr
 3300SYS "XOS_ReadVarVal",Var$,message_buffer%,255,0,3TO,,len
 3310message_buffer%?len=13
 3320=$message_buffer%
 3330:
 3340DEFFNset_as_svc(pass%)
 3350[OPT pass%
 3360     MOV     r9, pc          ; save current status/mode
 3370     ORR     r8, r9, #3      ; derive SVC-mode variation of it
 3380     TEQP    r8, #0          ; enter SVC mode
 3390     MOV     r0, r0          ; nop
 3400     MOV     r8, link        ; save r14_svc
 3410]:=pass%
 3420:
 3430DEFFNrestore_mode(pass%)
 3440[OPT pass%
 3450     MOV     link, r8        ; restore r14_svc
 3460     TEQP    r9, #0          ; re-enter original processor mode
 3470     MOV     r0, r0          ; nop
 3480]:=pass%
 3490REM **** Filing procedures ****
 3500:
 3510DEF PROCpatch_loadfile
 3520codelen=0
 3530DIM MC% &1400
 3540endofcode=codelen+&0:max=codelen
 3550L%=endofcode:__cap%=FALSE
 3650ENDPROC
 3660:
 3670DEF PROCpatch_savefile
 3680outfile$="<TaskKiller$Dir>.TaskKiller"
 3690OSCLI("Save "+outfile$+" "+STR$~MC%+" "+STR$~(max+MC%))
 3700OSCLI("Settype "+outfile$+" Module")
 3710patchdir$="<TaskKiller$Dir>"
 3750ENDPROC
 3760:
 3770REM **** Error Handler ****
 3780:
 3790DEFPROCError
 3870ERROR EXT ERR,REPORT$+" at line "+STR$ERL
 3880ENDPROC
 3890:
 3900REM **** Utility procedures ****
 3910:
 3920DEFPROCpatch_setpc(n)
 3930IF P%-&0>max THENmax=P%-&0
 3940P%=n:O%=MC%+n-&0
 3950ENDPROC
 3960:
 3970DEFFNfindfreereg(a,b,c,d):LOCAL n:n=0
 3980WHILE n=a OR n=b OR n=c OR n=d
 3990 n+=1
 4000ENDWHILE
 4010=n
 4020:
 4030REM FNreserve : Reserve space for x bytes
 4040DEFFNreserve(bytes):bytes=(bytes+3) AND -4
 4050IF (pass% AND 2)=2 THEN
 4060 LOCAL I:FOR I=0TObytes-4 STEP4:O%!I=0:NEXT
 4070ENDIF
 4080P%+=bytes:O%+=bytes
 4090=0
 4100:
 4110REM **** ERR macro procedure ****
 4120:
 4130REM FNerror : Create an error which is reported.
 4140DEFFNerror(a$)
 4150[OPT pass%
 4160  ADD    r0,pc,#0
 4170  SWI    "OS_GenerateError"
 4180  EQUD   1
 4190  EQUS   a$+CHR$0
 4200  ALIGN
 4210]
 4220=0
 4230:
32639REM JFPatch

$� > Patch for memory compilation
7� Created by JFPatch � Justin Fletcher, 05 Sep 1995
0� Intermediate code file created 23 Sep 1995
(� � �Error:�
2�patch_loadfile
<:
F!� **** User pre-assembly ****
P� message_buffer% 256
Z!*| Set Risc OS Version number
d*Set RO$Version 311
n3*RmEnsure UtilityModule 3.11 Set RO$Version 300
x3*RmEnsure UtilityModule 3.00 Set RO$Version 200
�$riscos$=�systemvar("RO$Version")
�C� These numbers count from top left of keyboard to bottom right
�C� ie Esc = 0, f1=1, f2=2, f3=3, .. f12=12, Print=13, ScrLock=14
�%�    Break =14, ~=15, 1=16, 2=17,
�5�    TAB   = 38, LCtrl = 58, LShift= 75, Caps= 92
��
�k1=&60:� Right Alt key
�'� riscos$="311" �k2=&F :k2$="Break"
�-� riscos$="300" �k2=&E :k2$="Scroll-Lock"
�k3=0  :� Escape key
�k4=36 :� Keypad *
�I � "Do you want to assemble the wimp command prompt window ? (y/n) ";
�- �:ș "OS_Confirm" � g:g$=�g:��"yn",g$)>0
 �g$
  cond_enablewimp=�"yY",g$)>0
!� # COND SET enablewimp FALSE
":
,%� **** Main assembly routine ****
6sp=13:link=14:pc=15
@/vbit=1<<28:cbit=1<<29:zbit=1<<30:nbit=1<<31
JP%=&0:O%=MC%
T� pass%=4 � 6 �2
^"� **** Start of main code ****
h�patch_setpc(0)
r[OPT pass%
|+          ; **** Add module header ****
�-   EQUD 0                  ; Start offset
�6   EQUD initcode%          ; Initialisation offset
�4   EQUD finalcode%         ; Finalisation offset
�7   EQUD srvcode%           ; Service request offset
�4   EQUD module_title       ; Title string offset
�3   EQUD module_help        ; Help string offset
�F   EQUD module_commands    ; Help and command keyword table offset
�:
�.module_title
�   EQUS "TaskKiller"+�0
�   ALIGN
�:
�.module_help
G   EQUS "TaskKiller"+�9+"1.06 ("+��$,5,11)+") � Justin Fletcher"+�0
   ALIGN
:
&!; ***** Module commands table
0.module_commands
:-   EQUS "TaskKiller"       ; Command name
D   EQUB 0:ALIGN
N-   EQUD 0                  ; Code to call
X&   EQUD &0                 ; Flags
b/   EQUD 0                  ; Syntax pointer
l-   EQUD help_taskkiller    ; Help pointer
v
   EQUB 0
�   ALIGN
�:
�$; ***** Help and Syntax messages
�.help_taskkiller
�T   EQUS "The Task killer module will attempt to kill a task which has crashed. "
�V   EQUS "When a task stops responding, use these keys, in order of priority :"+�13
�J   EQUS "�1. Use Right-Alt and Escape to exit using error handler"+�13
�U   EQUS "�2. Use Right-Alt and "+k2$+" to kill the task with a machette!"+�13+�13
�T   EQUS "�WARNING : Do NOT use these in a correctly functioning desktop"+�13+�13
�S   EQUS "The Task killer module can also be used to initiate a command prompt "
�%   EQUS "by Right-Alt-Keypad *. "
�
   EQUB 0
�   ALIGN
:
.          ; **** End of module header ****
:
 .initcode%
*    STMFD   (sp)!,{link}
4    BL      doclaim
>    LDMFD   (sp)!,{pc}
H:
R
.srvcode%
\3    MOV     pc,link     ; ie return immediately
f*;    TEQ     R1,#&27    ; reset module
p;    MOVNE   pc,link
z:
�.doclaim
�"    STMFD   (sp)!,{R0-R2,link}
�    MOV     link,#0
�    STR     link,doingnow
�     STR     link,key1pressed
�     STR     link,key2pressed
�     STR     link,key3pressed
�     STR     link,key4pressed
�4    MOV     R0,#&10               ; vector &10 ?
�E    ADR     R1,newvector%         ; to be processed at newvector%
�    BL      claimvector%
�    MOV     R0,#&0E
�    MOV     R1,#&0B
>    SWI     "XOS_Byte"            ; enable keypress vector
    MOV     R0,#0
    STRB    R0,[R12,#8]
$     LDMFD   (sp)!,{R0-R2,pc}
.:
8.finalcode%
B"    STMFD   (sp)!,{R0-R2,link}
L    MOV     R0,#&0D
V    MOV     R1,#&0B
`?    SWI     "XOS_Byte"            ; disable keypress vector
j    LDR     R12,[R12,#0]
t    MOV     R0,#&10
~    ADR     R1,newvector%
�    BL      releasevector%
�     LDMFD   (sp)!,{R0-R2,pc}
�:
�.claimvector%
�    STMFD   (sp)!,{R2,link}
�    BL      releasevector%
�    MOV     R2,#0
�    SWI     "XOS_Claim"
�    LDMFD   (sp)!,{R2,pc}^
�:
�.releasevector%
�"    STMFD   (sp)!,{R0-R2,link}
.retryrelease%

    LDMFD   sp,{R0,R1}
    MOV     R2,#0
    SWI     "XOS_Release"
(    BVC     retryrelease%
2    CMP     pc,#0
<     LDMFD   (sp)!,{R0-R2,pc}
F:
P.newvector%
Z=    CMP     R0,#&0B                ; is this a keypress ?
d5    MOVNE   pc,link                 ; if not exit
n5    STMFD   (sp)!,{R0-r2,R4,R5,link} ; stack regs
x    MOV     r4,#0
�I    CMP     R2,#k1                 ; code for key 1 (controlling key)
�    STREQ   R1,key1pressed
�    �Q   r4,#1
�    BEQ     whichkeys%
�C    CMP     R2,#k2                 ; code for key 2 (Kill task)
�    STREQ   R1,key2pressed
�    �Q   r4,#1
�?    CMP     R2,#k3                 ; code for key 3 (Error)
�    STREQ   R1,key3pressed
�    �Q   r4,#1
�;    CMP     R2,#k4                 ; code for key 4 (�)
�    STREQ   R1,key4pressed
�    �Q   r4,#1
    CMP     r4,#1
&    LDMNEFD (sp)!,{R0-R2,R4,R5,pc}
:
".whichkeys%
,    LDR     R2,key1pressed
6    TEQ     R2,#0
@&    LDMEQFD (sp)!,{R0-R2,R4,R5,pc}
J    LDR     R2,key2pressed
T    TEQ     R2,#0
^    BEQ     testforkey3
h>    ADR     r1,doexitcode%         ; r1=address to jump to
r.setupjump
|    MOV     R5,pc
�    BIC     R4,R5,#1
�    TEQP    R4,#1
�    MOV     R0,R0
�    STMFD   (sp)!,{link}
�    LDRB    R0,doingnow
�    TEQ     R0,#0
�    BNE     alreadydoing
�3    MOV     r0,r1                  ; r0=address
�    MOV     R1,#0
�!    SWI     "XOS_AddCallBack"
�    MOVVC   R0,#1
�;    STRVCB  R0,doingnow          ; if ok then set doing
�.alreadydoing
    LDMFD   (sp)!,{link}
    TEQP    R5,#0
    MOV     R0,R0
&&    LDMFD   (sp)!,{R0-R2,R4,R5,pc}
0J.testforkey3                     ; check that key 3 is pressed (Error)
:    LDR     R2,key3pressed
D    TEQ     R2,#0
N    BEQ     testforkey4
X    ADR     r1,doerrorcode%
b    B       setupjump
l:
vF.testforkey4                     ; check that key 4 is pressed (�)
�    LDR     R2,key4pressed
�    TEQ     R2,#0
�&    LDMEQFD (sp)!,{R0-R2,R4,R5,pc}
�    ADR     r1,doosclicode%
�    B       setupjump
�:
�.doexitcode%
�    STMFD   (sp)!,{link}
�!    BL      delinkapplication
�    BL      restorebreak
�    MOV     R0,#0
�    STRB    R0,doingnow
�; code goes here -
;   SWI     "OS_EnterOS"
    SWI     "OS_Exit"
; - to here
     LDMFD   (sp)!,{pc}
*:
4.doerrorcode%
>    STMFD   (sp)!,{link}
H!    BL      delinkapplication
R    BL      restorebreak
\    MOV     R0,#0
f    STRB    R0,doingnow
p; code goes here -
z! �error("Program terminated")
�; - to here
�    LDMFD   (sp)!,{pc}
�:
�.delinkapplication
�#    STMFD   (sp)!,{r0-r12,link}
�    �set_as_svc(pass%)
�
.dla_loop
�P    ADR     r0,buffer               ; buffer for previously linked vectors ?
�:    MOV     r1,#32                  ; length of buffer
�P    SWI     "XOS_DelinkApplication" ; remove any vectors used by application
�?    CMP     r1,#0                   ; was the buffer full ?
�I    BEQ     dla_loop                ; if it was, then go around again
�    �restore_mode(pass%)
	"    LDMFD   (sp)!,{r0-r12,pc}^
	.buffer
	 �reserve(32)
	$(          ; space for vector storage
	.:
	8:
	B.doosclicode%
	L#    STMFD   (sp)!,{r0-r12,link}
	V    �set_as_svc(pass%)
	`    BL      restorebreak
	j; code goes here -
	tB    ADR     r0,wimpvar              ; address of wimp variable
	~;    ADR     r1,oscliline            ; address of buffer
	�7    MOV     r2,#255                 ; buffer length
	�+    MOV     r3,#0                   ; ?
	�+    MOV     r4,#3                   ; ?
	�7    SWI     "XOS_ReadVarVal"        ; read variable
	�7    BVS     exitoscli               ; exit if error
	�8    LDR     r0,[r1,#0]              ; get first word
	�I    LDR     r2,commandstring        ; read what it should be for comm
	�1    CMP     r0,r2                   ; compare
	�9    LDRNE   r0,[r1,#0]              ; get second word
	�I    LDRNE   r2,commandstring+4      ; read what it should be for ands
	�1    CMPNE   r0,r2                   ; compare
	�    BNE     wimprunning
.oscliloop

    SWI     &100+�("*")
4    ADR     r0,oscliline        ; addr of buffer
6    MOV     r1,#&100            ; length of buffer
(8    MOV     r2,#&20             ; min ascii accepted
28    MOV     r3,#&FF             ; max ascii accepted
<    SWI     "XOS_ReadLine"
F;    BVS     osclierror          ; if error then process
PF    CMP     r1,#0               ; if no characters typed then exit
Z    BEQ     exitoscli
d0    SWI     "XOS_CLI"           ; do command
nB    BVC     oscliloop           ; if no error then loop around
x.osclierror
�:    ADD     r0,r0,#4            ; skip error code byte
�5    SWI     "OS_Write0"         ; write to screen
�    SWI     "OS_NewLine"
�    B       oscliloop
�.exitoscli
�    MOV     R0,#0
�    STRB    R0,doingnow
�; - to here
�    �restore_mode(pass%)
�"    LDMFD   (sp)!,{r0-r12,pc}^
�:
�.wimprunning
�]
� cond_enablewimp �
[ OPT pass%
    ADR     r0,wimpcommand
"     SWI     "Wimp_StartTask"
,]
6�
@[ OPT pass%
J    B       exitoscli
T:
^.restorebreak
h"    STMFD   (sp)!,{r8-r9,link}
r    �set_as_svc(pass%)
|    MOV     r0,#200
�    MOV     r1,#0
�B    SWI     "OS_Byte"            ; Clear Break/Escape disabled
�    MOV     r0,#229
�    MOV     r1,#0
�4    SWI     "OS_Byte"            ; Enable Escape
�    �restore_mode(pass%)
�     LDMFD   (sp)!,{r8-r9,pc}
�:
�; variables
�.doingnow   :EQUD 0
�.key1pressed:EQUD 0
�.key2pressed:EQUD 0
�.key3pressed:EQUD 0
.key4pressed:EQUD 0
.oscliline
 �reserve(256)
&$.wimpcommand:EQUS "GOS"+�0:ALIGN
0+.wimpvar    :EQUS "Wimp$State"+�0:ALIGN
:(.commandstring:EQUS "commands":ALIGN
D:
N]
X � **** End of main code ****
b6� Set final pointer to find the length of the code
l�patch_setpc(0)
v� pass%
��patch_savefile
�(� **** Post-assembly user code *****
�&� *Run <TaskKiller$Dir>.TaskKiller
��
�:
�:
�@� FNsystemvar : Return the contents of any string system var
�ݤsystemvar(Var$):� addr
�:ș "XOS_ReadVarVal",Var$,message_buffer%,255,0,3�,,len
�message_buffer%?len=13
�=$message_buffer%

:

ݤset_as_svc(pass%)

[OPT pass%

 ;     MOV     r9, pc          ; save current status/mode

*A     �R     r8, r9, #3      ; derive SVC-mode variation of it

41     TEQP    r8, #0          ; enter SVC mode

>&     MOV     r0, r0          ; nop

H/     MOV     r8, link        ; save r14_svc

R]:=pass%

\:

fݤrestore_mode(pass%)

p[OPT pass%

z2     MOV     link, r8        ; restore r14_svc

�C     TEQP    r9, #0          ; re-enter original processor mode

�&     MOV     r0, r0          ; nop

�]:=pass%

�!� **** Filing procedures ****

�:

�� �patch_loadfile

�
codelen=0

�� MC% &1400

�$endofcode=codelen+&0:max=codelen

�L%=endofcode:__cap%=�
B�
L:
V� �patch_savefile
`*outfile$="<TaskKiller$Dir>.TaskKiller"
j1�("Save "+outfile$+" "+�~MC%+" "+�~(max+MC%))
t$�("Settype "+outfile$+" Module")
~ patchdir$="<TaskKiller$Dir>"
��
�:
�� **** Error Handler ****
�:
���Error
� � �,�$+" at line "+Þ
(�
2:
<"� **** Utility procedures ****
F:
P��patch_setpc(n)
Z� P%-&0>max �max=P%-&0
dP%=n:O%=MC%+n-&0
n�
x:
�"ݤfindfreereg(a,b,c,d):� n:n=0
�ȕ n=a � n=b � n=c � n=d
�	 n+=1
��
�=n
�:
�+� FNreserve : Reserve space for x bytes
�)ݤreserve(bytes):bytes=(bytes+3) � -4
�� (pass% � 2)=2 �
�" � I:� I=0�bytes-4 �4:O%!I=0:�
��
�P%+=bytes:O%+=bytes
�=0
:
#� **** ERR macro procedure ****
:
"2� FNerror : Create an error which is reported.
,ݤerror(a$)
6[OPT pass%
@  ADD    r0,pc,#0
J  SWI    "OS_GenerateError"
T  EQUD   1
^  EQUS   a$+�0
h  ALIGN
r]
|=0
�:

� JFPatch
�
00000000  0d 00 0a 24 f4 20 3e 20  50 61 74 63 68 20 66 6f  |...$. > Patch fo|
00000010  72 20 6d 65 6d 6f 72 79  20 63 6f 6d 70 69 6c 61  |r memory compila|
00000020  74 69 6f 6e 0d 00 14 37  f4 20 43 72 65 61 74 65  |tion...7. Create|
00000030  64 20 62 79 20 4a 46 50  61 74 63 68 20 a9 20 4a  |d by JFPatch . J|
00000040  75 73 74 69 6e 20 46 6c  65 74 63 68 65 72 2c 20  |ustin Fletcher, |
00000050  30 35 20 53 65 70 20 31  39 39 35 0d 00 1e 30 f4  |05 Sep 1995...0.|
00000060  20 49 6e 74 65 72 6d 65  64 69 61 74 65 20 63 6f  | Intermediate co|
00000070  64 65 20 66 69 6c 65 20  63 72 65 61 74 65 64 20  |de file created |
00000080  32 33 20 53 65 70 20 31  39 39 35 0d 00 28 10 ee  |23 Sep 1995..(..|
00000090  20 85 20 f2 45 72 72 6f  72 3a e0 0d 00 32 13 f2  | . .Error:...2..|
000000a0  70 61 74 63 68 5f 6c 6f  61 64 66 69 6c 65 0d 00  |patch_loadfile..|
000000b0  3c 05 3a 0d 00 46 21 f4  20 2a 2a 2a 2a 20 55 73  |<.:..F!. **** Us|
000000c0  65 72 20 70 72 65 2d 61  73 73 65 6d 62 6c 79 20  |er pre-assembly |
000000d0  2a 2a 2a 2a 0d 00 50 19  de 20 6d 65 73 73 61 67  |****..P.. messag|
000000e0  65 5f 62 75 66 66 65 72  25 20 32 35 36 0d 00 5a  |e_buffer% 256..Z|
000000f0  21 2a 7c 20 53 65 74 20  52 69 73 63 20 4f 53 20  |!*| Set Risc OS |
00000100  56 65 72 73 69 6f 6e 20  6e 75 6d 62 65 72 0d 00  |Version number..|
00000110  64 17 2a 53 65 74 20 52  4f 24 56 65 72 73 69 6f  |d.*Set RO$Versio|
00000120  6e 20 33 31 31 0d 00 6e  33 2a 52 6d 45 6e 73 75  |n 311..n3*RmEnsu|
00000130  72 65 20 55 74 69 6c 69  74 79 4d 6f 64 75 6c 65  |re UtilityModule|
00000140  20 33 2e 31 31 20 53 65  74 20 52 4f 24 56 65 72  | 3.11 Set RO$Ver|
00000150  73 69 6f 6e 20 33 30 30  0d 00 78 33 2a 52 6d 45  |sion 300..x3*RmE|
00000160  6e 73 75 72 65 20 55 74  69 6c 69 74 79 4d 6f 64  |nsure UtilityMod|
00000170  75 6c 65 20 33 2e 30 30  20 53 65 74 20 52 4f 24  |ule 3.00 Set RO$|
00000180  56 65 72 73 69 6f 6e 20  32 30 30 0d 00 82 24 72  |Version 200...$r|
00000190  69 73 63 6f 73 24 3d a4  73 79 73 74 65 6d 76 61  |iscos$=.systemva|
000001a0  72 28 22 52 4f 24 56 65  72 73 69 6f 6e 22 29 0d  |r("RO$Version").|
000001b0  00 8c 43 f4 20 54 68 65  73 65 20 6e 75 6d 62 65  |..C. These numbe|
000001c0  72 73 20 63 6f 75 6e 74  20 66 72 6f 6d 20 74 6f  |rs count from to|
000001d0  70 20 6c 65 66 74 20 6f  66 20 6b 65 79 62 6f 61  |p left of keyboa|
000001e0  72 64 20 74 6f 20 62 6f  74 74 6f 6d 20 72 69 67  |rd to bottom rig|
000001f0  68 74 0d 00 96 43 f4 20  69 65 20 45 73 63 20 3d  |ht...C. ie Esc =|
00000200  20 30 2c 20 66 31 3d 31  2c 20 66 32 3d 32 2c 20  | 0, f1=1, f2=2, |
00000210  66 33 3d 33 2c 20 2e 2e  20 66 31 32 3d 31 32 2c  |f3=3, .. f12=12,|
00000220  20 50 72 69 6e 74 3d 31  33 2c 20 53 63 72 4c 6f  | Print=13, ScrLo|
00000230  63 6b 3d 31 34 0d 00 a0  25 f4 20 20 20 20 42 72  |ck=14...%.    Br|
00000240  65 61 6b 20 3d 31 34 2c  20 7e 3d 31 35 2c 20 31  |eak =14, ~=15, 1|
00000250  3d 31 36 2c 20 32 3d 31  37 2c 0d 00 aa 35 f4 20  |=16, 2=17,...5. |
00000260  20 20 20 54 41 42 20 20  20 3d 20 33 38 2c 20 4c  |   TAB   = 38, L|
00000270  43 74 72 6c 20 3d 20 35  38 2c 20 4c 53 68 69 66  |Ctrl = 58, LShif|
00000280  74 3d 20 37 35 2c 20 43  61 70 73 3d 20 39 32 0d  |t= 75, Caps= 92.|
00000290  00 b4 05 f4 0d 00 be 1a  6b 31 3d 26 36 30 3a f4  |........k1=&60:.|
000002a0  20 52 69 67 68 74 20 41  6c 74 20 6b 65 79 0d 00  | Right Alt key..|
000002b0  c8 27 e7 20 72 69 73 63  6f 73 24 3d 22 33 31 31  |.'. riscos$="311|
000002c0  22 20 8c 6b 32 3d 26 46  20 3a 6b 32 24 3d 22 42  |" .k2=&F :k2$="B|
000002d0  72 65 61 6b 22 0d 00 d2  2d e7 20 72 69 73 63 6f  |reak"...-. risco|
000002e0  73 24 3d 22 33 30 30 22  20 8c 6b 32 3d 26 45 20  |s$="300" .k2=&E |
000002f0  3a 6b 32 24 3d 22 53 63  72 6f 6c 6c 2d 4c 6f 63  |:k2$="Scroll-Loc|
00000300  6b 22 0d 00 dc 17 6b 33  3d 30 20 20 3a f4 20 45  |k"....k3=0  :. E|
00000310  73 63 61 70 65 20 6b 65  79 0d 00 e6 15 6b 34 3d  |scape key....k4=|
00000320  33 36 20 3a f4 20 4b 65  79 70 61 64 20 2a 0d 00  |36 :. Keypad *..|
00000330  f0 49 20 f1 20 22 44 6f  20 79 6f 75 20 77 61 6e  |.I . "Do you wan|
00000340  74 20 74 6f 20 61 73 73  65 6d 62 6c 65 20 74 68  |t to assemble th|
00000350  65 20 77 69 6d 70 20 63  6f 6d 6d 61 6e 64 20 70  |e wimp command p|
00000360  72 6f 6d 70 74 20 77 69  6e 64 6f 77 20 3f 20 28  |rompt window ? (|
00000370  79 2f 6e 29 20 22 3b 0d  00 fa 2d 20 f5 3a c8 99  |y/n) ";...- .:..|
00000380  20 22 4f 53 5f 43 6f 6e  66 69 72 6d 22 20 b8 20  | "OS_Confirm" . |
00000390  67 3a 67 24 3d bd 67 3a  fd a7 22 79 6e 22 2c 67  |g:g$=.g:.."yn",g|
000003a0  24 29 3e 30 0d 01 04 08  20 f1 67 24 0d 01 0e 20  |$)>0.... .g$... |
000003b0  20 63 6f 6e 64 5f 65 6e  61 62 6c 65 77 69 6d 70  | cond_enablewimp|
000003c0  3d a7 22 79 59 22 2c 67  24 29 3e 30 0d 01 18 21  |=."yY",g$)>0...!|
000003d0  f4 20 23 20 43 4f 4e 44  20 53 45 54 20 65 6e 61  |. # COND SET ena|
000003e0  62 6c 65 77 69 6d 70 20  46 41 4c 53 45 0d 01 22  |blewimp FALSE.."|
000003f0  05 3a 0d 01 2c 25 f4 20  2a 2a 2a 2a 20 4d 61 69  |.:..,%. **** Mai|
00000400  6e 20 61 73 73 65 6d 62  6c 79 20 72 6f 75 74 69  |n assembly routi|
00000410  6e 65 20 2a 2a 2a 2a 0d  01 36 17 73 70 3d 31 33  |ne ****..6.sp=13|
00000420  3a 6c 69 6e 6b 3d 31 34  3a 70 63 3d 31 35 0d 01  |:link=14:pc=15..|
00000430  40 2f 76 62 69 74 3d 31  3c 3c 32 38 3a 63 62 69  |@/vbit=1<<28:cbi|
00000440  74 3d 31 3c 3c 32 39 3a  7a 62 69 74 3d 31 3c 3c  |t=1<<29:zbit=1<<|
00000450  33 30 3a 6e 62 69 74 3d  31 3c 3c 33 31 0d 01 4a  |30:nbit=1<<31..J|
00000460  10 50 25 3d 26 30 3a 4f  25 3d 4d 43 25 0d 01 54  |.P%=&0:O%=MC%..T|
00000470  14 e3 20 70 61 73 73 25  3d 34 20 b8 20 36 20 88  |.. pass%=4 . 6 .|
00000480  32 0d 01 5e 22 f4 20 2a  2a 2a 2a 20 53 74 61 72  |2..^". **** Star|
00000490  74 20 6f 66 20 6d 61 69  6e 20 63 6f 64 65 20 2a  |t of main code *|
000004a0  2a 2a 2a 0d 01 68 13 f2  70 61 74 63 68 5f 73 65  |***..h..patch_se|
000004b0  74 70 63 28 30 29 0d 01  72 0e 5b 4f 50 54 20 70  |tpc(0)..r.[OPT p|
000004c0  61 73 73 25 0d 01 7c 2b  20 20 20 20 20 20 20 20  |ass%..|+        |
000004d0  20 20 3b 20 2a 2a 2a 2a  20 41 64 64 20 6d 6f 64  |  ; **** Add mod|
000004e0  75 6c 65 20 68 65 61 64  65 72 20 2a 2a 2a 2a 0d  |ule header ****.|
000004f0  01 86 2d 20 20 20 45 51  55 44 20 30 20 20 20 20  |..-   EQUD 0    |
00000500  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00000510  53 74 61 72 74 20 6f 66  66 73 65 74 0d 01 90 36  |Start offset...6|
00000520  20 20 20 45 51 55 44 20  69 6e 69 74 63 6f 64 65  |   EQUD initcode|
00000530  25 20 20 20 20 20 20 20  20 20 20 3b 20 49 6e 69  |%          ; Ini|
00000540  74 69 61 6c 69 73 61 74  69 6f 6e 20 6f 66 66 73  |tialisation offs|
00000550  65 74 0d 01 9a 34 20 20  20 45 51 55 44 20 66 69  |et...4   EQUD fi|
00000560  6e 61 6c 63 6f 64 65 25  20 20 20 20 20 20 20 20  |nalcode%        |
00000570  20 3b 20 46 69 6e 61 6c  69 73 61 74 69 6f 6e 20  | ; Finalisation |
00000580  6f 66 66 73 65 74 0d 01  a4 37 20 20 20 45 51 55  |offset...7   EQU|
00000590  44 20 73 72 76 63 6f 64  65 25 20 20 20 20 20 20  |D srvcode%      |
000005a0  20 20 20 20 20 3b 20 53  65 72 76 69 63 65 20 72  |     ; Service r|
000005b0  65 71 75 65 73 74 20 6f  66 66 73 65 74 0d 01 ae  |equest offset...|
000005c0  34 20 20 20 45 51 55 44  20 6d 6f 64 75 6c 65 5f  |4   EQUD module_|
000005d0  74 69 74 6c 65 20 20 20  20 20 20 20 3b 20 54 69  |title       ; Ti|
000005e0  74 6c 65 20 73 74 72 69  6e 67 20 6f 66 66 73 65  |tle string offse|
000005f0  74 0d 01 b8 33 20 20 20  45 51 55 44 20 6d 6f 64  |t...3   EQUD mod|
00000600  75 6c 65 5f 68 65 6c 70  20 20 20 20 20 20 20 20  |ule_help        |
00000610  3b 20 48 65 6c 70 20 73  74 72 69 6e 67 20 6f 66  |; Help string of|
00000620  66 73 65 74 0d 01 c2 46  20 20 20 45 51 55 44 20  |fset...F   EQUD |
00000630  6d 6f 64 75 6c 65 5f 63  6f 6d 6d 61 6e 64 73 20  |module_commands |
00000640  20 20 20 3b 20 48 65 6c  70 20 61 6e 64 20 63 6f  |   ; Help and co|
00000650  6d 6d 61 6e 64 20 6b 65  79 77 6f 72 64 20 74 61  |mmand keyword ta|
00000660  62 6c 65 20 6f 66 66 73  65 74 0d 01 cc 05 3a 0d  |ble offset....:.|
00000670  01 d6 11 2e 6d 6f 64 75  6c 65 5f 74 69 74 6c 65  |....module_title|
00000680  0d 01 e0 1b 20 20 20 45  51 55 53 20 22 54 61 73  |....   EQUS "Tas|
00000690  6b 4b 69 6c 6c 65 72 22  2b bd 30 0d 01 ea 0c 20  |kKiller"+.0.... |
000006a0  20 20 41 4c 49 47 4e 0d  01 f4 05 3a 0d 01 fe 10  |  ALIGN....:....|
000006b0  2e 6d 6f 64 75 6c 65 5f  68 65 6c 70 0d 02 08 47  |.module_help...G|
000006c0  20 20 20 45 51 55 53 20  22 54 61 73 6b 4b 69 6c  |   EQUS "TaskKil|
000006d0  6c 65 72 22 2b bd 39 2b  22 31 2e 30 36 20 28 22  |ler"+.9+"1.06 ("|
000006e0  2b c1 91 24 2c 35 2c 31  31 29 2b 22 29 20 a9 20  |+..$,5,11)+") . |
000006f0  4a 75 73 74 69 6e 20 46  6c 65 74 63 68 65 72 22  |Justin Fletcher"|
00000700  2b bd 30 0d 02 12 0c 20  20 20 41 4c 49 47 4e 0d  |+.0....   ALIGN.|
00000710  02 1c 05 3a 0d 02 26 21  3b 20 2a 2a 2a 2a 2a 20  |...:..&!; ***** |
00000720  4d 6f 64 75 6c 65 20 63  6f 6d 6d 61 6e 64 73 20  |Module commands |
00000730  74 61 62 6c 65 0d 02 30  14 2e 6d 6f 64 75 6c 65  |table..0..module|
00000740  5f 63 6f 6d 6d 61 6e 64  73 0d 02 3a 2d 20 20 20  |_commands..:-   |
00000750  45 51 55 53 20 22 54 61  73 6b 4b 69 6c 6c 65 72  |EQUS "TaskKiller|
00000760  22 20 20 20 20 20 20 20  3b 20 43 6f 6d 6d 61 6e  |"       ; Comman|
00000770  64 20 6e 61 6d 65 0d 02  44 13 20 20 20 45 51 55  |d name..D.   EQU|
00000780  42 20 30 3a 41 4c 49 47  4e 0d 02 4e 2d 20 20 20  |B 0:ALIGN..N-   |
00000790  45 51 55 44 20 30 20 20  20 20 20 20 20 20 20 20  |EQUD 0          |
000007a0  20 20 20 20 20 20 20 20  3b 20 43 6f 64 65 20 74  |        ; Code t|
000007b0  6f 20 63 61 6c 6c 0d 02  58 26 20 20 20 45 51 55  |o call..X&   EQU|
000007c0  44 20 26 30 20 20 20 20  20 20 20 20 20 20 20 20  |D &0            |
000007d0  20 20 20 20 20 3b 20 46  6c 61 67 73 0d 02 62 2f  |     ; Flags..b/|
000007e0  20 20 20 45 51 55 44 20  30 20 20 20 20 20 20 20  |   EQUD 0       |
000007f0  20 20 20 20 20 20 20 20  20 20 20 3b 20 53 79 6e  |           ; Syn|
00000800  74 61 78 20 70 6f 69 6e  74 65 72 0d 02 6c 2d 20  |tax pointer..l- |
00000810  20 20 45 51 55 44 20 68  65 6c 70 5f 74 61 73 6b  |  EQUD help_task|
00000820  6b 69 6c 6c 65 72 20 20  20 20 3b 20 48 65 6c 70  |killer    ; Help|
00000830  20 70 6f 69 6e 74 65 72  0d 02 76 0d 20 20 20 45  | pointer..v.   E|
00000840  51 55 42 20 30 0d 02 80  0c 20 20 20 41 4c 49 47  |QUB 0....   ALIG|
00000850  4e 0d 02 8a 05 3a 0d 02  94 24 3b 20 2a 2a 2a 2a  |N....:...$; ****|
00000860  2a 20 48 65 6c 70 20 61  6e 64 20 53 79 6e 74 61  |* Help and Synta|
00000870  78 20 6d 65 73 73 61 67  65 73 0d 02 9e 14 2e 68  |x messages.....h|
00000880  65 6c 70 5f 74 61 73 6b  6b 69 6c 6c 65 72 0d 02  |elp_taskkiller..|
00000890  a8 54 20 20 20 45 51 55  53 20 22 54 68 65 20 54  |.T   EQUS "The T|
000008a0  61 73 6b 20 6b 69 6c 6c  65 72 20 6d 6f 64 75 6c  |ask killer modul|
000008b0  65 20 77 69 6c 6c 20 61  74 74 65 6d 70 74 20 74  |e will attempt t|
000008c0  6f 20 6b 69 6c 6c 20 61  20 74 61 73 6b 20 77 68  |o kill a task wh|
000008d0  69 63 68 20 68 61 73 20  63 72 61 73 68 65 64 2e  |ich has crashed.|
000008e0  20 22 0d 02 b2 56 20 20  20 45 51 55 53 20 22 57  | "...V   EQUS "W|
000008f0  68 65 6e 20 61 20 74 61  73 6b 20 73 74 6f 70 73  |hen a task stops|
00000900  20 72 65 73 70 6f 6e 64  69 6e 67 2c 20 75 73 65  | responding, use|
00000910  20 74 68 65 73 65 20 6b  65 79 73 2c 20 69 6e 20  | these keys, in |
00000920  6f 72 64 65 72 20 6f 66  20 70 72 69 6f 72 69 74  |order of priorit|
00000930  79 20 3a 22 2b bd 31 33  0d 02 bc 4a 20 20 20 45  |y :"+.13...J   E|
00000940  51 55 53 20 22 a0 31 2e  20 55 73 65 20 52 69 67  |QUS ".1. Use Rig|
00000950  68 74 2d 41 6c 74 20 61  6e 64 20 45 73 63 61 70  |ht-Alt and Escap|
00000960  65 20 74 6f 20 65 78 69  74 20 75 73 69 6e 67 20  |e to exit using |
00000970  65 72 72 6f 72 20 68 61  6e 64 6c 65 72 22 2b bd  |error handler"+.|
00000980  31 33 0d 02 c6 55 20 20  20 45 51 55 53 20 22 a0  |13...U   EQUS ".|
00000990  32 2e 20 55 73 65 20 52  69 67 68 74 2d 41 6c 74  |2. Use Right-Alt|
000009a0  20 61 6e 64 20 22 2b 6b  32 24 2b 22 20 74 6f 20  | and "+k2$+" to |
000009b0  6b 69 6c 6c 20 74 68 65  20 74 61 73 6b 20 77 69  |kill the task wi|
000009c0  74 68 20 61 20 6d 61 63  68 65 74 74 65 21 22 2b  |th a machette!"+|
000009d0  bd 31 33 2b bd 31 33 0d  02 d0 54 20 20 20 45 51  |.13+.13...T   EQ|
000009e0  55 53 20 22 a0 57 41 52  4e 49 4e 47 20 3a 20 44  |US ".WARNING : D|
000009f0  6f 20 4e 4f 54 20 75 73  65 20 74 68 65 73 65 20  |o NOT use these |
00000a00  69 6e 20 61 20 63 6f 72  72 65 63 74 6c 79 20 66  |in a correctly f|
00000a10  75 6e 63 74 69 6f 6e 69  6e 67 20 64 65 73 6b 74  |unctioning deskt|
00000a20  6f 70 22 2b bd 31 33 2b  bd 31 33 0d 02 da 53 20  |op"+.13+.13...S |
00000a30  20 20 45 51 55 53 20 22  54 68 65 20 54 61 73 6b  |  EQUS "The Task|
00000a40  20 6b 69 6c 6c 65 72 20  6d 6f 64 75 6c 65 20 63  | killer module c|
00000a50  61 6e 20 61 6c 73 6f 20  62 65 20 75 73 65 64 20  |an also be used |
00000a60  74 6f 20 69 6e 69 74 69  61 74 65 20 61 20 63 6f  |to initiate a co|
00000a70  6d 6d 61 6e 64 20 70 72  6f 6d 70 74 20 22 0d 02  |mmand prompt "..|
00000a80  e4 25 20 20 20 45 51 55  53 20 22 62 79 20 52 69  |.%   EQUS "by Ri|
00000a90  67 68 74 2d 41 6c 74 2d  4b 65 79 70 61 64 20 2a  |ght-Alt-Keypad *|
00000aa0  2e 20 22 0d 02 ee 0d 20  20 20 45 51 55 42 20 30  |. "....   EQUB 0|
00000ab0  0d 02 f8 0c 20 20 20 41  4c 49 47 4e 0d 03 02 05  |....   ALIGN....|
00000ac0  3a 0d 03 0c 2e 20 20 20  20 20 20 20 20 20 20 3b  |:....          ;|
00000ad0  20 2a 2a 2a 2a 20 45 6e  64 20 6f 66 20 6d 6f 64  | **** End of mod|
00000ae0  75 6c 65 20 68 65 61 64  65 72 20 2a 2a 2a 2a 0d  |ule header ****.|
00000af0  03 16 05 3a 0d 03 20 0e  2e 69 6e 69 74 63 6f 64  |...:.. ..initcod|
00000b00  65 25 0d 03 2a 1c 20 20  20 20 53 54 4d 46 44 20  |e%..*.    STMFD |
00000b10  20 20 28 73 70 29 21 2c  7b 6c 69 6e 6b 7d 0d 03  |  (sp)!,{link}..|
00000b20  34 17 20 20 20 20 42 4c  20 20 20 20 20 20 64 6f  |4.    BL      do|
00000b30  63 6c 61 69 6d 0d 03 3e  1a 20 20 20 20 4c 44 4d  |claim..>.    LDM|
00000b40  46 44 20 20 20 28 73 70  29 21 2c 7b 70 63 7d 0d  |FD   (sp)!,{pc}.|
00000b50  03 48 05 3a 0d 03 52 0d  2e 73 72 76 63 6f 64 65  |.H.:..R..srvcode|
00000b60  25 0d 03 5c 33 20 20 20  20 4d 4f 56 20 20 20 20  |%..\3    MOV    |
00000b70  20 70 63 2c 6c 69 6e 6b  20 20 20 20 20 3b 20 69  | pc,link     ; i|
00000b80  65 20 72 65 74 75 72 6e  20 69 6d 6d 65 64 69 61  |e return immedia|
00000b90  74 65 6c 79 0d 03 66 2a  3b 20 20 20 20 54 45 51  |tely..f*;    TEQ|
00000ba0  20 20 20 20 20 52 31 2c  23 26 32 37 20 20 20 20  |     R1,#&27    |
00000bb0  3b 20 72 65 73 65 74 20  6d 6f 64 75 6c 65 0d 03  |; reset module..|
00000bc0  70 18 3b 20 20 20 20 4d  4f 56 4e 45 20 20 20 70  |p.;    MOVNE   p|
00000bd0  63 2c 6c 69 6e 6b 0d 03  7a 05 3a 0d 03 84 0c 2e  |c,link..z.:.....|
00000be0  64 6f 63 6c 61 69 6d 0d  03 8e 22 20 20 20 20 53  |doclaim..."    S|
00000bf0  54 4d 46 44 20 20 20 28  73 70 29 21 2c 7b 52 30  |TMFD   (sp)!,{R0|
00000c00  2d 52 32 2c 6c 69 6e 6b  7d 0d 03 98 17 20 20 20  |-R2,link}....   |
00000c10  20 4d 4f 56 20 20 20 20  20 6c 69 6e 6b 2c 23 30  | MOV     link,#0|
00000c20  0d 03 a2 1d 20 20 20 20  53 54 52 20 20 20 20 20  |....    STR     |
00000c30  6c 69 6e 6b 2c 64 6f 69  6e 67 6e 6f 77 0d 03 ac  |link,doingnow...|
00000c40  20 20 20 20 20 53 54 52  20 20 20 20 20 6c 69 6e  |     STR     lin|
00000c50  6b 2c 6b 65 79 31 70 72  65 73 73 65 64 0d 03 b6  |k,key1pressed...|
00000c60  20 20 20 20 20 53 54 52  20 20 20 20 20 6c 69 6e  |     STR     lin|
00000c70  6b 2c 6b 65 79 32 70 72  65 73 73 65 64 0d 03 c0  |k,key2pressed...|
00000c80  20 20 20 20 20 53 54 52  20 20 20 20 20 6c 69 6e  |     STR     lin|
00000c90  6b 2c 6b 65 79 33 70 72  65 73 73 65 64 0d 03 ca  |k,key3pressed...|
00000ca0  20 20 20 20 20 53 54 52  20 20 20 20 20 6c 69 6e  |     STR     lin|
00000cb0  6b 2c 6b 65 79 34 70 72  65 73 73 65 64 0d 03 d4  |k,key4pressed...|
00000cc0  34 20 20 20 20 4d 4f 56  20 20 20 20 20 52 30 2c  |4    MOV     R0,|
00000cd0  23 26 31 30 20 20 20 20  20 20 20 20 20 20 20 20  |#&10            |
00000ce0  20 20 20 3b 20 76 65 63  74 6f 72 20 26 31 30 20  |   ; vector &10 |
00000cf0  3f 0d 03 de 45 20 20 20  20 41 44 52 20 20 20 20  |?...E    ADR    |
00000d00  20 52 31 2c 6e 65 77 76  65 63 74 6f 72 25 20 20  | R1,newvector%  |
00000d10  20 20 20 20 20 20 20 3b  20 74 6f 20 62 65 20 70  |       ; to be p|
00000d20  72 6f 63 65 73 73 65 64  20 61 74 20 6e 65 77 76  |rocessed at newv|
00000d30  65 63 74 6f 72 25 0d 03  e8 1c 20 20 20 20 42 4c  |ector%....    BL|
00000d40  20 20 20 20 20 20 63 6c  61 69 6d 76 65 63 74 6f  |      claimvecto|
00000d50  72 25 0d 03 f2 17 20 20  20 20 4d 4f 56 20 20 20  |r%....    MOV   |
00000d60  20 20 52 30 2c 23 26 30  45 0d 03 fc 17 20 20 20  |  R0,#&0E....   |
00000d70  20 4d 4f 56 20 20 20 20  20 52 31 2c 23 26 30 42  | MOV     R1,#&0B|
00000d80  0d 04 06 3e 20 20 20 20  53 57 49 20 20 20 20 20  |...>    SWI     |
00000d90  22 58 4f 53 5f 42 79 74  65 22 20 20 20 20 20 20  |"XOS_Byte"      |
00000da0  20 20 20 20 20 20 3b 20  65 6e 61 62 6c 65 20 6b  |      ; enable k|
00000db0  65 79 70 72 65 73 73 20  76 65 63 74 6f 72 0d 04  |eypress vector..|
00000dc0  10 15 20 20 20 20 4d 4f  56 20 20 20 20 20 52 30  |..    MOV     R0|
00000dd0  2c 23 30 0d 04 1a 1b 20  20 20 20 53 54 52 42 20  |,#0....    STRB |
00000de0  20 20 20 52 30 2c 5b 52  31 32 2c 23 38 5d 0d 04  |   R0,[R12,#8]..|
00000df0  24 20 20 20 20 20 4c 44  4d 46 44 20 20 20 28 73  |$     LDMFD   (s|
00000e00  70 29 21 2c 7b 52 30 2d  52 32 2c 70 63 7d 0d 04  |p)!,{R0-R2,pc}..|
00000e10  2e 05 3a 0d 04 38 0f 2e  66 69 6e 61 6c 63 6f 64  |..:..8..finalcod|
00000e20  65 25 0d 04 42 22 20 20  20 20 53 54 4d 46 44 20  |e%..B"    STMFD |
00000e30  20 20 28 73 70 29 21 2c  7b 52 30 2d 52 32 2c 6c  |  (sp)!,{R0-R2,l|
00000e40  69 6e 6b 7d 0d 04 4c 17  20 20 20 20 4d 4f 56 20  |ink}..L.    MOV |
00000e50  20 20 20 20 52 30 2c 23  26 30 44 0d 04 56 17 20  |    R0,#&0D..V. |
00000e60  20 20 20 4d 4f 56 20 20  20 20 20 52 31 2c 23 26  |   MOV     R1,#&|
00000e70  30 42 0d 04 60 3f 20 20  20 20 53 57 49 20 20 20  |0B..`?    SWI   |
00000e80  20 20 22 58 4f 53 5f 42  79 74 65 22 20 20 20 20  |  "XOS_Byte"    |
00000e90  20 20 20 20 20 20 20 20  3b 20 64 69 73 61 62 6c  |        ; disabl|
00000ea0  65 20 6b 65 79 70 72 65  73 73 20 76 65 63 74 6f  |e keypress vecto|
00000eb0  72 0d 04 6a 1c 20 20 20  20 4c 44 52 20 20 20 20  |r..j.    LDR    |
00000ec0  20 52 31 32 2c 5b 52 31  32 2c 23 30 5d 0d 04 74  | R12,[R12,#0]..t|
00000ed0  17 20 20 20 20 4d 4f 56  20 20 20 20 20 52 30 2c  |.    MOV     R0,|
00000ee0  23 26 31 30 0d 04 7e 1d  20 20 20 20 41 44 52 20  |#&10..~.    ADR |
00000ef0  20 20 20 20 52 31 2c 6e  65 77 76 65 63 74 6f 72  |    R1,newvector|
00000f00  25 0d 04 88 1e 20 20 20  20 42 4c 20 20 20 20 20  |%....    BL     |
00000f10  20 72 65 6c 65 61 73 65  76 65 63 74 6f 72 25 0d  | releasevector%.|
00000f20  04 92 20 20 20 20 20 4c  44 4d 46 44 20 20 20 28  |..     LDMFD   (|
00000f30  73 70 29 21 2c 7b 52 30  2d 52 32 2c 70 63 7d 0d  |sp)!,{R0-R2,pc}.|
00000f40  04 9c 05 3a 0d 04 a6 11  2e 63 6c 61 69 6d 76 65  |...:.....claimve|
00000f50  63 74 6f 72 25 0d 04 b0  1f 20 20 20 20 53 54 4d  |ctor%....    STM|
00000f60  46 44 20 20 20 28 73 70  29 21 2c 7b 52 32 2c 6c  |FD   (sp)!,{R2,l|
00000f70  69 6e 6b 7d 0d 04 ba 1e  20 20 20 20 42 4c 20 20  |ink}....    BL  |
00000f80  20 20 20 20 72 65 6c 65  61 73 65 76 65 63 74 6f  |    releasevecto|
00000f90  72 25 0d 04 c4 15 20 20  20 20 4d 4f 56 20 20 20  |r%....    MOV   |
00000fa0  20 20 52 32 2c 23 30 0d  04 ce 1b 20 20 20 20 53  |  R2,#0....    S|
00000fb0  57 49 20 20 20 20 20 22  58 4f 53 5f 43 6c 61 69  |WI     "XOS_Clai|
00000fc0  6d 22 0d 04 d8 1e 20 20  20 20 4c 44 4d 46 44 20  |m"....    LDMFD |
00000fd0  20 20 28 73 70 29 21 2c  7b 52 32 2c 70 63 7d 5e  |  (sp)!,{R2,pc}^|
00000fe0  0d 04 e2 05 3a 0d 04 ec  13 2e 72 65 6c 65 61 73  |....:.....releas|
00000ff0  65 76 65 63 74 6f 72 25  0d 04 f6 22 20 20 20 20  |evector%..."    |
00001000  53 54 4d 46 44 20 20 20  28 73 70 29 21 2c 7b 52  |STMFD   (sp)!,{R|
00001010  30 2d 52 32 2c 6c 69 6e  6b 7d 0d 05 00 12 2e 72  |0-R2,link}.....r|
00001020  65 74 72 79 72 65 6c 65  61 73 65 25 0d 05 0a 1a  |etryrelease%....|
00001030  20 20 20 20 4c 44 4d 46  44 20 20 20 73 70 2c 7b  |    LDMFD   sp,{|
00001040  52 30 2c 52 31 7d 0d 05  14 15 20 20 20 20 4d 4f  |R0,R1}....    MO|
00001050  56 20 20 20 20 20 52 32  2c 23 30 0d 05 1e 1d 20  |V     R2,#0.... |
00001060  20 20 20 53 57 49 20 20  20 20 20 22 58 4f 53 5f  |   SWI     "XOS_|
00001070  52 65 6c 65 61 73 65 22  0d 05 28 1d 20 20 20 20  |Release"..(.    |
00001080  42 56 43 20 20 20 20 20  72 65 74 72 79 72 65 6c  |BVC     retryrel|
00001090  65 61 73 65 25 0d 05 32  15 20 20 20 20 43 4d 50  |ease%..2.    CMP|
000010a0  20 20 20 20 20 70 63 2c  23 30 0d 05 3c 20 20 20  |     pc,#0..<   |
000010b0  20 20 4c 44 4d 46 44 20  20 20 28 73 70 29 21 2c  |  LDMFD   (sp)!,|
000010c0  7b 52 30 2d 52 32 2c 70  63 7d 0d 05 46 05 3a 0d  |{R0-R2,pc}..F.:.|
000010d0  05 50 0f 2e 6e 65 77 76  65 63 74 6f 72 25 0d 05  |.P..newvector%..|
000010e0  5a 3d 20 20 20 20 43 4d  50 20 20 20 20 20 52 30  |Z=    CMP     R0|
000010f0  2c 23 26 30 42 20 20 20  20 20 20 20 20 20 20 20  |,#&0B           |
00001100  20 20 20 20 20 3b 20 69  73 20 74 68 69 73 20 61  |     ; is this a|
00001110  20 6b 65 79 70 72 65 73  73 20 3f 0d 05 64 35 20  | keypress ?..d5 |
00001120  20 20 20 4d 4f 56 4e 45  20 20 20 70 63 2c 6c 69  |   MOVNE   pc,li|
00001130  6e 6b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |nk              |
00001140  20 20 20 3b 20 69 66 20  6e 6f 74 20 65 78 69 74  |   ; if not exit|
00001150  0d 05 6e 35 20 20 20 20  53 54 4d 46 44 20 20 20  |..n5    STMFD   |
00001160  28 73 70 29 21 2c 7b 52  30 2d 72 32 2c 52 34 2c  |(sp)!,{R0-r2,R4,|
00001170  52 35 2c 6c 69 6e 6b 7d  20 3b 20 73 74 61 63 6b  |R5,link} ; stack|
00001180  20 72 65 67 73 0d 05 78  15 20 20 20 20 4d 4f 56  | regs..x.    MOV|
00001190  20 20 20 20 20 72 34 2c  23 30 0d 05 82 49 20 20  |     r4,#0...I  |
000011a0  20 20 43 4d 50 20 20 20  20 20 52 32 2c 23 6b 31  |  CMP     R2,#k1|
000011b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000011c0  20 3b 20 63 6f 64 65 20  66 6f 72 20 6b 65 79 20  | ; code for key |
000011d0  31 20 28 63 6f 6e 74 72  6f 6c 6c 69 6e 67 20 6b  |1 (controlling k|
000011e0  65 79 29 0d 05 8c 1e 20  20 20 20 53 54 52 45 51  |ey)....    STREQ|
000011f0  20 20 20 52 31 2c 6b 65  79 31 70 72 65 73 73 65  |   R1,key1presse|
00001200  64 0d 05 96 12 20 20 20  20 ec 51 20 20 20 72 34  |d....    .Q   r4|
00001210  2c 23 31 0d 05 a0 1a 20  20 20 20 42 45 51 20 20  |,#1....    BEQ  |
00001220  20 20 20 77 68 69 63 68  6b 65 79 73 25 0d 05 aa  |   whichkeys%...|
00001230  43 20 20 20 20 43 4d 50  20 20 20 20 20 52 32 2c  |C    CMP     R2,|
00001240  23 6b 32 20 20 20 20 20  20 20 20 20 20 20 20 20  |#k2             |
00001250  20 20 20 20 3b 20 63 6f  64 65 20 66 6f 72 20 6b  |    ; code for k|
00001260  65 79 20 32 20 28 4b 69  6c 6c 20 74 61 73 6b 29  |ey 2 (Kill task)|
00001270  0d 05 b4 1e 20 20 20 20  53 54 52 45 51 20 20 20  |....    STREQ   |
00001280  52 31 2c 6b 65 79 32 70  72 65 73 73 65 64 0d 05  |R1,key2pressed..|
00001290  be 12 20 20 20 20 ec 51  20 20 20 72 34 2c 23 31  |..    .Q   r4,#1|
000012a0  0d 05 c8 3f 20 20 20 20  43 4d 50 20 20 20 20 20  |...?    CMP     |
000012b0  52 32 2c 23 6b 33 20 20  20 20 20 20 20 20 20 20  |R2,#k3          |
000012c0  20 20 20 20 20 20 20 3b  20 63 6f 64 65 20 66 6f  |       ; code fo|
000012d0  72 20 6b 65 79 20 33 20  28 45 72 72 6f 72 29 0d  |r key 3 (Error).|
000012e0  05 d2 1e 20 20 20 20 53  54 52 45 51 20 20 20 52  |...    STREQ   R|
000012f0  31 2c 6b 65 79 33 70 72  65 73 73 65 64 0d 05 dc  |1,key3pressed...|
00001300  12 20 20 20 20 ec 51 20  20 20 72 34 2c 23 31 0d  |.    .Q   r4,#1.|
00001310  05 e6 3b 20 20 20 20 43  4d 50 20 20 20 20 20 52  |..;    CMP     R|
00001320  32 2c 23 6b 34 20 20 20  20 20 20 20 20 20 20 20  |2,#k4           |
00001330  20 20 20 20 20 20 3b 20  63 6f 64 65 20 66 6f 72  |      ; code for|
00001340  20 6b 65 79 20 34 20 28  ff 29 0d 05 f0 1e 20 20  | key 4 (.)....  |
00001350  20 20 53 54 52 45 51 20  20 20 52 31 2c 6b 65 79  |  STREQ   R1,key|
00001360  34 70 72 65 73 73 65 64  0d 05 fa 12 20 20 20 20  |4pressed....    |
00001370  ec 51 20 20 20 72 34 2c  23 31 0d 06 04 15 20 20  |.Q   r4,#1....  |
00001380  20 20 43 4d 50 20 20 20  20 20 72 34 2c 23 31 0d  |  CMP     r4,#1.|
00001390  06 0e 26 20 20 20 20 4c  44 4d 4e 45 46 44 20 28  |..&    LDMNEFD (|
000013a0  73 70 29 21 2c 7b 52 30  2d 52 32 2c 52 34 2c 52  |sp)!,{R0-R2,R4,R|
000013b0  35 2c 70 63 7d 0d 06 18  05 3a 0d 06 22 0f 2e 77  |5,pc}....:.."..w|
000013c0  68 69 63 68 6b 65 79 73  25 0d 06 2c 1e 20 20 20  |hichkeys%..,.   |
000013d0  20 4c 44 52 20 20 20 20  20 52 32 2c 6b 65 79 31  | LDR     R2,key1|
000013e0  70 72 65 73 73 65 64 0d  06 36 15 20 20 20 20 54  |pressed..6.    T|
000013f0  45 51 20 20 20 20 20 52  32 2c 23 30 0d 06 40 26  |EQ     R2,#0..@&|
00001400  20 20 20 20 4c 44 4d 45  51 46 44 20 28 73 70 29  |    LDMEQFD (sp)|
00001410  21 2c 7b 52 30 2d 52 32  2c 52 34 2c 52 35 2c 70  |!,{R0-R2,R4,R5,p|
00001420  63 7d 0d 06 4a 1e 20 20  20 20 4c 44 52 20 20 20  |c}..J.    LDR   |
00001430  20 20 52 32 2c 6b 65 79  32 70 72 65 73 73 65 64  |  R2,key2pressed|
00001440  0d 06 54 15 20 20 20 20  54 45 51 20 20 20 20 20  |..T.    TEQ     |
00001450  52 32 2c 23 30 0d 06 5e  1b 20 20 20 20 42 45 51  |R2,#0..^.    BEQ|
00001460  20 20 20 20 20 74 65 73  74 66 6f 72 6b 65 79 33  |     testforkey3|
00001470  0d 06 68 3e 20 20 20 20  41 44 52 20 20 20 20 20  |..h>    ADR     |
00001480  72 31 2c 64 6f 65 78 69  74 63 6f 64 65 25 20 20  |r1,doexitcode%  |
00001490  20 20 20 20 20 20 20 3b  20 72 31 3d 61 64 64 72  |       ; r1=addr|
000014a0  65 73 73 20 74 6f 20 6a  75 6d 70 20 74 6f 0d 06  |ess to jump to..|
000014b0  72 0e 2e 73 65 74 75 70  6a 75 6d 70 0d 06 7c 15  |r..setupjump..|.|
000014c0  20 20 20 20 4d 4f 56 20  20 20 20 20 52 35 2c 70  |    MOV     R5,p|
000014d0  63 0d 06 86 18 20 20 20  20 42 49 43 20 20 20 20  |c....    BIC    |
000014e0  20 52 34 2c 52 35 2c 23  31 0d 06 90 15 20 20 20  | R4,R5,#1....   |
000014f0  20 54 45 51 50 20 20 20  20 52 34 2c 23 31 0d 06  | TEQP    R4,#1..|
00001500  9a 15 20 20 20 20 4d 4f  56 20 20 20 20 20 52 30  |..    MOV     R0|
00001510  2c 52 30 0d 06 a4 1c 20  20 20 20 53 54 4d 46 44  |,R0....    STMFD|
00001520  20 20 20 28 73 70 29 21  2c 7b 6c 69 6e 6b 7d 0d  |   (sp)!,{link}.|
00001530  06 ae 1b 20 20 20 20 4c  44 52 42 20 20 20 20 52  |...    LDRB    R|
00001540  30 2c 64 6f 69 6e 67 6e  6f 77 0d 06 b8 15 20 20  |0,doingnow....  |
00001550  20 20 54 45 51 20 20 20  20 20 52 30 2c 23 30 0d  |  TEQ     R0,#0.|
00001560  06 c2 1c 20 20 20 20 42  4e 45 20 20 20 20 20 61  |...    BNE     a|
00001570  6c 72 65 61 64 79 64 6f  69 6e 67 0d 06 cc 33 20  |lreadydoing...3 |
00001580  20 20 20 4d 4f 56 20 20  20 20 20 72 30 2c 72 31  |   MOV     r0,r1|
00001590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000015a0  20 20 3b 20 72 30 3d 61  64 64 72 65 73 73 0d 06  |  ; r0=address..|
000015b0  d6 15 20 20 20 20 4d 4f  56 20 20 20 20 20 52 31  |..    MOV     R1|
000015c0  2c 23 30 0d 06 e0 21 20  20 20 20 53 57 49 20 20  |,#0...!    SWI  |
000015d0  20 20 20 22 58 4f 53 5f  41 64 64 43 61 6c 6c 42  |   "XOS_AddCallB|
000015e0  61 63 6b 22 0d 06 ea 15  20 20 20 20 4d 4f 56 56  |ack"....    MOVV|
000015f0  43 20 20 20 52 30 2c 23  31 0d 06 f4 3b 20 20 20  |C   R0,#1...;   |
00001600  20 53 54 52 56 43 42 20  20 52 30 2c 64 6f 69 6e  | STRVCB  R0,doin|
00001610  67 6e 6f 77 20 20 20 20  20 20 20 20 20 20 3b 20  |gnow          ; |
00001620  69 66 20 6f 6b 20 74 68  65 6e 20 73 65 74 20 64  |if ok then set d|
00001630  6f 69 6e 67 0d 06 fe 11  2e 61 6c 72 65 61 64 79  |oing.....already|
00001640  64 6f 69 6e 67 0d 07 08  1c 20 20 20 20 4c 44 4d  |doing....    LDM|
00001650  46 44 20 20 20 28 73 70  29 21 2c 7b 6c 69 6e 6b  |FD   (sp)!,{link|
00001660  7d 0d 07 12 15 20 20 20  20 54 45 51 50 20 20 20  |}....    TEQP   |
00001670  20 52 35 2c 23 30 0d 07  1c 15 20 20 20 20 4d 4f  | R5,#0....    MO|
00001680  56 20 20 20 20 20 52 30  2c 52 30 0d 07 26 26 20  |V     R0,R0..&& |
00001690  20 20 20 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |   LDMFD   (sp)!|
000016a0  2c 7b 52 30 2d 52 32 2c  52 34 2c 52 35 2c 70 63  |,{R0-R2,R4,R5,pc|
000016b0  7d 0d 07 30 4a 2e 74 65  73 74 66 6f 72 6b 65 79  |}..0J.testforkey|
000016c0  33 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |3               |
000016d0  20 20 20 20 20 20 3b 20  63 68 65 63 6b 20 74 68  |      ; check th|
000016e0  61 74 20 6b 65 79 20 33  20 69 73 20 70 72 65 73  |at key 3 is pres|
000016f0  73 65 64 20 28 45 72 72  6f 72 29 0d 07 3a 1e 20  |sed (Error)..:. |
00001700  20 20 20 4c 44 52 20 20  20 20 20 52 32 2c 6b 65  |   LDR     R2,ke|
00001710  79 33 70 72 65 73 73 65  64 0d 07 44 15 20 20 20  |y3pressed..D.   |
00001720  20 54 45 51 20 20 20 20  20 52 32 2c 23 30 0d 07  | TEQ     R2,#0..|
00001730  4e 1b 20 20 20 20 42 45  51 20 20 20 20 20 74 65  |N.    BEQ     te|
00001740  73 74 66 6f 72 6b 65 79  34 0d 07 58 1f 20 20 20  |stforkey4..X.   |
00001750  20 41 44 52 20 20 20 20  20 72 31 2c 64 6f 65 72  | ADR     r1,doer|
00001760  72 6f 72 63 6f 64 65 25  0d 07 62 19 20 20 20 20  |rorcode%..b.    |
00001770  42 20 20 20 20 20 20 20  73 65 74 75 70 6a 75 6d  |B       setupjum|
00001780  70 0d 07 6c 05 3a 0d 07  76 46 2e 74 65 73 74 66  |p..l.:..vF.testf|
00001790  6f 72 6b 65 79 34 20 20  20 20 20 20 20 20 20 20  |orkey4          |
000017a0  20 20 20 20 20 20 20 20  20 20 20 3b 20 63 68 65  |           ; che|
000017b0  63 6b 20 74 68 61 74 20  6b 65 79 20 34 20 69 73  |ck that key 4 is|
000017c0  20 70 72 65 73 73 65 64  20 28 ff 29 0d 07 80 1e  | pressed (.)....|
000017d0  20 20 20 20 4c 44 52 20  20 20 20 20 52 32 2c 6b  |    LDR     R2,k|
000017e0  65 79 34 70 72 65 73 73  65 64 0d 07 8a 15 20 20  |ey4pressed....  |
000017f0  20 20 54 45 51 20 20 20  20 20 52 32 2c 23 30 0d  |  TEQ     R2,#0.|
00001800  07 94 26 20 20 20 20 4c  44 4d 45 51 46 44 20 28  |..&    LDMEQFD (|
00001810  73 70 29 21 2c 7b 52 30  2d 52 32 2c 52 34 2c 52  |sp)!,{R0-R2,R4,R|
00001820  35 2c 70 63 7d 0d 07 9e  1f 20 20 20 20 41 44 52  |5,pc}....    ADR|
00001830  20 20 20 20 20 72 31 2c  64 6f 6f 73 63 6c 69 63  |     r1,doosclic|
00001840  6f 64 65 25 0d 07 a8 19  20 20 20 20 42 20 20 20  |ode%....    B   |
00001850  20 20 20 20 73 65 74 75  70 6a 75 6d 70 0d 07 b2  |    setupjump...|
00001860  05 3a 0d 07 bc 10 2e 64  6f 65 78 69 74 63 6f 64  |.:.....doexitcod|
00001870  65 25 0d 07 c6 1c 20 20  20 20 53 54 4d 46 44 20  |e%....    STMFD |
00001880  20 20 28 73 70 29 21 2c  7b 6c 69 6e 6b 7d 0d 07  |  (sp)!,{link}..|
00001890  d0 21 20 20 20 20 42 4c  20 20 20 20 20 20 64 65  |.!    BL      de|
000018a0  6c 69 6e 6b 61 70 70 6c  69 63 61 74 69 6f 6e 0d  |linkapplication.|
000018b0  07 da 1c 20 20 20 20 42  4c 20 20 20 20 20 20 72  |...    BL      r|
000018c0  65 73 74 6f 72 65 62 72  65 61 6b 0d 07 e4 15 20  |estorebreak.... |
000018d0  20 20 20 4d 4f 56 20 20  20 20 20 52 30 2c 23 30  |   MOV     R0,#0|
000018e0  0d 07 ee 1b 20 20 20 20  53 54 52 42 20 20 20 20  |....    STRB    |
000018f0  52 30 2c 64 6f 69 6e 67  6e 6f 77 0d 07 f8 16 3b  |R0,doingnow....;|
00001900  20 63 6f 64 65 20 67 6f  65 73 20 68 65 72 65 20  | code goes here |
00001910  2d 0d 08 02 1c 3b 20 20  20 53 57 49 20 20 20 20  |-....;   SWI    |
00001920  20 22 4f 53 5f 45 6e 74  65 72 4f 53 22 0d 08 0c  | "OS_EnterOS"...|
00001930  19 20 20 20 20 53 57 49  20 20 20 20 20 22 4f 53  |.    SWI     "OS|
00001940  5f 45 78 69 74 22 0d 08  16 0f 3b 20 2d 20 74 6f  |_Exit"....; - to|
00001950  20 68 65 72 65 0d 08 20  1a 20 20 20 20 4c 44 4d  | here.. .    LDM|
00001960  46 44 20 20 20 28 73 70  29 21 2c 7b 70 63 7d 0d  |FD   (sp)!,{pc}.|
00001970  08 2a 05 3a 0d 08 34 11  2e 64 6f 65 72 72 6f 72  |.*.:..4..doerror|
00001980  63 6f 64 65 25 0d 08 3e  1c 20 20 20 20 53 54 4d  |code%..>.    STM|
00001990  46 44 20 20 20 28 73 70  29 21 2c 7b 6c 69 6e 6b  |FD   (sp)!,{link|
000019a0  7d 0d 08 48 21 20 20 20  20 42 4c 20 20 20 20 20  |}..H!    BL     |
000019b0  20 64 65 6c 69 6e 6b 61  70 70 6c 69 63 61 74 69  | delinkapplicati|
000019c0  6f 6e 0d 08 52 1c 20 20  20 20 42 4c 20 20 20 20  |on..R.    BL    |
000019d0  20 20 72 65 73 74 6f 72  65 62 72 65 61 6b 0d 08  |  restorebreak..|
000019e0  5c 15 20 20 20 20 4d 4f  56 20 20 20 20 20 52 30  |\.    MOV     R0|
000019f0  2c 23 30 0d 08 66 1b 20  20 20 20 53 54 52 42 20  |,#0..f.    STRB |
00001a00  20 20 20 52 30 2c 64 6f  69 6e 67 6e 6f 77 0d 08  |   R0,doingnow..|
00001a10  70 16 3b 20 63 6f 64 65  20 67 6f 65 73 20 68 65  |p.; code goes he|
00001a20  72 65 20 2d 0d 08 7a 21  20 a4 65 72 72 6f 72 28  |re -..z! .error(|
00001a30  22 50 72 6f 67 72 61 6d  20 74 65 72 6d 69 6e 61  |"Program termina|
00001a40  74 65 64 22 29 0d 08 84  0f 3b 20 2d 20 74 6f 20  |ted")....; - to |
00001a50  68 65 72 65 0d 08 8e 1a  20 20 20 20 4c 44 4d 46  |here....    LDMF|
00001a60  44 20 20 20 28 73 70 29  21 2c 7b 70 63 7d 0d 08  |D   (sp)!,{pc}..|
00001a70  98 05 3a 0d 08 a2 16 2e  64 65 6c 69 6e 6b 61 70  |..:.....delinkap|
00001a80  70 6c 69 63 61 74 69 6f  6e 0d 08 ac 23 20 20 20  |plication...#   |
00001a90  20 53 54 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  | STMFD   (sp)!,{|
00001aa0  72 30 2d 72 31 32 2c 6c  69 6e 6b 7d 0d 08 b6 1a  |r0-r12,link}....|
00001ab0  20 20 20 20 a4 73 65 74  5f 61 73 5f 73 76 63 28  |    .set_as_svc(|
00001ac0  70 61 73 73 25 29 0d 08  c0 0d 2e 64 6c 61 5f 6c  |pass%).....dla_l|
00001ad0  6f 6f 70 0d 08 ca 50 20  20 20 20 41 44 52 20 20  |oop...P    ADR  |
00001ae0  20 20 20 72 30 2c 62 75  66 66 65 72 20 20 20 20  |   r0,buffer    |
00001af0  20 20 20 20 20 20 20 20  20 20 20 3b 20 62 75 66  |           ; buf|
00001b00  66 65 72 20 66 6f 72 20  70 72 65 76 69 6f 75 73  |fer for previous|
00001b10  6c 79 20 6c 69 6e 6b 65  64 20 76 65 63 74 6f 72  |ly linked vector|
00001b20  73 20 3f 0d 08 d4 3a 20  20 20 20 4d 4f 56 20 20  |s ?...:    MOV  |
00001b30  20 20 20 72 31 2c 23 33  32 20 20 20 20 20 20 20  |   r1,#32       |
00001b40  20 20 20 20 20 20 20 20  20 20 20 3b 20 6c 65 6e  |           ; len|
00001b50  67 74 68 20 6f 66 20 62  75 66 66 65 72 0d 08 de  |gth of buffer...|
00001b60  50 20 20 20 20 53 57 49  20 20 20 20 20 22 58 4f  |P    SWI     "XO|
00001b70  53 5f 44 65 6c 69 6e 6b  41 70 70 6c 69 63 61 74  |S_DelinkApplicat|
00001b80  69 6f 6e 22 20 3b 20 72  65 6d 6f 76 65 20 61 6e  |ion" ; remove an|
00001b90  79 20 76 65 63 74 6f 72  73 20 75 73 65 64 20 62  |y vectors used b|
00001ba0  79 20 61 70 70 6c 69 63  61 74 69 6f 6e 0d 08 e8  |y application...|
00001bb0  3f 20 20 20 20 43 4d 50  20 20 20 20 20 72 31 2c  |?    CMP     r1,|
00001bc0  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
00001bd0  20 20 20 20 20 3b 20 77  61 73 20 74 68 65 20 62  |     ; was the b|
00001be0  75 66 66 65 72 20 66 75  6c 6c 20 3f 0d 08 f2 49  |uffer full ?...I|
00001bf0  20 20 20 20 42 45 51 20  20 20 20 20 64 6c 61 5f  |    BEQ     dla_|
00001c00  6c 6f 6f 70 20 20 20 20  20 20 20 20 20 20 20 20  |loop            |
00001c10  20 20 20 20 3b 20 69 66  20 69 74 20 77 61 73 2c  |    ; if it was,|
00001c20  20 74 68 65 6e 20 67 6f  20 61 72 6f 75 6e 64 20  | then go around |
00001c30  61 67 61 69 6e 0d 08 fc  1c 20 20 20 20 a4 72 65  |again....    .re|
00001c40  73 74 6f 72 65 5f 6d 6f  64 65 28 70 61 73 73 25  |store_mode(pass%|
00001c50  29 0d 09 06 22 20 20 20  20 4c 44 4d 46 44 20 20  |)..."    LDMFD  |
00001c60  20 28 73 70 29 21 2c 7b  72 30 2d 72 31 32 2c 70  | (sp)!,{r0-r12,p|
00001c70  63 7d 5e 0d 09 10 0b 2e  62 75 66 66 65 72 0d 09  |c}^.....buffer..|
00001c80  1a 11 20 a4 72 65 73 65  72 76 65 28 33 32 29 0d  |.. .reserve(32).|
00001c90  09 24 28 20 20 20 20 20  20 20 20 20 20 3b 20 73  |.$(          ; s|
00001ca0  70 61 63 65 20 66 6f 72  20 76 65 63 74 6f 72 20  |pace for vector |
00001cb0  73 74 6f 72 61 67 65 0d  09 2e 05 3a 0d 09 38 05  |storage....:..8.|
00001cc0  3a 0d 09 42 11 2e 64 6f  6f 73 63 6c 69 63 6f 64  |:..B..doosclicod|
00001cd0  65 25 0d 09 4c 23 20 20  20 20 53 54 4d 46 44 20  |e%..L#    STMFD |
00001ce0  20 20 28 73 70 29 21 2c  7b 72 30 2d 72 31 32 2c  |  (sp)!,{r0-r12,|
00001cf0  6c 69 6e 6b 7d 0d 09 56  1a 20 20 20 20 a4 73 65  |link}..V.    .se|
00001d00  74 5f 61 73 5f 73 76 63  28 70 61 73 73 25 29 0d  |t_as_svc(pass%).|
00001d10  09 60 1c 20 20 20 20 42  4c 20 20 20 20 20 20 72  |.`.    BL      r|
00001d20  65 73 74 6f 72 65 62 72  65 61 6b 0d 09 6a 16 3b  |estorebreak..j.;|
00001d30  20 63 6f 64 65 20 67 6f  65 73 20 68 65 72 65 20  | code goes here |
00001d40  2d 0d 09 74 42 20 20 20  20 41 44 52 20 20 20 20  |-..tB    ADR    |
00001d50  20 72 30 2c 77 69 6d 70  76 61 72 20 20 20 20 20  | r0,wimpvar     |
00001d60  20 20 20 20 20 20 20 20  20 3b 20 61 64 64 72 65  |         ; addre|
00001d70  73 73 20 6f 66 20 77 69  6d 70 20 76 61 72 69 61  |ss of wimp varia|
00001d80  62 6c 65 0d 09 7e 3b 20  20 20 20 41 44 52 20 20  |ble..~;    ADR  |
00001d90  20 20 20 72 31 2c 6f 73  63 6c 69 6c 69 6e 65 20  |   r1,oscliline |
00001da0  20 20 20 20 20 20 20 20  20 20 20 3b 20 61 64 64  |           ; add|
00001db0  72 65 73 73 20 6f 66 20  62 75 66 66 65 72 0d 09  |ress of buffer..|
00001dc0  88 37 20 20 20 20 4d 4f  56 20 20 20 20 20 72 32  |.7    MOV     r2|
00001dd0  2c 23 32 35 35 20 20 20  20 20 20 20 20 20 20 20  |,#255           |
00001de0  20 20 20 20 20 20 3b 20  62 75 66 66 65 72 20 6c  |      ; buffer l|
00001df0  65 6e 67 74 68 0d 09 92  2b 20 20 20 20 4d 4f 56  |ength...+    MOV|
00001e00  20 20 20 20 20 72 33 2c  23 30 20 20 20 20 20 20  |     r3,#0      |
00001e10  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 3f  |             ; ?|
00001e20  0d 09 9c 2b 20 20 20 20  4d 4f 56 20 20 20 20 20  |...+    MOV     |
00001e30  72 34 2c 23 33 20 20 20  20 20 20 20 20 20 20 20  |r4,#3           |
00001e40  20 20 20 20 20 20 20 20  3b 20 3f 0d 09 a6 37 20  |        ; ?...7 |
00001e50  20 20 20 53 57 49 20 20  20 20 20 22 58 4f 53 5f  |   SWI     "XOS_|
00001e60  52 65 61 64 56 61 72 56  61 6c 22 20 20 20 20 20  |ReadVarVal"     |
00001e70  20 20 20 3b 20 72 65 61  64 20 76 61 72 69 61 62  |   ; read variab|
00001e80  6c 65 0d 09 b0 37 20 20  20 20 42 56 53 20 20 20  |le...7    BVS   |
00001e90  20 20 65 78 69 74 6f 73  63 6c 69 20 20 20 20 20  |  exitoscli     |
00001ea0  20 20 20 20 20 20 20 20  20 20 3b 20 65 78 69 74  |          ; exit|
00001eb0  20 69 66 20 65 72 72 6f  72 0d 09 ba 38 20 20 20  | if error...8   |
00001ec0  20 4c 44 52 20 20 20 20  20 72 30 2c 5b 72 31 2c  | LDR     r0,[r1,|
00001ed0  23 30 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0]             |
00001ee0  20 3b 20 67 65 74 20 66  69 72 73 74 20 77 6f 72  | ; get first wor|
00001ef0  64 0d 09 c4 49 20 20 20  20 4c 44 52 20 20 20 20  |d...I    LDR    |
00001f00  20 72 32 2c 63 6f 6d 6d  61 6e 64 73 74 72 69 6e  | r2,commandstrin|
00001f10  67 20 20 20 20 20 20 20  20 3b 20 72 65 61 64 20  |g        ; read |
00001f20  77 68 61 74 20 69 74 20  73 68 6f 75 6c 64 20 62  |what it should b|
00001f30  65 20 66 6f 72 20 63 6f  6d 6d 0d 09 ce 31 20 20  |e for comm...1  |
00001f40  20 20 43 4d 50 20 20 20  20 20 72 30 2c 72 32 20  |  CMP     r0,r2 |
00001f50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001f60  20 20 3b 20 63 6f 6d 70  61 72 65 0d 09 d8 39 20  |  ; compare...9 |
00001f70  20 20 20 4c 44 52 4e 45  20 20 20 72 30 2c 5b 72  |   LDRNE   r0,[r|
00001f80  31 2c 23 30 5d 20 20 20  20 20 20 20 20 20 20 20  |1,#0]           |
00001f90  20 20 20 3b 20 67 65 74  20 73 65 63 6f 6e 64 20  |   ; get second |
00001fa0  77 6f 72 64 0d 09 e2 49  20 20 20 20 4c 44 52 4e  |word...I    LDRN|
00001fb0  45 20 20 20 72 32 2c 63  6f 6d 6d 61 6e 64 73 74  |E   r2,commandst|
00001fc0  72 69 6e 67 2b 34 20 20  20 20 20 20 3b 20 72 65  |ring+4      ; re|
00001fd0  61 64 20 77 68 61 74 20  69 74 20 73 68 6f 75 6c  |ad what it shoul|
00001fe0  64 20 62 65 20 66 6f 72  20 61 6e 64 73 0d 09 ec  |d be for ands...|
00001ff0  31 20 20 20 20 43 4d 50  4e 45 20 20 20 72 30 2c  |1    CMPNE   r0,|
00002000  72 32 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |r2              |
00002010  20 20 20 20 20 3b 20 63  6f 6d 70 61 72 65 0d 09  |     ; compare..|
00002020  f6 1b 20 20 20 20 42 4e  45 20 20 20 20 20 77 69  |..    BNE     wi|
00002030  6d 70 72 75 6e 6e 69 6e  67 0d 0a 00 0e 2e 6f 73  |mprunning.....os|
00002040  63 6c 69 6c 6f 6f 70 0d  0a 0a 1b 20 20 20 20 53  |cliloop....    S|
00002050  57 49 20 20 20 20 20 26  31 30 30 2b 97 28 22 2a  |WI     &100+.("*|
00002060  22 29 0d 0a 14 34 20 20  20 20 41 44 52 20 20 20  |")...4    ADR   |
00002070  20 20 72 30 2c 6f 73 63  6c 69 6c 69 6e 65 20 20  |  r0,oscliline  |
00002080  20 20 20 20 20 20 3b 20  61 64 64 72 20 6f 66 20  |      ; addr of |
00002090  62 75 66 66 65 72 0d 0a  1e 36 20 20 20 20 4d 4f  |buffer...6    MO|
000020a0  56 20 20 20 20 20 72 31  2c 23 26 31 30 30 20 20  |V     r1,#&100  |
000020b0  20 20 20 20 20 20 20 20  20 20 3b 20 6c 65 6e 67  |          ; leng|
000020c0  74 68 20 6f 66 20 62 75  66 66 65 72 0d 0a 28 38  |th of buffer..(8|
000020d0  20 20 20 20 4d 4f 56 20  20 20 20 20 72 32 2c 23  |    MOV     r2,#|
000020e0  26 32 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |&20             |
000020f0  3b 20 6d 69 6e 20 61 73  63 69 69 20 61 63 63 65  |; min ascii acce|
00002100  70 74 65 64 0d 0a 32 38  20 20 20 20 4d 4f 56 20  |pted..28    MOV |
00002110  20 20 20 20 72 33 2c 23  26 46 46 20 20 20 20 20  |    r3,#&FF     |
00002120  20 20 20 20 20 20 20 20  3b 20 6d 61 78 20 61 73  |        ; max as|
00002130  63 69 69 20 61 63 63 65  70 74 65 64 0d 0a 3c 1e  |cii accepted..<.|
00002140  20 20 20 20 53 57 49 20  20 20 20 20 22 58 4f 53  |    SWI     "XOS|
00002150  5f 52 65 61 64 4c 69 6e  65 22 0d 0a 46 3b 20 20  |_ReadLine"..F;  |
00002160  20 20 42 56 53 20 20 20  20 20 6f 73 63 6c 69 65  |  BVS     osclie|
00002170  72 72 6f 72 20 20 20 20  20 20 20 20 20 20 3b 20  |rror          ; |
00002180  69 66 20 65 72 72 6f 72  20 74 68 65 6e 20 70 72  |if error then pr|
00002190  6f 63 65 73 73 0d 0a 50  46 20 20 20 20 43 4d 50  |ocess..PF    CMP|
000021a0  20 20 20 20 20 72 31 2c  23 30 20 20 20 20 20 20  |     r1,#0      |
000021b0  20 20 20 20 20 20 20 20  20 3b 20 69 66 20 6e 6f  |         ; if no|
000021c0  20 63 68 61 72 61 63 74  65 72 73 20 74 79 70 65  | characters type|
000021d0  64 20 74 68 65 6e 20 65  78 69 74 0d 0a 5a 19 20  |d then exit..Z. |
000021e0  20 20 20 42 45 51 20 20  20 20 20 65 78 69 74 6f  |   BEQ     exito|
000021f0  73 63 6c 69 0d 0a 64 30  20 20 20 20 53 57 49 20  |scli..d0    SWI |
00002200  20 20 20 20 22 58 4f 53  5f 43 4c 49 22 20 20 20  |    "XOS_CLI"   |
00002210  20 20 20 20 20 20 20 20  3b 20 64 6f 20 63 6f 6d  |        ; do com|
00002220  6d 61 6e 64 0d 0a 6e 42  20 20 20 20 42 56 43 20  |mand..nB    BVC |
00002230  20 20 20 20 6f 73 63 6c  69 6c 6f 6f 70 20 20 20  |    oscliloop   |
00002240  20 20 20 20 20 20 20 20  3b 20 69 66 20 6e 6f 20  |        ; if no |
00002250  65 72 72 6f 72 20 74 68  65 6e 20 6c 6f 6f 70 20  |error then loop |
00002260  61 72 6f 75 6e 64 0d 0a  78 0f 2e 6f 73 63 6c 69  |around..x..oscli|
00002270  65 72 72 6f 72 0d 0a 82  3a 20 20 20 20 41 44 44  |error...:    ADD|
00002280  20 20 20 20 20 72 30 2c  72 30 2c 23 34 20 20 20  |     r0,r0,#4   |
00002290  20 20 20 20 20 20 20 20  20 3b 20 73 6b 69 70 20  |         ; skip |
000022a0  65 72 72 6f 72 20 63 6f  64 65 20 62 79 74 65 0d  |error code byte.|
000022b0  0a 8c 35 20 20 20 20 53  57 49 20 20 20 20 20 22  |..5    SWI     "|
000022c0  4f 53 5f 57 72 69 74 65  30 22 20 20 20 20 20 20  |OS_Write0"      |
000022d0  20 20 20 3b 20 77 72 69  74 65 20 74 6f 20 73 63  |   ; write to sc|
000022e0  72 65 65 6e 0d 0a 96 1c  20 20 20 20 53 57 49 20  |reen....    SWI |
000022f0  20 20 20 20 22 4f 53 5f  4e 65 77 4c 69 6e 65 22  |    "OS_NewLine"|
00002300  0d 0a a0 19 20 20 20 20  42 20 20 20 20 20 20 20  |....    B       |
00002310  6f 73 63 6c 69 6c 6f 6f  70 0d 0a aa 0e 2e 65 78  |oscliloop.....ex|
00002320  69 74 6f 73 63 6c 69 0d  0a b4 15 20 20 20 20 4d  |itoscli....    M|
00002330  4f 56 20 20 20 20 20 52  30 2c 23 30 0d 0a be 1b  |OV     R0,#0....|
00002340  20 20 20 20 53 54 52 42  20 20 20 20 52 30 2c 64  |    STRB    R0,d|
00002350  6f 69 6e 67 6e 6f 77 0d  0a c8 0f 3b 20 2d 20 74  |oingnow....; - t|
00002360  6f 20 68 65 72 65 0d 0a  d2 1c 20 20 20 20 a4 72  |o here....    .r|
00002370  65 73 74 6f 72 65 5f 6d  6f 64 65 28 70 61 73 73  |estore_mode(pass|
00002380  25 29 0d 0a dc 22 20 20  20 20 4c 44 4d 46 44 20  |%)..."    LDMFD |
00002390  20 20 28 73 70 29 21 2c  7b 72 30 2d 72 31 32 2c  |  (sp)!,{r0-r12,|
000023a0  70 63 7d 5e 0d 0a e6 05  3a 0d 0a f0 10 2e 77 69  |pc}^....:.....wi|
000023b0  6d 70 72 75 6e 6e 69 6e  67 0d 0a fa 05 5d 0d 0b  |mprunning....]..|
000023c0  04 17 e7 20 63 6f 6e 64  5f 65 6e 61 62 6c 65 77  |... cond_enablew|
000023d0  69 6d 70 20 8c 0d 0b 0e  0f 5b 20 4f 50 54 20 70  |imp .....[ OPT p|
000023e0  61 73 73 25 0d 0b 18 1e  20 20 20 20 41 44 52 20  |ass%....    ADR |
000023f0  20 20 20 20 72 30 2c 77  69 6d 70 63 6f 6d 6d 61  |    r0,wimpcomma|
00002400  6e 64 0d 0b 22 20 20 20  20 20 53 57 49 20 20 20  |nd.."     SWI   |
00002410  20 20 22 57 69 6d 70 5f  53 74 61 72 74 54 61 73  |  "Wimp_StartTas|
00002420  6b 22 0d 0b 2c 05 5d 0d  0b 36 05 cd 0d 0b 40 0f  |k"..,.]..6....@.|
00002430  5b 20 4f 50 54 20 70 61  73 73 25 0d 0b 4a 19 20  |[ OPT pass%..J. |
00002440  20 20 20 42 20 20 20 20  20 20 20 65 78 69 74 6f  |   B       exito|
00002450  73 63 6c 69 0d 0b 54 05  3a 0d 0b 5e 11 2e 72 65  |scli..T.:..^..re|
00002460  73 74 6f 72 65 62 72 65  61 6b 0d 0b 68 22 20 20  |storebreak..h"  |
00002470  20 20 53 54 4d 46 44 20  20 20 28 73 70 29 21 2c  |  STMFD   (sp)!,|
00002480  7b 72 38 2d 72 39 2c 6c  69 6e 6b 7d 0d 0b 72 1a  |{r8-r9,link}..r.|
00002490  20 20 20 20 a4 73 65 74  5f 61 73 5f 73 76 63 28  |    .set_as_svc(|
000024a0  70 61 73 73 25 29 0d 0b  7c 17 20 20 20 20 4d 4f  |pass%)..|.    MO|
000024b0  56 20 20 20 20 20 72 30  2c 23 32 30 30 0d 0b 86  |V     r0,#200...|
000024c0  15 20 20 20 20 4d 4f 56  20 20 20 20 20 72 31 2c  |.    MOV     r1,|
000024d0  23 30 0d 0b 90 42 20 20  20 20 53 57 49 20 20 20  |#0...B    SWI   |
000024e0  20 20 22 4f 53 5f 42 79  74 65 22 20 20 20 20 20  |  "OS_Byte"     |
000024f0  20 20 20 20 20 20 20 3b  20 43 6c 65 61 72 20 42  |       ; Clear B|
00002500  72 65 61 6b 2f 45 73 63  61 70 65 20 64 69 73 61  |reak/Escape disa|
00002510  62 6c 65 64 0d 0b 9a 17  20 20 20 20 4d 4f 56 20  |bled....    MOV |
00002520  20 20 20 20 72 30 2c 23  32 32 39 0d 0b a4 15 20  |    r0,#229.... |
00002530  20 20 20 4d 4f 56 20 20  20 20 20 72 31 2c 23 30  |   MOV     r1,#0|
00002540  0d 0b ae 34 20 20 20 20  53 57 49 20 20 20 20 20  |...4    SWI     |
00002550  22 4f 53 5f 42 79 74 65  22 20 20 20 20 20 20 20  |"OS_Byte"       |
00002560  20 20 20 20 20 3b 20 45  6e 61 62 6c 65 20 45 73  |     ; Enable Es|
00002570  63 61 70 65 0d 0b b8 1c  20 20 20 20 a4 72 65 73  |cape....    .res|
00002580  74 6f 72 65 5f 6d 6f 64  65 28 70 61 73 73 25 29  |tore_mode(pass%)|
00002590  0d 0b c2 20 20 20 20 20  4c 44 4d 46 44 20 20 20  |...     LDMFD   |
000025a0  28 73 70 29 21 2c 7b 72  38 2d 72 39 2c 70 63 7d  |(sp)!,{r8-r9,pc}|
000025b0  0d 0b cc 05 3a 0d 0b d6  0f 3b 20 76 61 72 69 61  |....:....; varia|
000025c0  62 6c 65 73 0d 0b e0 17  2e 64 6f 69 6e 67 6e 6f  |bles.....doingno|
000025d0  77 20 20 20 3a 45 51 55  44 20 30 0d 0b ea 17 2e  |w   :EQUD 0.....|
000025e0  6b 65 79 31 70 72 65 73  73 65 64 3a 45 51 55 44  |key1pressed:EQUD|
000025f0  20 30 0d 0b f4 17 2e 6b  65 79 32 70 72 65 73 73  | 0.....key2press|
00002600  65 64 3a 45 51 55 44 20  30 0d 0b fe 17 2e 6b 65  |ed:EQUD 0.....ke|
00002610  79 33 70 72 65 73 73 65  64 3a 45 51 55 44 20 30  |y3pressed:EQUD 0|
00002620  0d 0c 08 17 2e 6b 65 79  34 70 72 65 73 73 65 64  |.....key4pressed|
00002630  3a 45 51 55 44 20 30 0d  0c 12 0e 2e 6f 73 63 6c  |:EQUD 0.....oscl|
00002640  69 6c 69 6e 65 0d 0c 1c  12 20 a4 72 65 73 65 72  |iline.... .reser|
00002650  76 65 28 32 35 36 29 0d  0c 26 24 2e 77 69 6d 70  |ve(256)..&$.wimp|
00002660  63 6f 6d 6d 61 6e 64 3a  45 51 55 53 20 22 47 4f  |command:EQUS "GO|
00002670  53 22 2b bd 30 3a 41 4c  49 47 4e 0d 0c 30 2b 2e  |S"+.0:ALIGN..0+.|
00002680  77 69 6d 70 76 61 72 20  20 20 20 3a 45 51 55 53  |wimpvar    :EQUS|
00002690  20 22 57 69 6d 70 24 53  74 61 74 65 22 2b bd 30  | "Wimp$State"+.0|
000026a0  3a 41 4c 49 47 4e 0d 0c  3a 28 2e 63 6f 6d 6d 61  |:ALIGN..:(.comma|
000026b0  6e 64 73 74 72 69 6e 67  3a 45 51 55 53 20 22 63  |ndstring:EQUS "c|
000026c0  6f 6d 6d 61 6e 64 73 22  3a 41 4c 49 47 4e 0d 0c  |ommands":ALIGN..|
000026d0  44 05 3a 0d 0c 4e 05 5d  0d 0c 58 20 f4 20 2a 2a  |D.:..N.]..X . **|
000026e0  2a 2a 20 45 6e 64 20 6f  66 20 6d 61 69 6e 20 63  |** End of main c|
000026f0  6f 64 65 20 2a 2a 2a 2a  0d 0c 62 36 f4 20 53 65  |ode ****..b6. Se|
00002700  74 20 66 69 6e 61 6c 20  70 6f 69 6e 74 65 72 20  |t final pointer |
00002710  74 6f 20 66 69 6e 64 20  74 68 65 20 6c 65 6e 67  |to find the leng|
00002720  74 68 20 6f 66 20 74 68  65 20 63 6f 64 65 0d 0c  |th of the code..|
00002730  6c 13 f2 70 61 74 63 68  5f 73 65 74 70 63 28 30  |l..patch_setpc(0|
00002740  29 0d 0c 76 0b ed 20 70  61 73 73 25 0d 0c 80 13  |)..v.. pass%....|
00002750  f2 70 61 74 63 68 5f 73  61 76 65 66 69 6c 65 0d  |.patch_savefile.|
00002760  0c 9e 28 f4 20 2a 2a 2a  2a 20 50 6f 73 74 2d 61  |..(. **** Post-a|
00002770  73 73 65 6d 62 6c 79 20  75 73 65 72 20 63 6f 64  |ssembly user cod|
00002780  65 20 2a 2a 2a 2a 2a 0d  0c a8 26 f4 20 2a 52 75  |e *****...&. *Ru|
00002790  6e 20 3c 54 61 73 6b 4b  69 6c 6c 65 72 24 44 69  |n <TaskKiller$Di|
000027a0  72 3e 2e 54 61 73 6b 4b  69 6c 6c 65 72 0d 0c b2  |r>.TaskKiller...|
000027b0  05 e0 0d 0c bc 05 3a 0d  0c c6 05 3a 0d 0c d0 40  |......:....:...@|
000027c0  f4 20 46 4e 73 79 73 74  65 6d 76 61 72 20 3a 20  |. FNsystemvar : |
000027d0  52 65 74 75 72 6e 20 74  68 65 20 63 6f 6e 74 65  |Return the conte|
000027e0  6e 74 73 20 6f 66 20 61  6e 79 20 73 74 72 69 6e  |nts of any strin|
000027f0  67 20 73 79 73 74 65 6d  20 76 61 72 0d 0c da 1c  |g system var....|
00002800  dd a4 73 79 73 74 65 6d  76 61 72 28 56 61 72 24  |..systemvar(Var$|
00002810  29 3a ea 20 61 64 64 72  0d 0c e4 3a c8 99 20 22  |):. addr...:.. "|
00002820  58 4f 53 5f 52 65 61 64  56 61 72 56 61 6c 22 2c  |XOS_ReadVarVal",|
00002830  56 61 72 24 2c 6d 65 73  73 61 67 65 5f 62 75 66  |Var$,message_buf|
00002840  66 65 72 25 2c 32 35 35  2c 30 2c 33 b8 2c 2c 6c  |fer%,255,0,3.,,l|
00002850  65 6e 0d 0c ee 1a 6d 65  73 73 61 67 65 5f 62 75  |en....message_bu|
00002860  66 66 65 72 25 3f 6c 65  6e 3d 31 33 0d 0c f8 15  |ffer%?len=13....|
00002870  3d 24 6d 65 73 73 61 67  65 5f 62 75 66 66 65 72  |=$message_buffer|
00002880  25 0d 0d 02 05 3a 0d 0d  0c 17 dd a4 73 65 74 5f  |%....:......set_|
00002890  61 73 5f 73 76 63 28 70  61 73 73 25 29 0d 0d 16  |as_svc(pass%)...|
000028a0  0e 5b 4f 50 54 20 70 61  73 73 25 0d 0d 20 3b 20  |.[OPT pass%.. ; |
000028b0  20 20 20 20 4d 4f 56 20  20 20 20 20 72 39 2c 20  |    MOV     r9, |
000028c0  70 63 20 20 20 20 20 20  20 20 20 20 3b 20 73 61  |pc          ; sa|
000028d0  76 65 20 63 75 72 72 65  6e 74 20 73 74 61 74 75  |ve current statu|
000028e0  73 2f 6d 6f 64 65 0d 0d  2a 41 20 20 20 20 20 84  |s/mode..*A     .|
000028f0  52 20 20 20 20 20 72 38  2c 20 72 39 2c 20 23 33  |R     r8, r9, #3|
00002900  20 20 20 20 20 20 3b 20  64 65 72 69 76 65 20 53  |      ; derive S|
00002910  56 43 2d 6d 6f 64 65 20  76 61 72 69 61 74 69 6f  |VC-mode variatio|
00002920  6e 20 6f 66 20 69 74 0d  0d 34 31 20 20 20 20 20  |n of it..41     |
00002930  54 45 51 50 20 20 20 20  72 38 2c 20 23 30 20 20  |TEQP    r8, #0  |
00002940  20 20 20 20 20 20 20 20  3b 20 65 6e 74 65 72 20  |        ; enter |
00002950  53 56 43 20 6d 6f 64 65  0d 0d 3e 26 20 20 20 20  |SVC mode..>&    |
00002960  20 4d 4f 56 20 20 20 20  20 72 30 2c 20 72 30 20  | MOV     r0, r0 |
00002970  20 20 20 20 20 20 20 20  20 3b 20 6e 6f 70 0d 0d  |         ; nop..|
00002980  48 2f 20 20 20 20 20 4d  4f 56 20 20 20 20 20 72  |H/     MOV     r|
00002990  38 2c 20 6c 69 6e 6b 20  20 20 20 20 20 20 20 3b  |8, link        ;|
000029a0  20 73 61 76 65 20 72 31  34 5f 73 76 63 0d 0d 52  | save r14_svc..R|
000029b0  0c 5d 3a 3d 70 61 73 73  25 0d 0d 5c 05 3a 0d 0d  |.]:=pass%..\.:..|
000029c0  66 19 dd a4 72 65 73 74  6f 72 65 5f 6d 6f 64 65  |f...restore_mode|
000029d0  28 70 61 73 73 25 29 0d  0d 70 0e 5b 4f 50 54 20  |(pass%)..p.[OPT |
000029e0  70 61 73 73 25 0d 0d 7a  32 20 20 20 20 20 4d 4f  |pass%..z2     MO|
000029f0  56 20 20 20 20 20 6c 69  6e 6b 2c 20 72 38 20 20  |V     link, r8  |
00002a00  20 20 20 20 20 20 3b 20  72 65 73 74 6f 72 65 20  |      ; restore |
00002a10  72 31 34 5f 73 76 63 0d  0d 84 43 20 20 20 20 20  |r14_svc...C     |
00002a20  54 45 51 50 20 20 20 20  72 39 2c 20 23 30 20 20  |TEQP    r9, #0  |
00002a30  20 20 20 20 20 20 20 20  3b 20 72 65 2d 65 6e 74  |        ; re-ent|
00002a40  65 72 20 6f 72 69 67 69  6e 61 6c 20 70 72 6f 63  |er original proc|
00002a50  65 73 73 6f 72 20 6d 6f  64 65 0d 0d 8e 26 20 20  |essor mode...&  |
00002a60  20 20 20 4d 4f 56 20 20  20 20 20 72 30 2c 20 72  |   MOV     r0, r|
00002a70  30 20 20 20 20 20 20 20  20 20 20 3b 20 6e 6f 70  |0          ; nop|
00002a80  0d 0d 98 0c 5d 3a 3d 70  61 73 73 25 0d 0d a2 21  |....]:=pass%...!|
00002a90  f4 20 2a 2a 2a 2a 20 46  69 6c 69 6e 67 20 70 72  |. **** Filing pr|
00002aa0  6f 63 65 64 75 72 65 73  20 2a 2a 2a 2a 0d 0d ac  |ocedures ****...|
00002ab0  05 3a 0d 0d b6 15 dd 20  f2 70 61 74 63 68 5f 6c  |.:..... .patch_l|
00002ac0  6f 61 64 66 69 6c 65 0d  0d c0 0d 63 6f 64 65 6c  |oadfile....codel|
00002ad0  65 6e 3d 30 0d 0d ca 0f  de 20 4d 43 25 20 26 31  |en=0..... MC% &1|
00002ae0  34 30 30 0d 0d d4 24 65  6e 64 6f 66 63 6f 64 65  |400...$endofcode|
00002af0  3d 63 6f 64 65 6c 65 6e  2b 26 30 3a 6d 61 78 3d  |=codelen+&0:max=|
00002b00  63 6f 64 65 6c 65 6e 0d  0d de 19 4c 25 3d 65 6e  |codelen....L%=en|
00002b10  64 6f 66 63 6f 64 65 3a  5f 5f 63 61 70 25 3d a3  |dofcode:__cap%=.|
00002b20  0d 0e 42 05 e1 0d 0e 4c  05 3a 0d 0e 56 15 dd 20  |..B....L.:..V.. |
00002b30  f2 70 61 74 63 68 5f 73  61 76 65 66 69 6c 65 0d  |.patch_savefile.|
00002b40  0e 60 2a 6f 75 74 66 69  6c 65 24 3d 22 3c 54 61  |.`*outfile$="<Ta|
00002b50  73 6b 4b 69 6c 6c 65 72  24 44 69 72 3e 2e 54 61  |skKiller$Dir>.Ta|
00002b60  73 6b 4b 69 6c 6c 65 72  22 0d 0e 6a 31 ff 28 22  |skKiller"..j1.("|
00002b70  53 61 76 65 20 22 2b 6f  75 74 66 69 6c 65 24 2b  |Save "+outfile$+|
00002b80  22 20 22 2b c3 7e 4d 43  25 2b 22 20 22 2b c3 7e  |" "+.~MC%+" "+.~|
00002b90  28 6d 61 78 2b 4d 43 25  29 29 0d 0e 74 24 ff 28  |(max+MC%))..t$.(|
00002ba0  22 53 65 74 74 79 70 65  20 22 2b 6f 75 74 66 69  |"Settype "+outfi|
00002bb0  6c 65 24 2b 22 20 4d 6f  64 75 6c 65 22 29 0d 0e  |le$+" Module")..|
00002bc0  7e 20 70 61 74 63 68 64  69 72 24 3d 22 3c 54 61  |~ patchdir$="<Ta|
00002bd0  73 6b 4b 69 6c 6c 65 72  24 44 69 72 3e 22 0d 0e  |skKiller$Dir>"..|
00002be0  a6 05 e1 0d 0e b0 05 3a  0d 0e ba 1d f4 20 2a 2a  |.......:..... **|
00002bf0  2a 2a 20 45 72 72 6f 72  20 48 61 6e 64 6c 65 72  |** Error Handler|
00002c00  20 2a 2a 2a 2a 0d 0e c4  05 3a 0d 0e ce 0b dd f2  | ****....:......|
00002c10  45 72 72 6f 72 0d 0f 1e  1b 85 20 a2 20 9f 2c f6  |Error..... . .,.|
00002c20  24 2b 22 20 61 74 20 6c  69 6e 65 20 22 2b c3 9e  |$+" at line "+..|
00002c30  0d 0f 28 05 e1 0d 0f 32  05 3a 0d 0f 3c 22 f4 20  |..(....2.:..<". |
00002c40  2a 2a 2a 2a 20 55 74 69  6c 69 74 79 20 70 72 6f  |**** Utility pro|
00002c50  63 65 64 75 72 65 73 20  2a 2a 2a 2a 0d 0f 46 05  |cedures ****..F.|
00002c60  3a 0d 0f 50 14 dd f2 70  61 74 63 68 5f 73 65 74  |:..P...patch_set|
00002c70  70 63 28 6e 29 0d 0f 5a  1a e7 20 50 25 2d 26 30  |pc(n)..Z.. P%-&0|
00002c80  3e 6d 61 78 20 8c 6d 61  78 3d 50 25 2d 26 30 0d  |>max .max=P%-&0.|
00002c90  0f 64 14 50 25 3d 6e 3a  4f 25 3d 4d 43 25 2b 6e  |.d.P%=n:O%=MC%+n|
00002ca0  2d 26 30 0d 0f 6e 05 e1  0d 0f 78 05 3a 0d 0f 82  |-&0..n....x.:...|
00002cb0  22 dd a4 66 69 6e 64 66  72 65 65 72 65 67 28 61  |"..findfreereg(a|
00002cc0  2c 62 2c 63 2c 64 29 3a  ea 20 6e 3a 6e 3d 30 0d  |,b,c,d):. n:n=0.|
00002cd0  0f 8c 1c c8 95 20 6e 3d  61 20 84 20 6e 3d 62 20  |..... n=a . n=b |
00002ce0  84 20 6e 3d 63 20 84 20  6e 3d 64 0d 0f 96 09 20  |. n=c . n=d.... |
00002cf0  6e 2b 3d 31 0d 0f a0 05  ce 0d 0f aa 06 3d 6e 0d  |n+=1.........=n.|
00002d00  0f b4 05 3a 0d 0f be 2b  f4 20 46 4e 72 65 73 65  |...:...+. FNrese|
00002d10  72 76 65 20 3a 20 52 65  73 65 72 76 65 20 73 70  |rve : Reserve sp|
00002d20  61 63 65 20 66 6f 72 20  78 20 62 79 74 65 73 0d  |ace for x bytes.|
00002d30  0f c8 29 dd a4 72 65 73  65 72 76 65 28 62 79 74  |..)..reserve(byt|
00002d40  65 73 29 3a 62 79 74 65  73 3d 28 62 79 74 65 73  |es):bytes=(bytes|
00002d50  2b 33 29 20 80 20 2d 34  0d 0f d2 15 e7 20 28 70  |+3) . -4..... (p|
00002d60  61 73 73 25 20 80 20 32  29 3d 32 20 8c 0d 0f dc  |ass% . 2)=2 ....|
00002d70  22 20 ea 20 49 3a e3 20  49 3d 30 b8 62 79 74 65  |" . I:. I=0.byte|
00002d80  73 2d 34 20 88 34 3a 4f  25 21 49 3d 30 3a ed 0d  |s-4 .4:O%!I=0:..|
00002d90  0f e6 05 cd 0d 0f f0 17  50 25 2b 3d 62 79 74 65  |........P%+=byte|
00002da0  73 3a 4f 25 2b 3d 62 79  74 65 73 0d 0f fa 06 3d  |s:O%+=bytes....=|
00002db0  30 0d 10 04 05 3a 0d 10  0e 23 f4 20 2a 2a 2a 2a  |0....:...#. ****|
00002dc0  20 45 52 52 20 6d 61 63  72 6f 20 70 72 6f 63 65  | ERR macro proce|
00002dd0  64 75 72 65 20 2a 2a 2a  2a 0d 10 18 05 3a 0d 10  |dure ****....:..|
00002de0  22 32 f4 20 46 4e 65 72  72 6f 72 20 3a 20 43 72  |"2. FNerror : Cr|
00002df0  65 61 74 65 20 61 6e 20  65 72 72 6f 72 20 77 68  |eate an error wh|
00002e00  69 63 68 20 69 73 20 72  65 70 6f 72 74 65 64 2e  |ich is reported.|
00002e10  0d 10 2c 0f dd a4 65 72  72 6f 72 28 61 24 29 0d  |..,...error(a$).|
00002e20  10 36 0e 5b 4f 50 54 20  70 61 73 73 25 0d 10 40  |.6.[OPT pass%..@|
00002e30  15 20 20 41 44 44 20 20  20 20 72 30 2c 70 63 2c  |.  ADD    r0,pc,|
00002e40  23 30 0d 10 4a 1f 20 20  53 57 49 20 20 20 20 22  |#0..J.  SWI    "|
00002e50  4f 53 5f 47 65 6e 65 72  61 74 65 45 72 72 6f 72  |OS_GenerateError|
00002e60  22 0d 10 54 0e 20 20 45  51 55 44 20 20 20 31 0d  |"..T.  EQUD   1.|
00002e70  10 5e 12 20 20 45 51 55  53 20 20 20 61 24 2b bd  |.^.  EQUS   a$+.|
00002e80  30 0d 10 68 0b 20 20 41  4c 49 47 4e 0d 10 72 05  |0..h.  ALIGN..r.|
00002e90  5d 0d 10 7c 06 3d 30 0d  10 86 05 3a 0d 7f 7f 0d  |]..|.=0....:....|
00002ea0  f4 20 4a 46 50 61 74 63  68 0d ff                 |. JFPatch..|
00002eab