Home » Archimedes archive » Acorn User » AU 1994-03.adf » !StarInfo_StarInfo » Patterson/SpoolSrc

Patterson/SpoolSrc

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 1994-03.adf » !StarInfo_StarInfo
Filename: Patterson/SpoolSrc
Read OK:
File size: 1F8A bytes
Load address: 0000
Exec address: 0000
File contents
   10REM     >SpoolSrc
   20REM By  Tony Patterson
   30REM For 32-bit machines
   40REM (c) AU March 1994
   50
   60ON ERROR ON ERROR OFF:ERROR ERR, REPORT$+" at line "+STR$ERL
   70
   80DIM code% &10000
   90
  100UpcallV=&1D
  110
  120module_claim=6
  130module_free =7
  140
  150v_flag=1<<28
  160
  170pw=12
  180sp=13
  190link=14
  200
  210P%=0:O%=code%
  220
  230[OPT 6
  240.file_number   EQUD 0
  250.handle        EQUD 0
  260.file_watch    EQUD 0
  270.closed_handle EQUD 0
  280.output_handle EQUD 0
  290]
  300wkspc_size=P%
  310
  320FOR pass=4 TO 6 STEP 2
  330
  340P%=0:O%=code%
  350
  360[OPT pass
  370FNmodule_header
  380.error_nem FNerror("Not enough memory in module area")
  390.error_miu FNerror("Module in use")
  400.error_pfa FNerror("PrintFile is already printing")
  410ALIGN
  420
  430.init
  440STMFD   (sp)!,{link}
  450
  460; Claim workspace
  470
  480MOV     R0,#module_claim
  490MOV     R3,#wkspc_size
  500SWI     "XOS_Module"
  510ADRVS   R0,error_nem
  520LDMVSFD (sp)!,{PC}
  530STR     R2,[pw]
  540MOV     pw,R2
  550
  560; initialise vars
  570
  580MOV     R1,#0
  590STR     R1,[pw,#file_number]
  600STR     R1,[pw,#handle]
  610STR     R1,[pw,#file_watch]
  620STR     R1,[pw,#closed_handle]
  630
  640; Claim UpCall vector (R2 is already set)
  650
  660ADR     R1,upcall_intercept
  670MOV     R0,#UpcallV
  680SWI     "XOS_Claim"
  690
  700LDMFD   (sp)!,{PC}^
  710
  720.finalise
  730LDR     pw,[pw]
  740STMFD   (sp)!,{link}
  750BL      free_watch
  760LDR     R0,[pw,#handle]
  770TEQ     R0,#0
  780ADRNE   R0,error_miu
  790LDMNEFD (sp)!,{link}
  800ORRNES  PC,link,#v_flag
  810MOV     R2,pw
  820ADR     R1,upcall_intercept
  830MOV     R0,#UpcallV
  840SWI     "XOS_Release"
  850
  860; Free workspace
  870
  880MOV     R0,#module_free
  890SWI     "XOS_Module"
  900LDMFD   (sp)!,{PC}^
  910
  920.print_some_when_ready
  930STMFD   (sp)!,{R0-R1,link}
  940ADR     R0,print_some
  950MOV     R1,pw
  960SWI     "XOS_AddCallBack"
  970LDMFD   (sp)!,{R0-R1,PC}^
  980
  990.print_some
 1000STMFD   (sp)!,{R0-R6,link}
 1010; examine buffer, R4=free space
 1020MOV     R0,#128
 1030MOV     R1,#252
 1040SWI     "XOS_Byte"
 1050ADDS    R5,R1,R2,LSL #8
 1060BEQ     set_callback       ; is full
 1070
 1080MOV     R3,R5
 1090MOV     R0,#module_claim
 1100SWI     "XOS_Module"
 1110MOV     R6,R2
 1120
 1130MOV     R0,#4
 1140LDR     R1,[pw,#handle]
 1150MOV     R3,R5
 1160
 1170SWI     "XOS_GBPB"
 1180
 1190SUBS    R3,R5,R3
 1200BLEQ    free_temp
 1210BEQ     eof_reached
 1220
 1230MOV     R0,#2
 1240LDR     R1,[pw,#output_handle]
 1250MOV     R2,R6
 1260SWI     "OS_GBPB"
 1270
 1280BL      free_temp
 1290
 1300.set_callback
 1310MOV     R0,#10
 1320ADR     R1,print_some_when_ready
 1330MOV     R2,pw
 1340SWI     "XOS_CallAfter"
 1350LDMFD   (sp)!,{R0-R6,PC}^
 1360
 1370.free_temp
 1380STMFD   (sp)!,{link}
 1390MOV     R2,R6
 1400MOV     R0,#module_free
 1410SWI     "XOS_Module"
 1420LDMFD   (sp)!,{PC}^
 1430
 1440.error_pfa_ind EQUD error_pfa
 1450
 1460.printfile
 1470LDR     pw,[pw]
 1480STMFD   (sp)!,{R0-R6,link}
 1490MOV     R1,R0
 1500LDR     link,[pw,#handle]
 1510TEQ     link,#0
 1520LDRNE   R0,error_pfa_ind
 1530SWINE   "OS_GenerateError"
 1540.printfile2
 1550LDR     link,[pw,#handle]
 1560TEQ     link,#0
 1570LDMNEFD (sp)!,{R0-R6,PC}^
 1580
 1590MOV     R0,#&4C
 1600SWI     "XOS_Find"
 1610ADDVS   sp,sp,#4
 1620LDMVSFD (sp)!,{R1-R4,PC}
 1630STR     R0,[pw,#handle]
 1640
 1650MOV     R0,#&80
 1660ADR     R1,output_stream
 1670SWI     "XOS_Find"
 1680ADDVS   sp,sp,#4
 1690LDMVSFD (sp)!,{R1-R4,PC}
 1700STR     R0,[pw,#output_handle]
 1710
 1720B       set_callback
 1730
 1740.eof_reached
 1750MOV     R0,#0
 1760STR     R0,[pw,#handle]
 1770SWI     "XOS_Find"
 1780
 1790MOV     R0,#0
 1800LDR     R1,[pw,#output_handle]
 1810SWI     "XOS_Find"
 1820
 1830LDMFD   (sp)!,{R0-R6,PC}^
 1840
 1850.report_watch
 1860LDR     R0,[pw,#file_watch]
 1870TEQ     R0,#0
 1880BEQ     no_watch
 1890SWI     "XOS_WriteS"
 1900EQUS    "The current PrintWatch file is : '"
 1910EQUB 0
 1920ALIGN
 1930SWI     "XOS_Write0"
 1940SWI     &100+ASC("'")
 1950SWI     "XOS_NewLine"
 1960LDMFD   (sp)!,{PC}^
 1970
 1980.no_watch
 1990SWI     "XOS_WriteS"
 2000EQUS    "There is no PrintWatch file"
 2010EQUB 0
 2020ALIGN
 2030SWI     "XOS_NewLine"
 2040LDMFD   (sp)!,{PC}^
 2050
 2060.printwatch
 2070LDR     pw,[pw]
 2080STMFD   (sp)!,{link}
 2090TEQ     R1,#0
 2100BEQ     report_watch
 2110MOV     R6,R0
 2120BL      free_watch
 2130MOV     R0,#37
 2140MOV     R1,R6
 2150MOV     R2,#0
 2160MOV     R3,#0
 2170MOV     R4,#0
 2180MOV     R5,#0
 2190SWI     "XOS_FSControl"
 2200LDMVSFD (sp)!,{PC}
 2210MOV     R0,#module_claim
 2220RSB     R3,R5,#1
 2230SWI     "XOS_Module"
 2240LDMVSFD (sp)!,{PC}
 2250STR     R2,[pw,#file_watch]
 2260MOV     R5,R3
 2270MOV     R0,#37
 2280MOV     R1,R6
 2290MOV     R3,#0
 2300MOV     R4,#0
 2310SWI     "XOS_FSControl"
 2320LDMFD   (sp)!,{PC}^
 2330
 2340.free_watch
 2350STMFD   (sp)!,{link}
 2360MOV     R0,#module_free
 2370LDR     R2,[pw,#file_watch]
 2380TEQ     R2,#0
 2390SWINE   "XOS_Module"
 2400LDMFD   (sp)!,{PC}^
 2410
 2420.upcall_intercept
 2430TEQ     R0,#3
 2440MOVNES  PC,link
 2450SUB     R9,R9,#256
 2460TEQ     R9,#1
 2470TEQNE   R9,#2
 2480BEQ     opened_for_write
 2490TEQ     R9,#3
 2500ADD     R9,R9,#256
 2510MOVNES  PC,link
 2520STMFD   (sp)!,{R0-R1,link}
 2530
 2540LDR     link,[pw,#file_watch]
 2550TEQ     link,#0
 2560LDMEQFD (sp)!,{R0-R1,PC}^
 2570
 2580LDR     link,[pw,#closed_handle]
 2590TEQ     link,R1
 2600
 2610ADREQ   R0,file_closed
 2620MOVEQ   R1,pw
 2630SWIEQ   "XOS_AddCallBack"
 2640LDMFD   (sp)!,{R0-R1,PC}^
 2650
 2660.file_closed
 2670STMFD   (sp)!,{R0-R6,link}
 2680MOV     link,#0
 2690STR     link,[pw,#closed_handle]
 2700LDR     R1,[pw,#file_watch]
 2710B       printfile2
 2720
 2730.opened_for_write
 2740ADD     R9,R9,#256
 2750STMFD   (sp)!,{R0-R8,link}
 2760MOV     R8,R2
 2770MOV     R7,R1
 2780MOV     R0,#37
 2790MOV     R1,R7
 2800MOV     R2,#0
 2810MOV     R3,#0
 2820MOV     R4,#0
 2830MOV     R5,#0
 2840SWI     "XOS_FSControl"
 2850LDMVSFD (sp)!,{R0-R8,PC}
 2860MOV     R0,#module_claim
 2870RSB     R3,R5,#1
 2880SWI     "XOS_Module"
 2890MOV     R6,R2
 2900LDMVSFD (sp)!,{R0-R8,PC}
 2910MOV     R5,R3
 2920MOV     R0,#37
 2930MOV     R1,R7
 2940MOV     R3,#0
 2950MOV     R4,#0
 2960SWI     "XOS_FSControl"
 2970MOV     R0,R6
 2980LDR     R1,[pw,#file_watch]
 2990BL      strcmp
 3000STREQ   R8,[pw,#closed_handle]
 3010MOV     R2,R6
 3020MOV     R0,#module_free
 3030SWI     "XOS_Module"
 3040LDMFD   (sp)!,{R0-R8,PC}^
 3050
 3060.strcmp
 3070STMFD   (sp)!,{R0-R3,link}
 3080
 3090.strcmp_loop
 3100LDRB    R2,[R0],#1
 3110LDRB    R3,[R1],#1
 3120
 3130CMP     R2,#ASC("a")  ; fold case of R2
 3140BLT     R2_too_low
 3150CMP     R2,#ASC("z")
 3160ANDLE   R2,R2,#223
 3170.R2_too_low
 3180
 3190CMP     R3,#ASC("a")  ; fold R3
 3200BLT     R3_too_low
 3210CMP     R3,#ASC("z")
 3220ANDLE   R3,R3,#223.
 3230.R3_too_low
 3240
 3250CMP     R3,#ASC(" ")
 3260BLT     strcmp_exit
 3270CMP     R2,#ASC(" ")
 3280BLT     strcmp_exit
 3290CMP     R2,R3
 3300LDMNEFD (sp)!,{R0-R3,PC}
 3310B       strcmp_loop      ; repeat if limit not reached else exit with condition
 3320
 3330.strcmp_exit
 3340CMP     R2,#ASC(" ")
 3350MOVLT   R2,#0
 3360CMP     R3,#ASC(" ")
 3370MOVLT   R3,#0
 3380CMP     R2,R3
 3390LDMFD   (sp)!,{R0-R3,PC} ; No '^' so we can return flags we have just set
 3400
 3410.output_stream EQUS "<PrinterType$1>"+CHR$0 ; Parallel device
 3420]
 3430NEXT
 3440
 3450PROCmodule_save("SpoolMod",code%,O%)
 3460
 3470END
 3480
 3490DEF FNmodule_header
 3500[OPT pass
 3510EQUD 0
 3520EQUD init
 3530EQUD finalise
 3540EQUD 0
 3550EQUD title
 3560EQUD help
 3570EQUD commands
 3580EQUD 0
 3590.title
 3600EQUS "PrintSpooler"
 3610EQUB 0
 3620.help
 3630EQUS "Print Spooler"
 3640EQUB 9
 3650EQUS "1.00 (29 Aug 1993)"
 3660EQUB 0
 3670.comhelp
 3680EQUS "*PrintFile prints a file in the background."
 3690EQUB 13
 3700.syntax
 3710EQUS "Syntax: *PrintFile <filename>"
 3720EQUB 0
 3730.comhelp_watch
 3740EQUS "*PrintWatch waits for the named file to be closed, then prints it. "
 3750EQUS "If no file is given, the current PrintWatch filename is reported."
 3760EQUB 13
 3770.syntax_watch
 3780EQUS "Syntax: *PrintWatch [<filename>]"
 3790EQUB 0
 3800
 3810ALIGN
 3820.commands
 3830FNcommand("PrintFile", "printfile", &00010001,syntax,      comhelp      )
 3840FNcommand("PrintWatch","printwatch",&00010000,syntax_watch,comhelp_watch)
 3850EQUB 0
 3860ALIGN
 3870]
 3880=""
 3890
 3900DEF FNerror(a$)
 3910[OPT pass
 3920EQUD 0
 3930EQUS a$
 3940EQUB 0
 3950]
 3960=""
 3970
 3980DEF FNcommand(a$,com$,flags,syntax,help)
 3990LOCAL addr
 4000IF pass=6 addr=EVAL(com$)
 4010[OPTpass
 4020EQUS a$
 4030EQUB 0
 4040ALIGN
 4050EQUD addr
 4060EQUD flags
 4070EQUD syntax
 4080EQUD help
 4090]
 4100=""
 4110
 4120DEF PROCmodule_save(f$,s%,e%)
 4130SYS "OS_Module",11,s%,e%-s%
 4140SYS "OS_File",10,f$,&FFA,,s%,e%
 4150ENDPROC

�     >SpoolSrc
� By  Tony Patterson
� For 32-bit machines
(� (c) AU March 1994
2
<$� � � � �:� �, �$+" at line "+Þ
F
P� code% &10000
Z
dUpcallV=&1D
n
xmodule_claim=6
�module_free =7
�
�v_flag=1<<28
�
�	pw=12
�	sp=13
�link=14
�
�P%=0:O%=code%
�
�
[OPT 6
�.file_number   EQUD 0
�.handle        EQUD 0
.file_watch    EQUD 0
.closed_handle EQUD 0
.output_handle EQUD 0
"]
,wkspc_size=P%
6
@� pass=4 � 6 � 2
J
TP%=0:O%=code%
^
h
[OPT pass
r�module_header
|9.error_nem �error("Not enough memory in module area")
�&.error_miu �error("Module in use")
�6.error_pfa �error("PrintFile is already printing")
�	ALIGN
�
�	.init
�STMFD   (sp)!,{link}
�
�; Claim workspace
�
�MOV     R0,#module_claim
�MOV     R3,#wkspc_size
�SWI     "XOS_Module"
�ADRVS   R0,error_nem
LDMVSFD (sp)!,{PC}
STR     R2,[pw]
MOV     pw,R2
&
0; initialise vars
:
DMOV     R1,#0
N STR     R1,[pw,#file_number]
XSTR     R1,[pw,#handle]
bSTR     R1,[pw,#file_watch]
l"STR     R1,[pw,#closed_handle]
v
�-; Claim UpCall vector (R2 is already set)
�
�ADR     R1,upcall_intercept
�MOV     R0,#UpcallV
�SWI     "XOS_Claim"
�
�LDMFD   (sp)!,{PC}^
�
�
.finalise
�LDR     pw,[pw]
�STMFD   (sp)!,{link}
�BL      free_watch
�LDR     R0,[pw,#handle]
TEQ     R0,#0
ADRNE   R0,error_miu
LDMNEFD (sp)!,{link}
 �RNES  PC,link,#v_flag
*MOV     R2,pw
4ADR     R1,upcall_intercept
>MOV     R0,#UpcallV
HSWI     "XOS_Release"
R
\; Free workspace
f
pMOV     R0,#module_free
zSWI     "XOS_Module"
�LDMFD   (sp)!,{PC}^
�
�.print_some_when_ready
�STMFD   (sp)!,{R0-R1,link}
�ADR     R0,print_some
�MOV     R1,pw
�SWI     "XOS_AddCallBack"
�LDMFD   (sp)!,{R0-R1,PC}^
�
�.print_some
�STMFD   (sp)!,{R0-R6,link}
�#; examine buffer, R4=free space
�MOV     R0,#128
MOV     R1,#252
SWI     "XOS_Byte"
ADDS    R5,R1,R2,LSL #8
$(BEQ     set_callback       ; is full
.
8MOV     R3,R5
BMOV     R0,#module_claim
LSWI     "XOS_Module"
VMOV     R6,R2
`
jMOV     R0,#4
tLDR     R1,[pw,#handle]
~MOV     R3,R5
�
�SWI     "XOS_GBPB"
�
�SUBS    R3,R5,R3
�BLEQ    free_temp
�BEQ     eof_reached
�
�MOV     R0,#2
�"LDR     R1,[pw,#output_handle]
�MOV     R2,R6
�SWI     "OS_GBPB"
�
BL      free_temp


.set_callback
MOV     R0,#10
($ADR     R1,print_some_when_ready
2MOV     R2,pw
<SWI     "XOS_CallAfter"
FLDMFD   (sp)!,{R0-R6,PC}^
P
Z.free_temp
dSTMFD   (sp)!,{link}
nMOV     R2,R6
xMOV     R0,#module_free
�SWI     "XOS_Module"
�LDMFD   (sp)!,{PC}^
�
�!.error_pfa_ind EQUD error_pfa
�
�.printfile
�LDR     pw,[pw]
�STMFD   (sp)!,{R0-R6,link}
�MOV     R1,R0
�LDR     link,[pw,#handle]
�TEQ     link,#0
�LDRNE   R0,error_pfa_ind
�SWINE   "OS_GenerateError"
.printfile2
LDR     link,[pw,#handle]
TEQ     link,#0
"LDMNEFD (sp)!,{R0-R6,PC}^
,
6MOV     R0,#&4C
@SWI     "XOS_Find"
JADDVS   sp,sp,#4
TLDMVSFD (sp)!,{R1-R4,PC}
^STR     R0,[pw,#handle]
h
rMOV     R0,#&80
|ADR     R1,output_stream
�SWI     "XOS_Find"
�ADDVS   sp,sp,#4
�LDMVSFD (sp)!,{R1-R4,PC}
�"STR     R0,[pw,#output_handle]
�
�B       set_callback
�
�.eof_reached
�MOV     R0,#0
�STR     R0,[pw,#handle]
�SWI     "XOS_Find"
�
�MOV     R0,#0
"LDR     R1,[pw,#output_handle]
SWI     "XOS_Find"

&LDMFD   (sp)!,{R0-R6,PC}^
0
:.report_watch
DLDR     R0,[pw,#file_watch]
NTEQ     R0,#0
XBEQ     no_watch
bSWI     "XOS_WriteS"
l0EQUS    "The current PrintWatch file is : '"
v
EQUB 0
�	ALIGN
�SWI     "XOS_Write0"
�SWI     &100+�("'")
�SWI     "XOS_NewLine"
�LDMFD   (sp)!,{PC}^
�
�
.no_watch
�SWI     "XOS_WriteS"
�)EQUS    "There is no PrintWatch file"
�
EQUB 0
�	ALIGN
�SWI     "XOS_NewLine"
�LDMFD   (sp)!,{PC}^

.printwatch
LDR     pw,[pw]
 STMFD   (sp)!,{link}
*TEQ     R1,#0
4BEQ     report_watch
>MOV     R6,R0
HBL      free_watch
RMOV     R0,#37
\MOV     R1,R6
fMOV     R2,#0
pMOV     R3,#0
zMOV     R4,#0
�MOV     R5,#0
�SWI     "XOS_FSControl"
�LDMVSFD (sp)!,{PC}
�MOV     R0,#module_claim
�RSB     R3,R5,#1
�SWI     "XOS_Module"
�LDMVSFD (sp)!,{PC}
�STR     R2,[pw,#file_watch]
�MOV     R5,R3
�MOV     R0,#37
�MOV     R1,R6
�MOV     R3,#0
�MOV     R4,#0
	SWI     "XOS_FSControl"
	LDMFD   (sp)!,{PC}^
	
	$.free_watch
	.STMFD   (sp)!,{link}
	8MOV     R0,#module_free
	BLDR     R2,[pw,#file_watch]
	LTEQ     R2,#0
	VSWINE   "XOS_Module"
	`LDMFD   (sp)!,{PC}^
	j
	t.upcall_intercept
	~TEQ     R0,#3
	�MOVNES  PC,link
	�SUB     R9,R9,#256
	�TEQ     R9,#1
	�TEQNE   R9,#2
	�BEQ     opened_for_write
	�TEQ     R9,#3
	�ADD     R9,R9,#256
	�MOVNES  PC,link
	�STMFD   (sp)!,{R0-R1,link}
	�
	�!LDR     link,[pw,#file_watch]
	�TEQ     link,#0
LDMEQFD (sp)!,{R0-R1,PC}^


$LDR     link,[pw,#closed_handle]
TEQ     link,R1
(
2ADREQ   R0,file_closed
<�Q   R1,pw
FSWIEQ   "XOS_AddCallBack"
PLDMFD   (sp)!,{R0-R1,PC}^
Z
d.file_closed
nSTMFD   (sp)!,{R0-R6,link}
xMOV     link,#0
�$STR     link,[pw,#closed_handle]
�LDR     R1,[pw,#file_watch]
�B       printfile2
�
�.opened_for_write
�ADD     R9,R9,#256
�STMFD   (sp)!,{R0-R8,link}
�MOV     R8,R2
�MOV     R7,R1
�MOV     R0,#37
�MOV     R1,R7
�MOV     R2,#0
�MOV     R3,#0
MOV     R4,#0
MOV     R5,#0
SWI     "XOS_FSControl"
"LDMVSFD (sp)!,{R0-R8,PC}
,MOV     R0,#module_claim
6RSB     R3,R5,#1
@SWI     "XOS_Module"
JMOV     R6,R2
TLDMVSFD (sp)!,{R0-R8,PC}
^MOV     R5,R3
hMOV     R0,#37
rMOV     R1,R7
|MOV     R3,#0
�MOV     R4,#0
�SWI     "XOS_FSControl"
�MOV     R0,R6
�LDR     R1,[pw,#file_watch]
�BL      strcmp
�"STREQ   R8,[pw,#closed_handle]
�MOV     R2,R6
�MOV     R0,#module_free
�SWI     "XOS_Module"
�LDMFD   (sp)!,{R0-R8,PC}^
�
�.strcmp
�STMFD   (sp)!,{R0-R3,link}

.strcmp_loop
LDRB    R2,[R0],#1
&LDRB    R3,[R1],#1
0
:)CMP     R2,#�("a")  ; fold case of R2
DBLT     R2_too_low
NCMP     R2,#�("z")
X�LE   R2,R2,#223
b.R2_too_low
l
v!CMP     R3,#�("a")  ; fold R3
�BLT     R3_too_low
�CMP     R3,#�("z")
��LE   R3,R3,#223.
�.R3_too_low
�
�CMP     R3,#�(" ")
�BLT     strcmp_exit
�CMP     R2,#�(" ")
�BLT     strcmp_exit
�CMP     R2,R3
�LDMNEFD (sp)!,{R0-R3,PC}
�SB       strcmp_loop      ; repeat if limit not reached else exit with condition
�

.strcmp_exit

CMP     R2,#�(" ")

MOVLT   R2,#0

 CMP     R3,#�(" ")

*MOVLT   R3,#0

4CMP     R2,R3

>MLDMFD   (sp)!,{R0-R3,PC} ; No '^' so we can return flags we have just set

H

R>.output_stream EQUS "<PrinterType$1>"+�0 ; Parallel device

\]

f�

p

z%�module_save("SpoolMod",code%,O%)

�

��

�

�� �module_header

�
[OPT pass

�
EQUD 0

�
EQUD init

�EQUD finalise

�
EQUD 0

�EQUD title

�
EQUD help

�EQUD commands

�
EQUD 0

.title
EQUS "PrintSpooler"

EQUB 0
$	.help
.EQUS "Print Spooler"
8
EQUB 9
BEQUS "1.00 (29 Aug 1993)"
L
EQUB 0
V.comhelp
`6EQUS "*PrintFile prints a file in the background."
jEQUB 13
t.syntax
~(EQUS "Syntax: *PrintFile <filename>"
�
EQUB 0
�.comhelp_watch
�NEQUS "*PrintWatch waits for the named file to be closed, then prints it. "
�LEQUS "If no file is given, the current PrintWatch filename is reported."
�EQUB 13
�.syntax_watch
�+EQUS "Syntax: *PrintWatch [<filename>]"
�
EQUB 0
�
�	ALIGN
�
.commands
�L�command("PrintFile", "printfile", &00010001,syntax,      comhelp      )
L�command("PrintWatch","printwatch",&00010000,syntax_watch,comhelp_watch)


EQUB 0
	ALIGN
]
(=""
2
<� �error(a$)
F
[OPT pass
P
EQUD 0
ZEQUS a$
d
EQUB 0
n]
x=""
�
�)� �command(a$,com$,flags,syntax,help)
�
� addr
�� pass=6 addr=�(com$)
�[OPTpass
�EQUS a$
�
EQUB 0
�	ALIGN
�
EQUD addr
�EQUD flags
�EQUD syntax
�
EQUD help
�]
=""

� �module_save(f$,s%,e%)
"ș "OS_Module",11,s%,e%-s%
,"ș "OS_File",10,f$,&FFA,,s%,e%
6�
�
00000000  0d 00 0a 13 f4 20 20 20  20 20 3e 53 70 6f 6f 6c  |.....     >Spool|
00000010  53 72 63 0d 00 14 18 f4  20 42 79 20 20 54 6f 6e  |Src..... By  Ton|
00000020  79 20 50 61 74 74 65 72  73 6f 6e 0d 00 1e 19 f4  |y Patterson.....|
00000030  20 46 6f 72 20 33 32 2d  62 69 74 20 6d 61 63 68  | For 32-bit mach|
00000040  69 6e 65 73 0d 00 28 17  f4 20 28 63 29 20 41 55  |ines..(.. (c) AU|
00000050  20 4d 61 72 63 68 20 31  39 39 34 0d 00 32 04 0d  | March 1994..2..|
00000060  00 3c 24 ee 20 85 20 ee  20 85 20 87 3a 85 20 9f  |.<$. . . . .:. .|
00000070  2c 20 f6 24 2b 22 20 61  74 20 6c 69 6e 65 20 22  |, .$+" at line "|
00000080  2b c3 9e 0d 00 46 04 0d  00 50 12 de 20 63 6f 64  |+....F...P.. cod|
00000090  65 25 20 26 31 30 30 30  30 0d 00 5a 04 0d 00 64  |e% &10000..Z...d|
000000a0  0f 55 70 63 61 6c 6c 56  3d 26 31 44 0d 00 6e 04  |.UpcallV=&1D..n.|
000000b0  0d 00 78 12 6d 6f 64 75  6c 65 5f 63 6c 61 69 6d  |..x.module_claim|
000000c0  3d 36 0d 00 82 12 6d 6f  64 75 6c 65 5f 66 72 65  |=6....module_fre|
000000d0  65 20 3d 37 0d 00 8c 04  0d 00 96 10 76 5f 66 6c  |e =7........v_fl|
000000e0  61 67 3d 31 3c 3c 32 38  0d 00 a0 04 0d 00 aa 09  |ag=1<<28........|
000000f0  70 77 3d 31 32 0d 00 b4  09 73 70 3d 31 33 0d 00  |pw=12....sp=13..|
00000100  be 0b 6c 69 6e 6b 3d 31  34 0d 00 c8 04 0d 00 d2  |..link=14.......|
00000110  11 50 25 3d 30 3a 4f 25  3d 63 6f 64 65 25 0d 00  |.P%=0:O%=code%..|
00000120  dc 04 0d 00 e6 0a 5b 4f  50 54 20 36 0d 00 f0 19  |......[OPT 6....|
00000130  2e 66 69 6c 65 5f 6e 75  6d 62 65 72 20 20 20 45  |.file_number   E|
00000140  51 55 44 20 30 0d 00 fa  19 2e 68 61 6e 64 6c 65  |QUD 0.....handle|
00000150  20 20 20 20 20 20 20 20  45 51 55 44 20 30 0d 01  |        EQUD 0..|
00000160  04 19 2e 66 69 6c 65 5f  77 61 74 63 68 20 20 20  |...file_watch   |
00000170  20 45 51 55 44 20 30 0d  01 0e 19 2e 63 6c 6f 73  | EQUD 0.....clos|
00000180  65 64 5f 68 61 6e 64 6c  65 20 45 51 55 44 20 30  |ed_handle EQUD 0|
00000190  0d 01 18 19 2e 6f 75 74  70 75 74 5f 68 61 6e 64  |.....output_hand|
000001a0  6c 65 20 45 51 55 44 20  30 0d 01 22 05 5d 0d 01  |le EQUD 0..".]..|
000001b0  2c 11 77 6b 73 70 63 5f  73 69 7a 65 3d 50 25 0d  |,.wkspc_size=P%.|
000001c0  01 36 04 0d 01 40 14 e3  20 70 61 73 73 3d 34 20  |.6...@.. pass=4 |
000001d0  b8 20 36 20 88 20 32 0d  01 4a 04 0d 01 54 11 50  |. 6 . 2..J...T.P|
000001e0  25 3d 30 3a 4f 25 3d 63  6f 64 65 25 0d 01 5e 04  |%=0:O%=code%..^.|
000001f0  0d 01 68 0d 5b 4f 50 54  20 70 61 73 73 0d 01 72  |..h.[OPT pass..r|
00000200  12 a4 6d 6f 64 75 6c 65  5f 68 65 61 64 65 72 0d  |..module_header.|
00000210  01 7c 39 2e 65 72 72 6f  72 5f 6e 65 6d 20 a4 65  |.|9.error_nem .e|
00000220  72 72 6f 72 28 22 4e 6f  74 20 65 6e 6f 75 67 68  |rror("Not enough|
00000230  20 6d 65 6d 6f 72 79 20  69 6e 20 6d 6f 64 75 6c  | memory in modul|
00000240  65 20 61 72 65 61 22 29  0d 01 86 26 2e 65 72 72  |e area")...&.err|
00000250  6f 72 5f 6d 69 75 20 a4  65 72 72 6f 72 28 22 4d  |or_miu .error("M|
00000260  6f 64 75 6c 65 20 69 6e  20 75 73 65 22 29 0d 01  |odule in use")..|
00000270  90 36 2e 65 72 72 6f 72  5f 70 66 61 20 a4 65 72  |.6.error_pfa .er|
00000280  72 6f 72 28 22 50 72 69  6e 74 46 69 6c 65 20 69  |ror("PrintFile i|
00000290  73 20 61 6c 72 65 61 64  79 20 70 72 69 6e 74 69  |s already printi|
000002a0  6e 67 22 29 0d 01 9a 09  41 4c 49 47 4e 0d 01 a4  |ng")....ALIGN...|
000002b0  04 0d 01 ae 09 2e 69 6e  69 74 0d 01 b8 18 53 54  |......init....ST|
000002c0  4d 46 44 20 20 20 28 73  70 29 21 2c 7b 6c 69 6e  |MFD   (sp)!,{lin|
000002d0  6b 7d 0d 01 c2 04 0d 01  cc 15 3b 20 43 6c 61 69  |k}........; Clai|
000002e0  6d 20 77 6f 72 6b 73 70  61 63 65 0d 01 d6 04 0d  |m workspace.....|
000002f0  01 e0 1c 4d 4f 56 20 20  20 20 20 52 30 2c 23 6d  |...MOV     R0,#m|
00000300  6f 64 75 6c 65 5f 63 6c  61 69 6d 0d 01 ea 1a 4d  |odule_claim....M|
00000310  4f 56 20 20 20 20 20 52  33 2c 23 77 6b 73 70 63  |OV     R3,#wkspc|
00000320  5f 73 69 7a 65 0d 01 f4  18 53 57 49 20 20 20 20  |_size....SWI    |
00000330  20 22 58 4f 53 5f 4d 6f  64 75 6c 65 22 0d 01 fe  | "XOS_Module"...|
00000340  18 41 44 52 56 53 20 20  20 52 30 2c 65 72 72 6f  |.ADRVS   R0,erro|
00000350  72 5f 6e 65 6d 0d 02 08  16 4c 44 4d 56 53 46 44  |r_nem....LDMVSFD|
00000360  20 28 73 70 29 21 2c 7b  50 43 7d 0d 02 12 13 53  | (sp)!,{PC}....S|
00000370  54 52 20 20 20 20 20 52  32 2c 5b 70 77 5d 0d 02  |TR     R2,[pw]..|
00000380  1c 11 4d 4f 56 20 20 20  20 20 70 77 2c 52 32 0d  |..MOV     pw,R2.|
00000390  02 26 04 0d 02 30 15 3b  20 69 6e 69 74 69 61 6c  |.&...0.; initial|
000003a0  69 73 65 20 76 61 72 73  0d 02 3a 04 0d 02 44 11  |ise vars..:...D.|
000003b0  4d 4f 56 20 20 20 20 20  52 31 2c 23 30 0d 02 4e  |MOV     R1,#0..N|
000003c0  20 53 54 52 20 20 20 20  20 52 31 2c 5b 70 77 2c  | STR     R1,[pw,|
000003d0  23 66 69 6c 65 5f 6e 75  6d 62 65 72 5d 0d 02 58  |#file_number]..X|
000003e0  1b 53 54 52 20 20 20 20  20 52 31 2c 5b 70 77 2c  |.STR     R1,[pw,|
000003f0  23 68 61 6e 64 6c 65 5d  0d 02 62 1f 53 54 52 20  |#handle]..b.STR |
00000400  20 20 20 20 52 31 2c 5b  70 77 2c 23 66 69 6c 65  |    R1,[pw,#file|
00000410  5f 77 61 74 63 68 5d 0d  02 6c 22 53 54 52 20 20  |_watch]..l"STR  |
00000420  20 20 20 52 31 2c 5b 70  77 2c 23 63 6c 6f 73 65  |   R1,[pw,#close|
00000430  64 5f 68 61 6e 64 6c 65  5d 0d 02 76 04 0d 02 80  |d_handle]..v....|
00000440  2d 3b 20 43 6c 61 69 6d  20 55 70 43 61 6c 6c 20  |-; Claim UpCall |
00000450  76 65 63 74 6f 72 20 28  52 32 20 69 73 20 61 6c  |vector (R2 is al|
00000460  72 65 61 64 79 20 73 65  74 29 0d 02 8a 04 0d 02  |ready set)......|
00000470  94 1f 41 44 52 20 20 20  20 20 52 31 2c 75 70 63  |..ADR     R1,upc|
00000480  61 6c 6c 5f 69 6e 74 65  72 63 65 70 74 0d 02 9e  |all_intercept...|
00000490  17 4d 4f 56 20 20 20 20  20 52 30 2c 23 55 70 63  |.MOV     R0,#Upc|
000004a0  61 6c 6c 56 0d 02 a8 17  53 57 49 20 20 20 20 20  |allV....SWI     |
000004b0  22 58 4f 53 5f 43 6c 61  69 6d 22 0d 02 b2 04 0d  |"XOS_Claim".....|
000004c0  02 bc 17 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |...LDMFD   (sp)!|
000004d0  2c 7b 50 43 7d 5e 0d 02  c6 04 0d 02 d0 0d 2e 66  |,{PC}^.........f|
000004e0  69 6e 61 6c 69 73 65 0d  02 da 13 4c 44 52 20 20  |inalise....LDR  |
000004f0  20 20 20 70 77 2c 5b 70  77 5d 0d 02 e4 18 53 54  |   pw,[pw]....ST|
00000500  4d 46 44 20 20 20 28 73  70 29 21 2c 7b 6c 69 6e  |MFD   (sp)!,{lin|
00000510  6b 7d 0d 02 ee 16 42 4c  20 20 20 20 20 20 66 72  |k}....BL      fr|
00000520  65 65 5f 77 61 74 63 68  0d 02 f8 1b 4c 44 52 20  |ee_watch....LDR |
00000530  20 20 20 20 52 30 2c 5b  70 77 2c 23 68 61 6e 64  |    R0,[pw,#hand|
00000540  6c 65 5d 0d 03 02 11 54  45 51 20 20 20 20 20 52  |le]....TEQ     R|
00000550  30 2c 23 30 0d 03 0c 18  41 44 52 4e 45 20 20 20  |0,#0....ADRNE   |
00000560  52 30 2c 65 72 72 6f 72  5f 6d 69 75 0d 03 16 18  |R0,error_miu....|
00000570  4c 44 4d 4e 45 46 44 20  28 73 70 29 21 2c 7b 6c  |LDMNEFD (sp)!,{l|
00000580  69 6e 6b 7d 0d 03 20 1a  84 52 4e 45 53 20 20 50  |ink}.. ..RNES  P|
00000590  43 2c 6c 69 6e 6b 2c 23  76 5f 66 6c 61 67 0d 03  |C,link,#v_flag..|
000005a0  2a 11 4d 4f 56 20 20 20  20 20 52 32 2c 70 77 0d  |*.MOV     R2,pw.|
000005b0  03 34 1f 41 44 52 20 20  20 20 20 52 31 2c 75 70  |.4.ADR     R1,up|
000005c0  63 61 6c 6c 5f 69 6e 74  65 72 63 65 70 74 0d 03  |call_intercept..|
000005d0  3e 17 4d 4f 56 20 20 20  20 20 52 30 2c 23 55 70  |>.MOV     R0,#Up|
000005e0  63 61 6c 6c 56 0d 03 48  19 53 57 49 20 20 20 20  |callV..H.SWI    |
000005f0  20 22 58 4f 53 5f 52 65  6c 65 61 73 65 22 0d 03  | "XOS_Release"..|
00000600  52 04 0d 03 5c 14 3b 20  46 72 65 65 20 77 6f 72  |R...\.; Free wor|
00000610  6b 73 70 61 63 65 0d 03  66 04 0d 03 70 1b 4d 4f  |kspace..f...p.MO|
00000620  56 20 20 20 20 20 52 30  2c 23 6d 6f 64 75 6c 65  |V     R0,#module|
00000630  5f 66 72 65 65 0d 03 7a  18 53 57 49 20 20 20 20  |_free..z.SWI    |
00000640  20 22 58 4f 53 5f 4d 6f  64 75 6c 65 22 0d 03 84  | "XOS_Module"...|
00000650  17 4c 44 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  |.LDMFD   (sp)!,{|
00000660  50 43 7d 5e 0d 03 8e 04  0d 03 98 1a 2e 70 72 69  |PC}^.........pri|
00000670  6e 74 5f 73 6f 6d 65 5f  77 68 65 6e 5f 72 65 61  |nt_some_when_rea|
00000680  64 79 0d 03 a2 1e 53 54  4d 46 44 20 20 20 28 73  |dy....STMFD   (s|
00000690  70 29 21 2c 7b 52 30 2d  52 31 2c 6c 69 6e 6b 7d  |p)!,{R0-R1,link}|
000006a0  0d 03 ac 19 41 44 52 20  20 20 20 20 52 30 2c 70  |....ADR     R0,p|
000006b0  72 69 6e 74 5f 73 6f 6d  65 0d 03 b6 11 4d 4f 56  |rint_some....MOV|
000006c0  20 20 20 20 20 52 31 2c  70 77 0d 03 c0 1d 53 57  |     R1,pw....SW|
000006d0  49 20 20 20 20 20 22 58  4f 53 5f 41 64 64 43 61  |I     "XOS_AddCa|
000006e0  6c 6c 42 61 63 6b 22 0d  03 ca 1d 4c 44 4d 46 44  |llBack"....LDMFD|
000006f0  20 20 20 28 73 70 29 21  2c 7b 52 30 2d 52 31 2c  |   (sp)!,{R0-R1,|
00000700  50 43 7d 5e 0d 03 d4 04  0d 03 de 0f 2e 70 72 69  |PC}^.........pri|
00000710  6e 74 5f 73 6f 6d 65 0d  03 e8 1e 53 54 4d 46 44  |nt_some....STMFD|
00000720  20 20 20 28 73 70 29 21  2c 7b 52 30 2d 52 36 2c  |   (sp)!,{R0-R6,|
00000730  6c 69 6e 6b 7d 0d 03 f2  23 3b 20 65 78 61 6d 69  |link}...#; exami|
00000740  6e 65 20 62 75 66 66 65  72 2c 20 52 34 3d 66 72  |ne buffer, R4=fr|
00000750  65 65 20 73 70 61 63 65  0d 03 fc 13 4d 4f 56 20  |ee space....MOV |
00000760  20 20 20 20 52 30 2c 23  31 32 38 0d 04 06 13 4d  |    R0,#128....M|
00000770  4f 56 20 20 20 20 20 52  31 2c 23 32 35 32 0d 04  |OV     R1,#252..|
00000780  10 16 53 57 49 20 20 20  20 20 22 58 4f 53 5f 42  |..SWI     "XOS_B|
00000790  79 74 65 22 0d 04 1a 1b  41 44 44 53 20 20 20 20  |yte"....ADDS    |
000007a0  52 35 2c 52 31 2c 52 32  2c 4c 53 4c 20 23 38 0d  |R5,R1,R2,LSL #8.|
000007b0  04 24 28 42 45 51 20 20  20 20 20 73 65 74 5f 63  |.$(BEQ     set_c|
000007c0  61 6c 6c 62 61 63 6b 20  20 20 20 20 20 20 3b 20  |allback       ; |
000007d0  69 73 20 66 75 6c 6c 0d  04 2e 04 0d 04 38 11 4d  |is full......8.M|
000007e0  4f 56 20 20 20 20 20 52  33 2c 52 35 0d 04 42 1c  |OV     R3,R5..B.|
000007f0  4d 4f 56 20 20 20 20 20  52 30 2c 23 6d 6f 64 75  |MOV     R0,#modu|
00000800  6c 65 5f 63 6c 61 69 6d  0d 04 4c 18 53 57 49 20  |le_claim..L.SWI |
00000810  20 20 20 20 22 58 4f 53  5f 4d 6f 64 75 6c 65 22  |    "XOS_Module"|
00000820  0d 04 56 11 4d 4f 56 20  20 20 20 20 52 36 2c 52  |..V.MOV     R6,R|
00000830  32 0d 04 60 04 0d 04 6a  11 4d 4f 56 20 20 20 20  |2..`...j.MOV    |
00000840  20 52 30 2c 23 34 0d 04  74 1b 4c 44 52 20 20 20  | R0,#4..t.LDR   |
00000850  20 20 52 31 2c 5b 70 77  2c 23 68 61 6e 64 6c 65  |  R1,[pw,#handle|
00000860  5d 0d 04 7e 11 4d 4f 56  20 20 20 20 20 52 33 2c  |]..~.MOV     R3,|
00000870  52 35 0d 04 88 04 0d 04  92 16 53 57 49 20 20 20  |R5........SWI   |
00000880  20 20 22 58 4f 53 5f 47  42 50 42 22 0d 04 9c 04  |  "XOS_GBPB"....|
00000890  0d 04 a6 14 53 55 42 53  20 20 20 20 52 33 2c 52  |....SUBS    R3,R|
000008a0  35 2c 52 33 0d 04 b0 15  42 4c 45 51 20 20 20 20  |5,R3....BLEQ    |
000008b0  66 72 65 65 5f 74 65 6d  70 0d 04 ba 17 42 45 51  |free_temp....BEQ|
000008c0  20 20 20 20 20 65 6f 66  5f 72 65 61 63 68 65 64  |     eof_reached|
000008d0  0d 04 c4 04 0d 04 ce 11  4d 4f 56 20 20 20 20 20  |........MOV     |
000008e0  52 30 2c 23 32 0d 04 d8  22 4c 44 52 20 20 20 20  |R0,#2..."LDR    |
000008f0  20 52 31 2c 5b 70 77 2c  23 6f 75 74 70 75 74 5f  | R1,[pw,#output_|
00000900  68 61 6e 64 6c 65 5d 0d  04 e2 11 4d 4f 56 20 20  |handle]....MOV  |
00000910  20 20 20 52 32 2c 52 36  0d 04 ec 15 53 57 49 20  |   R2,R6....SWI |
00000920  20 20 20 20 22 4f 53 5f  47 42 50 42 22 0d 04 f6  |    "OS_GBPB"...|
00000930  04 0d 05 00 15 42 4c 20  20 20 20 20 20 66 72 65  |.....BL      fre|
00000940  65 5f 74 65 6d 70 0d 05  0a 04 0d 05 14 11 2e 73  |e_temp.........s|
00000950  65 74 5f 63 61 6c 6c 62  61 63 6b 0d 05 1e 12 4d  |et_callback....M|
00000960  4f 56 20 20 20 20 20 52  30 2c 23 31 30 0d 05 28  |OV     R0,#10..(|
00000970  24 41 44 52 20 20 20 20  20 52 31 2c 70 72 69 6e  |$ADR     R1,prin|
00000980  74 5f 73 6f 6d 65 5f 77  68 65 6e 5f 72 65 61 64  |t_some_when_read|
00000990  79 0d 05 32 11 4d 4f 56  20 20 20 20 20 52 32 2c  |y..2.MOV     R2,|
000009a0  70 77 0d 05 3c 1b 53 57  49 20 20 20 20 20 22 58  |pw..<.SWI     "X|
000009b0  4f 53 5f 43 61 6c 6c 41  66 74 65 72 22 0d 05 46  |OS_CallAfter"..F|
000009c0  1d 4c 44 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  |.LDMFD   (sp)!,{|
000009d0  52 30 2d 52 36 2c 50 43  7d 5e 0d 05 50 04 0d 05  |R0-R6,PC}^..P...|
000009e0  5a 0e 2e 66 72 65 65 5f  74 65 6d 70 0d 05 64 18  |Z..free_temp..d.|
000009f0  53 54 4d 46 44 20 20 20  28 73 70 29 21 2c 7b 6c  |STMFD   (sp)!,{l|
00000a00  69 6e 6b 7d 0d 05 6e 11  4d 4f 56 20 20 20 20 20  |ink}..n.MOV     |
00000a10  52 32 2c 52 36 0d 05 78  1b 4d 4f 56 20 20 20 20  |R2,R6..x.MOV    |
00000a20  20 52 30 2c 23 6d 6f 64  75 6c 65 5f 66 72 65 65  | R0,#module_free|
00000a30  0d 05 82 18 53 57 49 20  20 20 20 20 22 58 4f 53  |....SWI     "XOS|
00000a40  5f 4d 6f 64 75 6c 65 22  0d 05 8c 17 4c 44 4d 46  |_Module"....LDMF|
00000a50  44 20 20 20 28 73 70 29  21 2c 7b 50 43 7d 5e 0d  |D   (sp)!,{PC}^.|
00000a60  05 96 04 0d 05 a0 21 2e  65 72 72 6f 72 5f 70 66  |......!.error_pf|
00000a70  61 5f 69 6e 64 20 45 51  55 44 20 65 72 72 6f 72  |a_ind EQUD error|
00000a80  5f 70 66 61 0d 05 aa 04  0d 05 b4 0e 2e 70 72 69  |_pfa.........pri|
00000a90  6e 74 66 69 6c 65 0d 05  be 13 4c 44 52 20 20 20  |ntfile....LDR   |
00000aa0  20 20 70 77 2c 5b 70 77  5d 0d 05 c8 1e 53 54 4d  |  pw,[pw]....STM|
00000ab0  46 44 20 20 20 28 73 70  29 21 2c 7b 52 30 2d 52  |FD   (sp)!,{R0-R|
00000ac0  36 2c 6c 69 6e 6b 7d 0d  05 d2 11 4d 4f 56 20 20  |6,link}....MOV  |
00000ad0  20 20 20 52 31 2c 52 30  0d 05 dc 1d 4c 44 52 20  |   R1,R0....LDR |
00000ae0  20 20 20 20 6c 69 6e 6b  2c 5b 70 77 2c 23 68 61  |    link,[pw,#ha|
00000af0  6e 64 6c 65 5d 0d 05 e6  13 54 45 51 20 20 20 20  |ndle]....TEQ    |
00000b00  20 6c 69 6e 6b 2c 23 30  0d 05 f0 1c 4c 44 52 4e  | link,#0....LDRN|
00000b10  45 20 20 20 52 30 2c 65  72 72 6f 72 5f 70 66 61  |E   R0,error_pfa|
00000b20  5f 69 6e 64 0d 05 fa 1e  53 57 49 4e 45 20 20 20  |_ind....SWINE   |
00000b30  22 4f 53 5f 47 65 6e 65  72 61 74 65 45 72 72 6f  |"OS_GenerateErro|
00000b40  72 22 0d 06 04 0f 2e 70  72 69 6e 74 66 69 6c 65  |r".....printfile|
00000b50  32 0d 06 0e 1d 4c 44 52  20 20 20 20 20 6c 69 6e  |2....LDR     lin|
00000b60  6b 2c 5b 70 77 2c 23 68  61 6e 64 6c 65 5d 0d 06  |k,[pw,#handle]..|
00000b70  18 13 54 45 51 20 20 20  20 20 6c 69 6e 6b 2c 23  |..TEQ     link,#|
00000b80  30 0d 06 22 1d 4c 44 4d  4e 45 46 44 20 28 73 70  |0..".LDMNEFD (sp|
00000b90  29 21 2c 7b 52 30 2d 52  36 2c 50 43 7d 5e 0d 06  |)!,{R0-R6,PC}^..|
00000ba0  2c 04 0d 06 36 13 4d 4f  56 20 20 20 20 20 52 30  |,...6.MOV     R0|
00000bb0  2c 23 26 34 43 0d 06 40  16 53 57 49 20 20 20 20  |,#&4C..@.SWI    |
00000bc0  20 22 58 4f 53 5f 46 69  6e 64 22 0d 06 4a 14 41  | "XOS_Find"..J.A|
00000bd0  44 44 56 53 20 20 20 73  70 2c 73 70 2c 23 34 0d  |DDVS   sp,sp,#4.|
00000be0  06 54 1c 4c 44 4d 56 53  46 44 20 28 73 70 29 21  |.T.LDMVSFD (sp)!|
00000bf0  2c 7b 52 31 2d 52 34 2c  50 43 7d 0d 06 5e 1b 53  |,{R1-R4,PC}..^.S|
00000c00  54 52 20 20 20 20 20 52  30 2c 5b 70 77 2c 23 68  |TR     R0,[pw,#h|
00000c10  61 6e 64 6c 65 5d 0d 06  68 04 0d 06 72 13 4d 4f  |andle]..h...r.MO|
00000c20  56 20 20 20 20 20 52 30  2c 23 26 38 30 0d 06 7c  |V     R0,#&80..||
00000c30  1c 41 44 52 20 20 20 20  20 52 31 2c 6f 75 74 70  |.ADR     R1,outp|
00000c40  75 74 5f 73 74 72 65 61  6d 0d 06 86 16 53 57 49  |ut_stream....SWI|
00000c50  20 20 20 20 20 22 58 4f  53 5f 46 69 6e 64 22 0d  |     "XOS_Find".|
00000c60  06 90 14 41 44 44 56 53  20 20 20 73 70 2c 73 70  |...ADDVS   sp,sp|
00000c70  2c 23 34 0d 06 9a 1c 4c  44 4d 56 53 46 44 20 28  |,#4....LDMVSFD (|
00000c80  73 70 29 21 2c 7b 52 31  2d 52 34 2c 50 43 7d 0d  |sp)!,{R1-R4,PC}.|
00000c90  06 a4 22 53 54 52 20 20  20 20 20 52 30 2c 5b 70  |.."STR     R0,[p|
00000ca0  77 2c 23 6f 75 74 70 75  74 5f 68 61 6e 64 6c 65  |w,#output_handle|
00000cb0  5d 0d 06 ae 04 0d 06 b8  18 42 20 20 20 20 20 20  |]........B      |
00000cc0  20 73 65 74 5f 63 61 6c  6c 62 61 63 6b 0d 06 c2  | set_callback...|
00000cd0  04 0d 06 cc 10 2e 65 6f  66 5f 72 65 61 63 68 65  |......eof_reache|
00000ce0  64 0d 06 d6 11 4d 4f 56  20 20 20 20 20 52 30 2c  |d....MOV     R0,|
00000cf0  23 30 0d 06 e0 1b 53 54  52 20 20 20 20 20 52 30  |#0....STR     R0|
00000d00  2c 5b 70 77 2c 23 68 61  6e 64 6c 65 5d 0d 06 ea  |,[pw,#handle]...|
00000d10  16 53 57 49 20 20 20 20  20 22 58 4f 53 5f 46 69  |.SWI     "XOS_Fi|
00000d20  6e 64 22 0d 06 f4 04 0d  06 fe 11 4d 4f 56 20 20  |nd"........MOV  |
00000d30  20 20 20 52 30 2c 23 30  0d 07 08 22 4c 44 52 20  |   R0,#0..."LDR |
00000d40  20 20 20 20 52 31 2c 5b  70 77 2c 23 6f 75 74 70  |    R1,[pw,#outp|
00000d50  75 74 5f 68 61 6e 64 6c  65 5d 0d 07 12 16 53 57  |ut_handle]....SW|
00000d60  49 20 20 20 20 20 22 58  4f 53 5f 46 69 6e 64 22  |I     "XOS_Find"|
00000d70  0d 07 1c 04 0d 07 26 1d  4c 44 4d 46 44 20 20 20  |......&.LDMFD   |
00000d80  28 73 70 29 21 2c 7b 52  30 2d 52 36 2c 50 43 7d  |(sp)!,{R0-R6,PC}|
00000d90  5e 0d 07 30 04 0d 07 3a  11 2e 72 65 70 6f 72 74  |^..0...:..report|
00000da0  5f 77 61 74 63 68 0d 07  44 1f 4c 44 52 20 20 20  |_watch..D.LDR   |
00000db0  20 20 52 30 2c 5b 70 77  2c 23 66 69 6c 65 5f 77  |  R0,[pw,#file_w|
00000dc0  61 74 63 68 5d 0d 07 4e  11 54 45 51 20 20 20 20  |atch]..N.TEQ    |
00000dd0  20 52 30 2c 23 30 0d 07  58 14 42 45 51 20 20 20  | R0,#0..X.BEQ   |
00000de0  20 20 6e 6f 5f 77 61 74  63 68 0d 07 62 18 53 57  |  no_watch..b.SW|
00000df0  49 20 20 20 20 20 22 58  4f 53 5f 57 72 69 74 65  |I     "XOS_Write|
00000e00  53 22 0d 07 6c 30 45 51  55 53 20 20 20 20 22 54  |S"..l0EQUS    "T|
00000e10  68 65 20 63 75 72 72 65  6e 74 20 50 72 69 6e 74  |he current Print|
00000e20  57 61 74 63 68 20 66 69  6c 65 20 69 73 20 3a 20  |Watch file is : |
00000e30  27 22 0d 07 76 0a 45 51  55 42 20 30 0d 07 80 09  |'"..v.EQUB 0....|
00000e40  41 4c 49 47 4e 0d 07 8a  18 53 57 49 20 20 20 20  |ALIGN....SWI    |
00000e50  20 22 58 4f 53 5f 57 72  69 74 65 30 22 0d 07 94  | "XOS_Write0"...|
00000e60  17 53 57 49 20 20 20 20  20 26 31 30 30 2b 97 28  |.SWI     &100+.(|
00000e70  22 27 22 29 0d 07 9e 19  53 57 49 20 20 20 20 20  |"'")....SWI     |
00000e80  22 58 4f 53 5f 4e 65 77  4c 69 6e 65 22 0d 07 a8  |"XOS_NewLine"...|
00000e90  17 4c 44 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  |.LDMFD   (sp)!,{|
00000ea0  50 43 7d 5e 0d 07 b2 04  0d 07 bc 0d 2e 6e 6f 5f  |PC}^.........no_|
00000eb0  77 61 74 63 68 0d 07 c6  18 53 57 49 20 20 20 20  |watch....SWI    |
00000ec0  20 22 58 4f 53 5f 57 72  69 74 65 53 22 0d 07 d0  | "XOS_WriteS"...|
00000ed0  29 45 51 55 53 20 20 20  20 22 54 68 65 72 65 20  |)EQUS    "There |
00000ee0  69 73 20 6e 6f 20 50 72  69 6e 74 57 61 74 63 68  |is no PrintWatch|
00000ef0  20 66 69 6c 65 22 0d 07  da 0a 45 51 55 42 20 30  | file"....EQUB 0|
00000f00  0d 07 e4 09 41 4c 49 47  4e 0d 07 ee 19 53 57 49  |....ALIGN....SWI|
00000f10  20 20 20 20 20 22 58 4f  53 5f 4e 65 77 4c 69 6e  |     "XOS_NewLin|
00000f20  65 22 0d 07 f8 17 4c 44  4d 46 44 20 20 20 28 73  |e"....LDMFD   (s|
00000f30  70 29 21 2c 7b 50 43 7d  5e 0d 08 02 04 0d 08 0c  |p)!,{PC}^.......|
00000f40  0f 2e 70 72 69 6e 74 77  61 74 63 68 0d 08 16 13  |..printwatch....|
00000f50  4c 44 52 20 20 20 20 20  70 77 2c 5b 70 77 5d 0d  |LDR     pw,[pw].|
00000f60  08 20 18 53 54 4d 46 44  20 20 20 28 73 70 29 21  |. .STMFD   (sp)!|
00000f70  2c 7b 6c 69 6e 6b 7d 0d  08 2a 11 54 45 51 20 20  |,{link}..*.TEQ  |
00000f80  20 20 20 52 31 2c 23 30  0d 08 34 18 42 45 51 20  |   R1,#0..4.BEQ |
00000f90  20 20 20 20 72 65 70 6f  72 74 5f 77 61 74 63 68  |    report_watch|
00000fa0  0d 08 3e 11 4d 4f 56 20  20 20 20 20 52 36 2c 52  |..>.MOV     R6,R|
00000fb0  30 0d 08 48 16 42 4c 20  20 20 20 20 20 66 72 65  |0..H.BL      fre|
00000fc0  65 5f 77 61 74 63 68 0d  08 52 12 4d 4f 56 20 20  |e_watch..R.MOV  |
00000fd0  20 20 20 52 30 2c 23 33  37 0d 08 5c 11 4d 4f 56  |   R0,#37..\.MOV|
00000fe0  20 20 20 20 20 52 31 2c  52 36 0d 08 66 11 4d 4f  |     R1,R6..f.MO|
00000ff0  56 20 20 20 20 20 52 32  2c 23 30 0d 08 70 11 4d  |V     R2,#0..p.M|
00001000  4f 56 20 20 20 20 20 52  33 2c 23 30 0d 08 7a 11  |OV     R3,#0..z.|
00001010  4d 4f 56 20 20 20 20 20  52 34 2c 23 30 0d 08 84  |MOV     R4,#0...|
00001020  11 4d 4f 56 20 20 20 20  20 52 35 2c 23 30 0d 08  |.MOV     R5,#0..|
00001030  8e 1b 53 57 49 20 20 20  20 20 22 58 4f 53 5f 46  |..SWI     "XOS_F|
00001040  53 43 6f 6e 74 72 6f 6c  22 0d 08 98 16 4c 44 4d  |SControl"....LDM|
00001050  56 53 46 44 20 28 73 70  29 21 2c 7b 50 43 7d 0d  |VSFD (sp)!,{PC}.|
00001060  08 a2 1c 4d 4f 56 20 20  20 20 20 52 30 2c 23 6d  |...MOV     R0,#m|
00001070  6f 64 75 6c 65 5f 63 6c  61 69 6d 0d 08 ac 14 52  |odule_claim....R|
00001080  53 42 20 20 20 20 20 52  33 2c 52 35 2c 23 31 0d  |SB     R3,R5,#1.|
00001090  08 b6 18 53 57 49 20 20  20 20 20 22 58 4f 53 5f  |...SWI     "XOS_|
000010a0  4d 6f 64 75 6c 65 22 0d  08 c0 16 4c 44 4d 56 53  |Module"....LDMVS|
000010b0  46 44 20 28 73 70 29 21  2c 7b 50 43 7d 0d 08 ca  |FD (sp)!,{PC}...|
000010c0  1f 53 54 52 20 20 20 20  20 52 32 2c 5b 70 77 2c  |.STR     R2,[pw,|
000010d0  23 66 69 6c 65 5f 77 61  74 63 68 5d 0d 08 d4 11  |#file_watch]....|
000010e0  4d 4f 56 20 20 20 20 20  52 35 2c 52 33 0d 08 de  |MOV     R5,R3...|
000010f0  12 4d 4f 56 20 20 20 20  20 52 30 2c 23 33 37 0d  |.MOV     R0,#37.|
00001100  08 e8 11 4d 4f 56 20 20  20 20 20 52 31 2c 52 36  |...MOV     R1,R6|
00001110  0d 08 f2 11 4d 4f 56 20  20 20 20 20 52 33 2c 23  |....MOV     R3,#|
00001120  30 0d 08 fc 11 4d 4f 56  20 20 20 20 20 52 34 2c  |0....MOV     R4,|
00001130  23 30 0d 09 06 1b 53 57  49 20 20 20 20 20 22 58  |#0....SWI     "X|
00001140  4f 53 5f 46 53 43 6f 6e  74 72 6f 6c 22 0d 09 10  |OS_FSControl"...|
00001150  17 4c 44 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  |.LDMFD   (sp)!,{|
00001160  50 43 7d 5e 0d 09 1a 04  0d 09 24 0f 2e 66 72 65  |PC}^......$..fre|
00001170  65 5f 77 61 74 63 68 0d  09 2e 18 53 54 4d 46 44  |e_watch....STMFD|
00001180  20 20 20 28 73 70 29 21  2c 7b 6c 69 6e 6b 7d 0d  |   (sp)!,{link}.|
00001190  09 38 1b 4d 4f 56 20 20  20 20 20 52 30 2c 23 6d  |.8.MOV     R0,#m|
000011a0  6f 64 75 6c 65 5f 66 72  65 65 0d 09 42 1f 4c 44  |odule_free..B.LD|
000011b0  52 20 20 20 20 20 52 32  2c 5b 70 77 2c 23 66 69  |R     R2,[pw,#fi|
000011c0  6c 65 5f 77 61 74 63 68  5d 0d 09 4c 11 54 45 51  |le_watch]..L.TEQ|
000011d0  20 20 20 20 20 52 32 2c  23 30 0d 09 56 18 53 57  |     R2,#0..V.SW|
000011e0  49 4e 45 20 20 20 22 58  4f 53 5f 4d 6f 64 75 6c  |INE   "XOS_Modul|
000011f0  65 22 0d 09 60 17 4c 44  4d 46 44 20 20 20 28 73  |e"..`.LDMFD   (s|
00001200  70 29 21 2c 7b 50 43 7d  5e 0d 09 6a 04 0d 09 74  |p)!,{PC}^..j...t|
00001210  15 2e 75 70 63 61 6c 6c  5f 69 6e 74 65 72 63 65  |..upcall_interce|
00001220  70 74 0d 09 7e 11 54 45  51 20 20 20 20 20 52 30  |pt..~.TEQ     R0|
00001230  2c 23 33 0d 09 88 13 4d  4f 56 4e 45 53 20 20 50  |,#3....MOVNES  P|
00001240  43 2c 6c 69 6e 6b 0d 09  92 16 53 55 42 20 20 20  |C,link....SUB   |
00001250  20 20 52 39 2c 52 39 2c  23 32 35 36 0d 09 9c 11  |  R9,R9,#256....|
00001260  54 45 51 20 20 20 20 20  52 39 2c 23 31 0d 09 a6  |TEQ     R9,#1...|
00001270  11 54 45 51 4e 45 20 20  20 52 39 2c 23 32 0d 09  |.TEQNE   R9,#2..|
00001280  b0 1c 42 45 51 20 20 20  20 20 6f 70 65 6e 65 64  |..BEQ     opened|
00001290  5f 66 6f 72 5f 77 72 69  74 65 0d 09 ba 11 54 45  |_for_write....TE|
000012a0  51 20 20 20 20 20 52 39  2c 23 33 0d 09 c4 16 41  |Q     R9,#3....A|
000012b0  44 44 20 20 20 20 20 52  39 2c 52 39 2c 23 32 35  |DD     R9,R9,#25|
000012c0  36 0d 09 ce 13 4d 4f 56  4e 45 53 20 20 50 43 2c  |6....MOVNES  PC,|
000012d0  6c 69 6e 6b 0d 09 d8 1e  53 54 4d 46 44 20 20 20  |link....STMFD   |
000012e0  28 73 70 29 21 2c 7b 52  30 2d 52 31 2c 6c 69 6e  |(sp)!,{R0-R1,lin|
000012f0  6b 7d 0d 09 e2 04 0d 09  ec 21 4c 44 52 20 20 20  |k}.......!LDR   |
00001300  20 20 6c 69 6e 6b 2c 5b  70 77 2c 23 66 69 6c 65  |  link,[pw,#file|
00001310  5f 77 61 74 63 68 5d 0d  09 f6 13 54 45 51 20 20  |_watch]....TEQ  |
00001320  20 20 20 6c 69 6e 6b 2c  23 30 0d 0a 00 1d 4c 44  |   link,#0....LD|
00001330  4d 45 51 46 44 20 28 73  70 29 21 2c 7b 52 30 2d  |MEQFD (sp)!,{R0-|
00001340  52 31 2c 50 43 7d 5e 0d  0a 0a 04 0d 0a 14 24 4c  |R1,PC}^.......$L|
00001350  44 52 20 20 20 20 20 6c  69 6e 6b 2c 5b 70 77 2c  |DR     link,[pw,|
00001360  23 63 6c 6f 73 65 64 5f  68 61 6e 64 6c 65 5d 0d  |#closed_handle].|
00001370  0a 1e 13 54 45 51 20 20  20 20 20 6c 69 6e 6b 2c  |...TEQ     link,|
00001380  52 31 0d 0a 28 04 0d 0a  32 1a 41 44 52 45 51 20  |R1..(...2.ADREQ |
00001390  20 20 52 30 2c 66 69 6c  65 5f 63 6c 6f 73 65 64  |  R0,file_closed|
000013a0  0d 0a 3c 0e ec 51 20 20  20 52 31 2c 70 77 0d 0a  |..<..Q   R1,pw..|
000013b0  46 1d 53 57 49 45 51 20  20 20 22 58 4f 53 5f 41  |F.SWIEQ   "XOS_A|
000013c0  64 64 43 61 6c 6c 42 61  63 6b 22 0d 0a 50 1d 4c  |ddCallBack"..P.L|
000013d0  44 4d 46 44 20 20 20 28  73 70 29 21 2c 7b 52 30  |DMFD   (sp)!,{R0|
000013e0  2d 52 31 2c 50 43 7d 5e  0d 0a 5a 04 0d 0a 64 10  |-R1,PC}^..Z...d.|
000013f0  2e 66 69 6c 65 5f 63 6c  6f 73 65 64 0d 0a 6e 1e  |.file_closed..n.|
00001400  53 54 4d 46 44 20 20 20  28 73 70 29 21 2c 7b 52  |STMFD   (sp)!,{R|
00001410  30 2d 52 36 2c 6c 69 6e  6b 7d 0d 0a 78 13 4d 4f  |0-R6,link}..x.MO|
00001420  56 20 20 20 20 20 6c 69  6e 6b 2c 23 30 0d 0a 82  |V     link,#0...|
00001430  24 53 54 52 20 20 20 20  20 6c 69 6e 6b 2c 5b 70  |$STR     link,[p|
00001440  77 2c 23 63 6c 6f 73 65  64 5f 68 61 6e 64 6c 65  |w,#closed_handle|
00001450  5d 0d 0a 8c 1f 4c 44 52  20 20 20 20 20 52 31 2c  |]....LDR     R1,|
00001460  5b 70 77 2c 23 66 69 6c  65 5f 77 61 74 63 68 5d  |[pw,#file_watch]|
00001470  0d 0a 96 16 42 20 20 20  20 20 20 20 70 72 69 6e  |....B       prin|
00001480  74 66 69 6c 65 32 0d 0a  a0 04 0d 0a aa 15 2e 6f  |tfile2.........o|
00001490  70 65 6e 65 64 5f 66 6f  72 5f 77 72 69 74 65 0d  |pened_for_write.|
000014a0  0a b4 16 41 44 44 20 20  20 20 20 52 39 2c 52 39  |...ADD     R9,R9|
000014b0  2c 23 32 35 36 0d 0a be  1e 53 54 4d 46 44 20 20  |,#256....STMFD  |
000014c0  20 28 73 70 29 21 2c 7b  52 30 2d 52 38 2c 6c 69  | (sp)!,{R0-R8,li|
000014d0  6e 6b 7d 0d 0a c8 11 4d  4f 56 20 20 20 20 20 52  |nk}....MOV     R|
000014e0  38 2c 52 32 0d 0a d2 11  4d 4f 56 20 20 20 20 20  |8,R2....MOV     |
000014f0  52 37 2c 52 31 0d 0a dc  12 4d 4f 56 20 20 20 20  |R7,R1....MOV    |
00001500  20 52 30 2c 23 33 37 0d  0a e6 11 4d 4f 56 20 20  | R0,#37....MOV  |
00001510  20 20 20 52 31 2c 52 37  0d 0a f0 11 4d 4f 56 20  |   R1,R7....MOV |
00001520  20 20 20 20 52 32 2c 23  30 0d 0a fa 11 4d 4f 56  |    R2,#0....MOV|
00001530  20 20 20 20 20 52 33 2c  23 30 0d 0b 04 11 4d 4f  |     R3,#0....MO|
00001540  56 20 20 20 20 20 52 34  2c 23 30 0d 0b 0e 11 4d  |V     R4,#0....M|
00001550  4f 56 20 20 20 20 20 52  35 2c 23 30 0d 0b 18 1b  |OV     R5,#0....|
00001560  53 57 49 20 20 20 20 20  22 58 4f 53 5f 46 53 43  |SWI     "XOS_FSC|
00001570  6f 6e 74 72 6f 6c 22 0d  0b 22 1c 4c 44 4d 56 53  |ontrol"..".LDMVS|
00001580  46 44 20 28 73 70 29 21  2c 7b 52 30 2d 52 38 2c  |FD (sp)!,{R0-R8,|
00001590  50 43 7d 0d 0b 2c 1c 4d  4f 56 20 20 20 20 20 52  |PC}..,.MOV     R|
000015a0  30 2c 23 6d 6f 64 75 6c  65 5f 63 6c 61 69 6d 0d  |0,#module_claim.|
000015b0  0b 36 14 52 53 42 20 20  20 20 20 52 33 2c 52 35  |.6.RSB     R3,R5|
000015c0  2c 23 31 0d 0b 40 18 53  57 49 20 20 20 20 20 22  |,#1..@.SWI     "|
000015d0  58 4f 53 5f 4d 6f 64 75  6c 65 22 0d 0b 4a 11 4d  |XOS_Module"..J.M|
000015e0  4f 56 20 20 20 20 20 52  36 2c 52 32 0d 0b 54 1c  |OV     R6,R2..T.|
000015f0  4c 44 4d 56 53 46 44 20  28 73 70 29 21 2c 7b 52  |LDMVSFD (sp)!,{R|
00001600  30 2d 52 38 2c 50 43 7d  0d 0b 5e 11 4d 4f 56 20  |0-R8,PC}..^.MOV |
00001610  20 20 20 20 52 35 2c 52  33 0d 0b 68 12 4d 4f 56  |    R5,R3..h.MOV|
00001620  20 20 20 20 20 52 30 2c  23 33 37 0d 0b 72 11 4d  |     R0,#37..r.M|
00001630  4f 56 20 20 20 20 20 52  31 2c 52 37 0d 0b 7c 11  |OV     R1,R7..|.|
00001640  4d 4f 56 20 20 20 20 20  52 33 2c 23 30 0d 0b 86  |MOV     R3,#0...|
00001650  11 4d 4f 56 20 20 20 20  20 52 34 2c 23 30 0d 0b  |.MOV     R4,#0..|
00001660  90 1b 53 57 49 20 20 20  20 20 22 58 4f 53 5f 46  |..SWI     "XOS_F|
00001670  53 43 6f 6e 74 72 6f 6c  22 0d 0b 9a 11 4d 4f 56  |SControl"....MOV|
00001680  20 20 20 20 20 52 30 2c  52 36 0d 0b a4 1f 4c 44  |     R0,R6....LD|
00001690  52 20 20 20 20 20 52 31  2c 5b 70 77 2c 23 66 69  |R     R1,[pw,#fi|
000016a0  6c 65 5f 77 61 74 63 68  5d 0d 0b ae 12 42 4c 20  |le_watch]....BL |
000016b0  20 20 20 20 20 73 74 72  63 6d 70 0d 0b b8 22 53  |     strcmp..."S|
000016c0  54 52 45 51 20 20 20 52  38 2c 5b 70 77 2c 23 63  |TREQ   R8,[pw,#c|
000016d0  6c 6f 73 65 64 5f 68 61  6e 64 6c 65 5d 0d 0b c2  |losed_handle]...|
000016e0  11 4d 4f 56 20 20 20 20  20 52 32 2c 52 36 0d 0b  |.MOV     R2,R6..|
000016f0  cc 1b 4d 4f 56 20 20 20  20 20 52 30 2c 23 6d 6f  |..MOV     R0,#mo|
00001700  64 75 6c 65 5f 66 72 65  65 0d 0b d6 18 53 57 49  |dule_free....SWI|
00001710  20 20 20 20 20 22 58 4f  53 5f 4d 6f 64 75 6c 65  |     "XOS_Module|
00001720  22 0d 0b e0 1d 4c 44 4d  46 44 20 20 20 28 73 70  |"....LDMFD   (sp|
00001730  29 21 2c 7b 52 30 2d 52  38 2c 50 43 7d 5e 0d 0b  |)!,{R0-R8,PC}^..|
00001740  ea 04 0d 0b f4 0b 2e 73  74 72 63 6d 70 0d 0b fe  |.......strcmp...|
00001750  1e 53 54 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  |.STMFD   (sp)!,{|
00001760  52 30 2d 52 33 2c 6c 69  6e 6b 7d 0d 0c 08 04 0d  |R0-R3,link}.....|
00001770  0c 12 10 2e 73 74 72 63  6d 70 5f 6c 6f 6f 70 0d  |....strcmp_loop.|
00001780  0c 1c 16 4c 44 52 42 20  20 20 20 52 32 2c 5b 52  |...LDRB    R2,[R|
00001790  30 5d 2c 23 31 0d 0c 26  16 4c 44 52 42 20 20 20  |0],#1..&.LDRB   |
000017a0  20 52 33 2c 5b 52 31 5d  2c 23 31 0d 0c 30 04 0d  | R3,[R1],#1..0..|
000017b0  0c 3a 29 43 4d 50 20 20  20 20 20 52 32 2c 23 97  |.:)CMP     R2,#.|
000017c0  28 22 61 22 29 20 20 3b  20 66 6f 6c 64 20 63 61  |("a")  ; fold ca|
000017d0  73 65 20 6f 66 20 52 32  0d 0c 44 16 42 4c 54 20  |se of R2..D.BLT |
000017e0  20 20 20 20 52 32 5f 74  6f 6f 5f 6c 6f 77 0d 0c  |    R2_too_low..|
000017f0  4e 16 43 4d 50 20 20 20  20 20 52 32 2c 23 97 28  |N.CMP     R2,#.(|
00001800  22 7a 22 29 0d 0c 58 14  80 4c 45 20 20 20 52 32  |"z")..X..LE   R2|
00001810  2c 52 32 2c 23 32 32 33  0d 0c 62 0f 2e 52 32 5f  |,R2,#223..b..R2_|
00001820  74 6f 6f 5f 6c 6f 77 0d  0c 6c 04 0d 0c 76 21 43  |too_low..l...v!C|
00001830  4d 50 20 20 20 20 20 52  33 2c 23 97 28 22 61 22  |MP     R3,#.("a"|
00001840  29 20 20 3b 20 66 6f 6c  64 20 52 33 0d 0c 80 16  |)  ; fold R3....|
00001850  42 4c 54 20 20 20 20 20  52 33 5f 74 6f 6f 5f 6c  |BLT     R3_too_l|
00001860  6f 77 0d 0c 8a 16 43 4d  50 20 20 20 20 20 52 33  |ow....CMP     R3|
00001870  2c 23 97 28 22 7a 22 29  0d 0c 94 15 80 4c 45 20  |,#.("z").....LE |
00001880  20 20 52 33 2c 52 33 2c  23 32 32 33 2e 0d 0c 9e  |  R3,R3,#223....|
00001890  0f 2e 52 33 5f 74 6f 6f  5f 6c 6f 77 0d 0c a8 04  |..R3_too_low....|
000018a0  0d 0c b2 16 43 4d 50 20  20 20 20 20 52 33 2c 23  |....CMP     R3,#|
000018b0  97 28 22 20 22 29 0d 0c  bc 17 42 4c 54 20 20 20  |.(" ")....BLT   |
000018c0  20 20 73 74 72 63 6d 70  5f 65 78 69 74 0d 0c c6  |  strcmp_exit...|
000018d0  16 43 4d 50 20 20 20 20  20 52 32 2c 23 97 28 22  |.CMP     R2,#.("|
000018e0  20 22 29 0d 0c d0 17 42  4c 54 20 20 20 20 20 73  | ")....BLT     s|
000018f0  74 72 63 6d 70 5f 65 78  69 74 0d 0c da 11 43 4d  |trcmp_exit....CM|
00001900  50 20 20 20 20 20 52 32  2c 52 33 0d 0c e4 1c 4c  |P     R2,R3....L|
00001910  44 4d 4e 45 46 44 20 28  73 70 29 21 2c 7b 52 30  |DMNEFD (sp)!,{R0|
00001920  2d 52 33 2c 50 43 7d 0d  0c ee 53 42 20 20 20 20  |-R3,PC}...SB    |
00001930  20 20 20 73 74 72 63 6d  70 5f 6c 6f 6f 70 20 20  |   strcmp_loop  |
00001940  20 20 20 20 3b 20 72 65  70 65 61 74 20 69 66 20  |    ; repeat if |
00001950  6c 69 6d 69 74 20 6e 6f  74 20 72 65 61 63 68 65  |limit not reache|
00001960  64 20 65 6c 73 65 20 65  78 69 74 20 77 69 74 68  |d else exit with|
00001970  20 63 6f 6e 64 69 74 69  6f 6e 0d 0c f8 04 0d 0d  | condition......|
00001980  02 10 2e 73 74 72 63 6d  70 5f 65 78 69 74 0d 0d  |...strcmp_exit..|
00001990  0c 16 43 4d 50 20 20 20  20 20 52 32 2c 23 97 28  |..CMP     R2,#.(|
000019a0  22 20 22 29 0d 0d 16 11  4d 4f 56 4c 54 20 20 20  |" ")....MOVLT   |
000019b0  52 32 2c 23 30 0d 0d 20  16 43 4d 50 20 20 20 20  |R2,#0.. .CMP    |
000019c0  20 52 33 2c 23 97 28 22  20 22 29 0d 0d 2a 11 4d  | R3,#.(" ")..*.M|
000019d0  4f 56 4c 54 20 20 20 52  33 2c 23 30 0d 0d 34 11  |OVLT   R3,#0..4.|
000019e0  43 4d 50 20 20 20 20 20  52 32 2c 52 33 0d 0d 3e  |CMP     R2,R3..>|
000019f0  4d 4c 44 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  |MLDMFD   (sp)!,{|
00001a00  52 30 2d 52 33 2c 50 43  7d 20 3b 20 4e 6f 20 27  |R0-R3,PC} ; No '|
00001a10  5e 27 20 73 6f 20 77 65  20 63 61 6e 20 72 65 74  |^' so we can ret|
00001a20  75 72 6e 20 66 6c 61 67  73 20 77 65 20 68 61 76  |urn flags we hav|
00001a30  65 20 6a 75 73 74 20 73  65 74 0d 0d 48 04 0d 0d  |e just set..H...|
00001a40  52 3e 2e 6f 75 74 70 75  74 5f 73 74 72 65 61 6d  |R>.output_stream|
00001a50  20 45 51 55 53 20 22 3c  50 72 69 6e 74 65 72 54  | EQUS "<PrinterT|
00001a60  79 70 65 24 31 3e 22 2b  bd 30 20 3b 20 50 61 72  |ype$1>"+.0 ; Par|
00001a70  61 6c 6c 65 6c 20 64 65  76 69 63 65 0d 0d 5c 05  |allel device..\.|
00001a80  5d 0d 0d 66 05 ed 0d 0d  70 04 0d 0d 7a 25 f2 6d  |]..f....p...z%.m|
00001a90  6f 64 75 6c 65 5f 73 61  76 65 28 22 53 70 6f 6f  |odule_save("Spoo|
00001aa0  6c 4d 6f 64 22 2c 63 6f  64 65 25 2c 4f 25 29 0d  |lMod",code%,O%).|
00001ab0  0d 84 04 0d 0d 8e 05 e0  0d 0d 98 04 0d 0d a2 14  |................|
00001ac0  dd 20 a4 6d 6f 64 75 6c  65 5f 68 65 61 64 65 72  |. .module_header|
00001ad0  0d 0d ac 0d 5b 4f 50 54  20 70 61 73 73 0d 0d b6  |....[OPT pass...|
00001ae0  0a 45 51 55 44 20 30 0d  0d c0 0d 45 51 55 44 20  |.EQUD 0....EQUD |
00001af0  69 6e 69 74 0d 0d ca 11  45 51 55 44 20 66 69 6e  |init....EQUD fin|
00001b00  61 6c 69 73 65 0d 0d d4  0a 45 51 55 44 20 30 0d  |alise....EQUD 0.|
00001b10  0d de 0e 45 51 55 44 20  74 69 74 6c 65 0d 0d e8  |...EQUD title...|
00001b20  0d 45 51 55 44 20 68 65  6c 70 0d 0d f2 11 45 51  |.EQUD help....EQ|
00001b30  55 44 20 63 6f 6d 6d 61  6e 64 73 0d 0d fc 0a 45  |UD commands....E|
00001b40  51 55 44 20 30 0d 0e 06  0a 2e 74 69 74 6c 65 0d  |QUD 0.....title.|
00001b50  0e 10 17 45 51 55 53 20  22 50 72 69 6e 74 53 70  |...EQUS "PrintSp|
00001b60  6f 6f 6c 65 72 22 0d 0e  1a 0a 45 51 55 42 20 30  |ooler"....EQUB 0|
00001b70  0d 0e 24 09 2e 68 65 6c  70 0d 0e 2e 18 45 51 55  |..$..help....EQU|
00001b80  53 20 22 50 72 69 6e 74  20 53 70 6f 6f 6c 65 72  |S "Print Spooler|
00001b90  22 0d 0e 38 0a 45 51 55  42 20 39 0d 0e 42 1d 45  |"..8.EQUB 9..B.E|
00001ba0  51 55 53 20 22 31 2e 30  30 20 28 32 39 20 41 75  |QUS "1.00 (29 Au|
00001bb0  67 20 31 39 39 33 29 22  0d 0e 4c 0a 45 51 55 42  |g 1993)"..L.EQUB|
00001bc0  20 30 0d 0e 56 0c 2e 63  6f 6d 68 65 6c 70 0d 0e  | 0..V..comhelp..|
00001bd0  60 36 45 51 55 53 20 22  2a 50 72 69 6e 74 46 69  |`6EQUS "*PrintFi|
00001be0  6c 65 20 70 72 69 6e 74  73 20 61 20 66 69 6c 65  |le prints a file|
00001bf0  20 69 6e 20 74 68 65 20  62 61 63 6b 67 72 6f 75  | in the backgrou|
00001c00  6e 64 2e 22 0d 0e 6a 0b  45 51 55 42 20 31 33 0d  |nd."..j.EQUB 13.|
00001c10  0e 74 0b 2e 73 79 6e 74  61 78 0d 0e 7e 28 45 51  |.t..syntax..~(EQ|
00001c20  55 53 20 22 53 79 6e 74  61 78 3a 20 2a 50 72 69  |US "Syntax: *Pri|
00001c30  6e 74 46 69 6c 65 20 3c  66 69 6c 65 6e 61 6d 65  |ntFile <filename|
00001c40  3e 22 0d 0e 88 0a 45 51  55 42 20 30 0d 0e 92 12  |>"....EQUB 0....|
00001c50  2e 63 6f 6d 68 65 6c 70  5f 77 61 74 63 68 0d 0e  |.comhelp_watch..|
00001c60  9c 4e 45 51 55 53 20 22  2a 50 72 69 6e 74 57 61  |.NEQUS "*PrintWa|
00001c70  74 63 68 20 77 61 69 74  73 20 66 6f 72 20 74 68  |tch waits for th|
00001c80  65 20 6e 61 6d 65 64 20  66 69 6c 65 20 74 6f 20  |e named file to |
00001c90  62 65 20 63 6c 6f 73 65  64 2c 20 74 68 65 6e 20  |be closed, then |
00001ca0  70 72 69 6e 74 73 20 69  74 2e 20 22 0d 0e a6 4c  |prints it. "...L|
00001cb0  45 51 55 53 20 22 49 66  20 6e 6f 20 66 69 6c 65  |EQUS "If no file|
00001cc0  20 69 73 20 67 69 76 65  6e 2c 20 74 68 65 20 63  | is given, the c|
00001cd0  75 72 72 65 6e 74 20 50  72 69 6e 74 57 61 74 63  |urrent PrintWatc|
00001ce0  68 20 66 69 6c 65 6e 61  6d 65 20 69 73 20 72 65  |h filename is re|
00001cf0  70 6f 72 74 65 64 2e 22  0d 0e b0 0b 45 51 55 42  |ported."....EQUB|
00001d00  20 31 33 0d 0e ba 11 2e  73 79 6e 74 61 78 5f 77  | 13.....syntax_w|
00001d10  61 74 63 68 0d 0e c4 2b  45 51 55 53 20 22 53 79  |atch...+EQUS "Sy|
00001d20  6e 74 61 78 3a 20 2a 50  72 69 6e 74 57 61 74 63  |ntax: *PrintWatc|
00001d30  68 20 5b 3c 66 69 6c 65  6e 61 6d 65 3e 5d 22 0d  |h [<filename>]".|
00001d40  0e ce 0a 45 51 55 42 20  30 0d 0e d8 04 0d 0e e2  |...EQUB 0.......|
00001d50  09 41 4c 49 47 4e 0d 0e  ec 0d 2e 63 6f 6d 6d 61  |.ALIGN.....comma|
00001d60  6e 64 73 0d 0e f6 4c a4  63 6f 6d 6d 61 6e 64 28  |nds...L.command(|
00001d70  22 50 72 69 6e 74 46 69  6c 65 22 2c 20 22 70 72  |"PrintFile", "pr|
00001d80  69 6e 74 66 69 6c 65 22  2c 20 26 30 30 30 31 30  |intfile", &00010|
00001d90  30 30 31 2c 73 79 6e 74  61 78 2c 20 20 20 20 20  |001,syntax,     |
00001da0  20 63 6f 6d 68 65 6c 70  20 20 20 20 20 20 29 0d  | comhelp      ).|
00001db0  0f 00 4c a4 63 6f 6d 6d  61 6e 64 28 22 50 72 69  |..L.command("Pri|
00001dc0  6e 74 57 61 74 63 68 22  2c 22 70 72 69 6e 74 77  |ntWatch","printw|
00001dd0  61 74 63 68 22 2c 26 30  30 30 31 30 30 30 30 2c  |atch",&00010000,|
00001de0  73 79 6e 74 61 78 5f 77  61 74 63 68 2c 63 6f 6d  |syntax_watch,com|
00001df0  68 65 6c 70 5f 77 61 74  63 68 29 0d 0f 0a 0a 45  |help_watch)....E|
00001e00  51 55 42 20 30 0d 0f 14  09 41 4c 49 47 4e 0d 0f  |QUB 0....ALIGN..|
00001e10  1e 05 5d 0d 0f 28 07 3d  22 22 0d 0f 32 04 0d 0f  |..]..(.=""..2...|
00001e20  3c 10 dd 20 a4 65 72 72  6f 72 28 61 24 29 0d 0f  |<.. .error(a$)..|
00001e30  46 0d 5b 4f 50 54 20 70  61 73 73 0d 0f 50 0a 45  |F.[OPT pass..P.E|
00001e40  51 55 44 20 30 0d 0f 5a  0b 45 51 55 53 20 61 24  |QUD 0..Z.EQUS a$|
00001e50  0d 0f 64 0a 45 51 55 42  20 30 0d 0f 6e 05 5d 0d  |..d.EQUB 0..n.].|
00001e60  0f 78 07 3d 22 22 0d 0f  82 04 0d 0f 8c 29 dd 20  |.x.="".......). |
00001e70  a4 63 6f 6d 6d 61 6e 64  28 61 24 2c 63 6f 6d 24  |.command(a$,com$|
00001e80  2c 66 6c 61 67 73 2c 73  79 6e 74 61 78 2c 68 65  |,flags,syntax,he|
00001e90  6c 70 29 0d 0f 96 0a ea  20 61 64 64 72 0d 0f a0  |lp)..... addr...|
00001ea0  19 e7 20 70 61 73 73 3d  36 20 61 64 64 72 3d a0  |.. pass=6 addr=.|
00001eb0  28 63 6f 6d 24 29 0d 0f  aa 0c 5b 4f 50 54 70 61  |(com$)....[OPTpa|
00001ec0  73 73 0d 0f b4 0b 45 51  55 53 20 61 24 0d 0f be  |ss....EQUS a$...|
00001ed0  0a 45 51 55 42 20 30 0d  0f c8 09 41 4c 49 47 4e  |.EQUB 0....ALIGN|
00001ee0  0d 0f d2 0d 45 51 55 44  20 61 64 64 72 0d 0f dc  |....EQUD addr...|
00001ef0  0e 45 51 55 44 20 66 6c  61 67 73 0d 0f e6 0f 45  |.EQUD flags....E|
00001f00  51 55 44 20 73 79 6e 74  61 78 0d 0f f0 0d 45 51  |QUD syntax....EQ|
00001f10  55 44 20 68 65 6c 70 0d  0f fa 05 5d 0d 10 04 07  |UD help....]....|
00001f20  3d 22 22 0d 10 0e 04 0d  10 18 1c dd 20 f2 6d 6f  |=""......... .mo|
00001f30  64 75 6c 65 5f 73 61 76  65 28 66 24 2c 73 25 2c  |dule_save(f$,s%,|
00001f40  65 25 29 0d 10 22 1e c8  99 20 22 4f 53 5f 4d 6f  |e%).."... "OS_Mo|
00001f50  64 75 6c 65 22 2c 31 31  2c 73 25 2c 65 25 2d 73  |dule",11,s%,e%-s|
00001f60  25 0d 10 2c 22 c8 99 20  22 4f 53 5f 46 69 6c 65  |%..,".. "OS_File|
00001f70  22 2c 31 30 2c 66 24 2c  26 46 46 41 2c 2c 73 25  |",10,f$,&FFA,,s%|
00001f80  2c 65 25 0d 10 36 05 e1  0d ff                    |,e%..6....|
00001f8a