annotate level1/modules/kernel.asm @ 1071:853a796a1bcd

Removed logbook
author boisy
date Mon, 31 Mar 2003 14:10:56 +0000
parents dd89c62ea2ca
children 607fcc81c5ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 * OS9p1 - OS-9 Level One V2 P1 module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 * ------------------------------------------------------------------
201
668388823050 Fixed headers to be consistent
boisy
parents: 165
diff changeset
8 * 14 From Tandy OS-9 Level One VR 02.00.00
300
e2ac8a38f22c Changed module edition
boisy
parents: 297
diff changeset
9 * 15 Module validation consists only of module BGP 02/07/21
e2ac8a38f22c Changed module edition
boisy
parents: 297
diff changeset
10 * header parity check. CRC check is not done
e2ac8a38f22c Changed module edition
boisy
parents: 297
diff changeset
11 * unless D.CRC is set to 1, which is NOT the
e2ac8a38f22c Changed module edition
boisy
parents: 297
diff changeset
12 * default case. By default, D.CRC is set
e2ac8a38f22c Changed module edition
boisy
parents: 297
diff changeset
13 * to 0, thus there is no CRC checking. Speeds
e2ac8a38f22c Changed module edition
boisy
parents: 297
diff changeset
14 * up module loads quite a bit.
306
c863af5b4ea1 init.asm: extended (see os9defs(
boisy
parents: 300
diff changeset
15 * The Init module has a bit in a compatibility
c863af5b4ea1 init.asm: extended (see os9defs(
boisy
parents: 300
diff changeset
16 * byte that can turn on/off CRC checking
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 nam OS9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 ttl OS-9 Level One V2 P1 module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 use scfdefs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 tylg set Systm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 rev set $01
300
e2ac8a38f22c Changed module edition
boisy
parents: 297
diff changeset
30 edition set 15
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 L0000 mod eom,name,tylg,atrv,OS9Cold,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 name fcs /OS9/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 fcc /CC/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 InitNam fcs /INIT/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 P2Nam fcs /OS9P2/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 VectCode bra SWI3Jmp
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 nop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 bra SWI2Jmp
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 nop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49 bra SWIJmp
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 nop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 bra NMIJmp
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 nop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 bra IRQJmp
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 nop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 bra FIRQJmp
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 SWI3Jmp jmp [>D.SWI3]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 SWI2Jmp jmp [>D.SWI2]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 SWIJmp jmp [>D.SWI]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 NMIJmp jmp [>D.NMI]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 IRQJmp jmp [>D.IRQ]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 FIRQJmp jmp [>D.FIRQ]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 VectCSz equ *-VectCode
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 SysTbl fcb F$Link
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 fdb FLink-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 fcb F$Fork
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 fdb FFork-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 fcb F$Chain
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 fdb FChain-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 fcb F$Chain+$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 fdb SFChain-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 fcb F$PrsNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 fdb FPrsNam-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 fcb F$CmpNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 fdb FCmpNam-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 fcb F$SchBit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 fdb FSchBit-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 fcb F$AllBit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 fdb FAllBit-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 fcb F$DelBit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 fdb FDelBit-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 fcb F$CRC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 fdb FCRC-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 fcb F$SRqMem+$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 fdb FSRqMem-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 fcb F$SRtMem+$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 fdb FSRtMem-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102 fcb F$AProc+$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 fdb FAProc-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 fcb F$NProc+$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 fdb FNProc-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 fcb F$VModul+$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 fdb FVModul-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 fcb F$SSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 fdb FSSvc-*-2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 fcb $80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 * OS-9 Genesis!
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 OS9Cold equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 * clear out system globals from $0020-$0400
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 ldx #D.FMBM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 ldy #$400-D.FMBM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 L007F std ,x++
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 leay -2,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 bne L007F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 * set up system globals
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 inca D = $200
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 std <D.FMBM $200 = start of free memory bitmap
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 addb #$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 std <D.FMBM+2 $220 = end of free memory bitmap
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 addb #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 std <D.SysDis $222 = addr of sys dispatch tbl
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 addb #$70
296
398a1bbd04bd Had wrong math in a comment -- fixed
boisy
parents: 247
diff changeset
136 std <D.UsrDis $292 = addr of usr dispatch tbl
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 inca D = $300
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 std <D.ModDir $300 = mod dir start
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 stx <D.ModDir+2 X = $400 = mod dir end
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 leas >$0100,x S = $500 (system stack?)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 * Check for valid RAM starting at $400
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 ChkRAM leay ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 ldd ,y store org contents in D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 ldx #$00FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 stx ,y write pattern to ,Y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 cmpx ,y same as what we wrote?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 bne L00C2 nope, not RAM here!
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 ldx #$FF00 try different pattern
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 stx ,y write it to ,Y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 cmpx ,y same as what we wrote?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 bne L00C2 nope, not RAM here!
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 std ,y else restore org contents
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 leax >$0100,y check top of next 256 block
977
dd89c62ea2ca os9.asm and oscode.asm now use BTStart symbolic from systype
boisy
parents: 308
diff changeset
156 cmpx #BTStart stop short of boot track mem
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 bcs ChkRAM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 leay ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 * Here, Y = end of RAM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 L00C2 leax ,y X = end of RAM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 stx <D.MLIM save off memory limit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 * Copy vector code over to address $100
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 pshs y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 leax >VectCode,pcr
247
7b282be4703e More slight source changes
boisy
parents: 201
diff changeset
166 ldy #D.XSWI3
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 ldb #VectCSz
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 L00D2 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 sta ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 bne L00D2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 puls y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 * validate modules at top of RAM (kernel, etc.)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174 L00DB lbsr ValMod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 bcs L00E6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 ldd M$Size,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 leax d,x go past module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178 bra L00EC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179 L00E6 cmpb #E$KwnMod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180 beq L00EE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181 leax 1,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
182 L00EC bne L00DB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
184 * copy vectors to system globals
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
185 L00EE leay >Vectors,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186 leax >L0000,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 ldx #D.SWI3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189 L00FB ldd ,y++
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 addd ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
191 std ,x++
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
192 cmpx #$0036
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
193 bls L00FB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 leas 2,s restore stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
196 * fill in more system globals
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
197 leax >URtoSs,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
198 stx <D.URtoSs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199 leax >UsrIRQ,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
200 stx <D.UsrIRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
201 leax >UsrSvc,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
202 stx <D.UsrSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
203 leax >SysIRQ,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 stx <D.SysIRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
205 stx <D.SvcIRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 leax >SysSvc,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207 stx <D.SysSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 stx <D.SWI2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 leax >Poll,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210 stx <D.Poll
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 leax >Clock,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212 stx <D.Clock
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
213 stx <D.AltIRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 * install system calls
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216 leay >SysTbl,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217 lbsr InstSSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
219 * link to init module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 lda #Systm+0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 leax >InitNam,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
222 os9 F$Link
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
223 lbcs OS9Cold
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 stu <D.Init
308
1d99e2771841 Renamed compatibility byte to feature byte in init
boisy
parents: 306
diff changeset
225 lda Feature1,u get feature byte 1
306
c863af5b4ea1 init.asm: extended (see os9defs(
boisy
parents: 300
diff changeset
226 bita #CRCOn CRC on?
c863af5b4ea1 init.asm: extended (see os9defs(
boisy
parents: 300
diff changeset
227 beq GetMem branch if not (already cleared earlier)
c863af5b4ea1 init.asm: extended (see os9defs(
boisy
parents: 300
diff changeset
228 inc <D.CRC else turn on CRC checking
c863af5b4ea1 init.asm: extended (see os9defs(
boisy
parents: 300
diff changeset
229 GetMem ldd MaxMem+1,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
230 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 cmpd <D.MLIM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232 bcc L0158
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
233 std <D.MLIM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 L0158 ldx <D.FMBM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
235 ldb #$F8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 stb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 ldb <D.MLIM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
239 negb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 negb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
242 lbsr L065A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
243
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 * jump into OS9p2 here
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
245 leax >P2Nam,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
246 lda #Systm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
247 os9 F$Link
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
248 lbcs OS9Cold
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
249 jmp ,y
165
473b9aec5828 Set labels on vectors
boisy
parents: 0
diff changeset
250 SWI3 pshs pc,x,b
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251 ldb #P$SWI3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 bra L018C
165
473b9aec5828 Set labels on vectors
boisy
parents: 0
diff changeset
253 SWI2 pshs pc,x,b
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
254 ldb #P$SWI2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
255 bra L018C
247
7b282be4703e More slight source changes
boisy
parents: 201
diff changeset
256 DUMMY rti
165
473b9aec5828 Set labels on vectors
boisy
parents: 0
diff changeset
257 SVCIRQ jmp [>D.SvcIRQ]
473b9aec5828 Set labels on vectors
boisy
parents: 0
diff changeset
258 SWI pshs pc,x,b
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
259 ldb #P$SWI
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
260 L018C ldx >D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
261 ldx b,x get SWI entry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262 stx 3,s put in PC on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
263 puls pc,x,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
264
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 UsrIRQ leay <L01B1,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 * transition from user to system state
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 URtoSs clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
268 tfr a,dp clear direct page
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
269 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270 ldd <D.SysSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
271 std <D.SWI2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
272 ldd <D.SysIRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
273 std <D.SvcIRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
274 leau ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
275 stu P$SP,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
276 lda P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
277 ora #SysState
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
278 sta P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
279 jmp ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
280
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
281 L01B1 jsr [>D.Poll]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
282 bcc L01BD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
283 ldb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
284 orb #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
285 stb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
286 L01BD lbra L0255
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
287
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
288 SysIRQ clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
289 tfr a,dp
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
290 jsr [>D.Poll]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
291 bcc L01CF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
292 ldb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
293 orb #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
294 stb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
295 L01CF rti
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
296 Poll comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
297 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
298
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
299 Clock ldx <D.SProcQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
300 beq L01FD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
301 lda P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
302 bita #TimSleep
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
303 beq L01FD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
304 ldu P$SP,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
305 ldd P$SP,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
306 subd #$0001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
307 std P$SP,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
308 bne L01FD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
309 L01E7 ldu P$Queue,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
310 bsr L021A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
311 leax ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
312 beq L01FB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
313 lda P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
314 bita #TimSleep
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
315 beq L01FB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
316 ldu P$SP,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
317 ldd P$SP,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
318 beq L01E7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
319 L01FB stx <D.SProcQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
320 L01FD dec <D.Slice
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
321 bne ClockRTI
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
322 lda <D.TSlice
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
323 sta <D.Slice
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
324 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
325 beq ClockRTI
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
326 lda P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
327 ora #TimOut
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
328 sta P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
329 bpl L0212 branch if not system state
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
330 ClockRTI rti
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
331
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
332 L0212 leay >L0255,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
333 bra URtoSs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
334
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
335 * X = proc desc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
336 FAProc ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
337 L021A pshs u,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
338 ldu #$003F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
339 bra L0228
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
340 L0221 ldb P$Age,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
341 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
342 beq L0228
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
343 stb P$Age,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
344 L0228 ldu P$Queue,u U = proc desc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
345 bne L0221
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
346 ldu #$003F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
347 lda P$Prior,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
348 sta P$Age,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
349 orcc #IntMasks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
350 L0235 leay ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
351 ldu P$Queue,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
352 beq L023F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
353 cmpa P$Age,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
354 bls L0235
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
355 L023F stu P$Queue,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
356 stx P$Queue,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
357 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
358 puls pc,u,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
359
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
360 UsrSvc leay <L024E,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
361 orcc #IntMasks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
362 lbra URtoSs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
363
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
364 L024E andcc #^IntMasks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
365 ldy <D.UsrDis
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
366 bsr L0278
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
367 L0255 ldx <D.Proc get current proc desc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
368 beq FNProc branch to FNProc if none
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
369 orcc #IntMasks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
370 ldb P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
371 andb #^SysState
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
372 stb P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
373 bitb #TimOut
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
374 beq L02D1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
375 andb #^TimOut
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
376 stb P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
377 bsr L021A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
378 bra FNProc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
379
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
380 * system call entry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
381 SysSvc clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
382 tfr a,dp set direct page to 0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
383 leau ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
384 ldy <D.SysDis
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
385 bsr L0278
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
386 rti
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
387
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
388 L0278 pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
389 ldx R$PC,u point X to PC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
390 ldb ,x+ get func code at X
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
391 stx R$PC,u restore updated PC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
392 lslb multiply by 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
393 bcc L0288 branch if user call
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
394 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
395 ldx -2,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
396 bra L0290
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
397 L0288 cmpb #$6E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
398 bcc L02A7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
399 ldx b,y X = addr of system call
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
400 beq L02A7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
401 L0290 jsr ,x jsr into system call
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
402 L0292 puls u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
403 tfr cc,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
404 bcc FixCC branch if no error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
405 stb R$B,u store error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
406 FixCC ldb R$CC,u get caller's CC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
407 andb #^(Negative+Zero+TwosOvfl+Carry)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
408 stb R$CC,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
409 anda #Negative+Zero+TwosOvfl+Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
410 ora R$CC,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
411 sta R$CC,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
412 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
413 L02A7 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
414 ldb #E$UnkSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
415 bra L0292
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
416
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
417 * no signal handler, exit with signal value as exit code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
418 L02AC ldb P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
419 orb #SysState
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
420 stb P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
421 ldb <P$Signal,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
422 andcc #^(IntMasks)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
423 os9 F$Exit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
424
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
425 FNProc clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
426 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
427 std <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
428 bra L02C2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
429 * execution goes here when there are no active processes
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
430 L02C0 cwai #^(IntMasks)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
431 L02C2 orcc #IntMasks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
432 ldx <D.AProcQ get next active process
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
433 beq L02C0 CWAI if none
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
434 ldd P$Queue,x get queue ptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
435 std <D.AProcQ store in Active Q
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
436 stx <D.Proc store in current process
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
437 lds P$SP,x get process' stack ptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
438 L02D1 ldb P$State,x get state
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
439 bmi L0308 branch if system state
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
440 bitb #Condem process condemned?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
441 bne L02AC branch if so...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
442 ldb <P$Signal,x get signal no
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
443 beq L02FF branch if none
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
444 decb decrement
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
445 beq L02FC branch if wake up
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
446 ldu <P$SigVec,x get signal handler addr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
447 beq L02AC branch if none
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
448 ldy <P$SigDat,x get data addr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
449 ldd $06,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
450 pshs u,y,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
451 ldu $0A,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
452 lda <P$Signal,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
453 ldb $09,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
454 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
455 ldd $06,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
456 pshs u,y,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
457 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
458 L02FC stb <P$Signal,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
459 L02FF ldd <P$SWI2,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
460 std <D.SWI2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
461 ldd <D.UsrIRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
462 std <D.SvcIRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
463 L0308 rti
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
464
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
465 FLink pshs u save caller regs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
466 ldd R$A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
467 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
468 lbsr L0443
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
469 bcc FLinkOK
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
470 ldb #E$MNF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
471 bra L033D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
472 * U = module dir entry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
473 FLinkOK ldy ,u get module ptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
474 ldb M$Revs,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
475 bitb #ReEnt reentrant?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
476 bne L032A branch if so
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
477 tst $02,u link count zero?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
478 beq L032A yep, ok to link to nonreent
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
479 comb else module is busy
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
480 ldb #E$ModBsy
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
481 bra L033D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
482 L032A inc $02,u increment link count
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
483 ldu ,s get caller regs from stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
484 stx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
485 sty R$U,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
486 ldd M$Type,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
487 std R$D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
488 ldd M$IDSize,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
489 leax d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
490 stx R$Y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
491 L033D puls pc,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
492
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
493 FVModul pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
494 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
495 bsr ValMod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
496 puls y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
497 stu R$U,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
498 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
499 * X = address of module to validate
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
500 ValMod bsr ChkMHCRC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
501 bcs L039A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
502 lda M$Type,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
503 pshs x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
504 ldd M$Name,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
505 leax d,x X = addr of name in mod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
506 puls a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
507 lbsr L0443
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
508 puls x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
509 bcs L039B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
510 ldb #E$KwnMod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
511 cmpx ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
512 beq L03A1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
513 lda M$Revs,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
514 anda #RevsMask
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
515 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
516 ldy ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
517 lda M$Revs,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
518 anda #RevsMask
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
519 cmpa ,s+ same revision as other mod?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
520 bcc L03A1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
521 pshs y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
522 ldb M$Size,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
523 bne L0395
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
524 ldx ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
525 cmpx <D.BTLO
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
526 bcc L0395
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
527 ldd $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
528 addd #$00FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
529 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
530 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
531 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
532 ldb ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
533 ldx <D.FMBM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
534 os9 F$DelBit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
535 clr $02,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
536 L0395 puls y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
537 L0397 stx ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
538 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
539 L039A rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
540 L039B leay ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
541 bne L0397
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
542 ldb #E$DirFul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
543 L03A1 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
544 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
545
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
546 * check module header and CRC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
547 * X = address of potential module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
548 ChkMHCRC ldd ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
549 cmpd #M$ID12 sync bytes?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
550 bne L03B1 nope, not a module here
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
551 leay M$Parity,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
552 bsr ChkMHPar check header parity
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
553 bcc L03B5 branch if ok
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
554 L03B1 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
555 ldb #E$BMID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
556 rts
297
eda95fad0c31 Added check for D.CRC switch to prevent CRC checking (off by default)
boisy
parents: 296
diff changeset
557
eda95fad0c31 Added check for D.CRC switch to prevent CRC checking (off by default)
boisy
parents: 296
diff changeset
558 L03B5
eda95fad0c31 Added check for D.CRC switch to prevent CRC checking (off by default)
boisy
parents: 296
diff changeset
559 * Following 4 lines added to support no CRC checks - 2002/07/21
eda95fad0c31 Added check for D.CRC switch to prevent CRC checking (off by default)
boisy
parents: 296
diff changeset
560 lda <D.CRC is CRC checking on?
eda95fad0c31 Added check for D.CRC switch to prevent CRC checking (off by default)
boisy
parents: 296
diff changeset
561 bne DoCRCCk branch if so
eda95fad0c31 Added check for D.CRC switch to prevent CRC checking (off by default)
boisy
parents: 296
diff changeset
562 clrb
eda95fad0c31 Added check for D.CRC switch to prevent CRC checking (off by default)
boisy
parents: 296
diff changeset
563 rts
eda95fad0c31 Added check for D.CRC switch to prevent CRC checking (off by default)
boisy
parents: 296
diff changeset
564
eda95fad0c31 Added check for D.CRC switch to prevent CRC checking (off by default)
boisy
parents: 296
diff changeset
565 DoCRCCk pshs x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
566 ldy M$Size,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
567 bsr ChkMCRC checkm module CRC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
568 puls pc,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
569 * check module header parity
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
570 * Y = pointer to parity byte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
571 ChkMHPar pshs y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
572 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
573 ChkM010 eora ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
574 cmpx 2,s compare to addr of M$Parity
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
575 bls ChkM010
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
576 cmpa #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
577 puls pc,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
578 * X = address of potential module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
579 * Y = size of module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
580 ChkMCRC ldd #$FFFF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
581 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
582 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
583 leau 1,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
584 L03D4 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
585 bsr CRCAlgo
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
586 leay -1,y dec Y (size of module)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
587 bne L03D4 continue
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
588 clr -1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
589 lda ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
590 cmpa #CRCCon1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
591 bne L03EC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
592 ldd 1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
593 cmpd #CRCCon23
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
594 beq L03EF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
595 L03EC comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
596 ldb #E$BMCRC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
597 L03EF puls pc,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
598
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
599 * F$CRC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
600 FCRC ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
601 ldy R$Y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
602 beq L0402
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
603 ldu R$U,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
604 L03FA lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
605 bsr CRCAlgo
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
606 leay -1,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
607 bne L03FA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
608 L0402 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
609 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
610
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
611 CRCAlgo eora ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
612 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
613 ldd $01,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
614 std ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
615 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
616 ldb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
617 lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
618 rola
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
619 eora 1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
620 std 1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
621 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
622 lda ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
623 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
624 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
625 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
626 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
627 eora 1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
628 eorb 2,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
629 std 1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
630 lda ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
631 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
632 eora ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
633 sta ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
634 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
635 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
636 eora ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
637 sta ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
638 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
639 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
640 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
641 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
642 eora ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
643 bpl L0442
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
644 ldd #$8021
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
645 eora ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
646 sta ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
647 eorb 2,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
648 stb 2,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
649 L0442 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
650
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
651 L0443 ldu #$0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
652 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
653 anda #TypeMask
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
654 andb #LangMask
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
655 pshs u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
656 bsr EatSpace
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
657 cmpa #PDELIM pathlist char?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
658 beq L049C branch if so
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
659 lbsr L074D parse name
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
660 bcs L049D return if error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
661 ldu <D.ModDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
662 L045B pshs u,y,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
663 ldu ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
664 beq L048B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
665 ldd $04,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
666 leay d,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
667 ldb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
668 lbsr L07AB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
669 bcs L0493
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
670 lda $05,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
671 beq L0476
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
672 eora $06,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
673 anda #$F0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
674 bne L0493
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
675 L0476 lda $06,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
676 beq L0480
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
677 eora $06,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
678 anda #$0F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
679 bne L0493
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
680 L0480 puls u,x,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
681 stu $06,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
682 bsr EatSpace
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
683 stx $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
684 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
685 bra L049D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
686 L048B ldd $0B,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
687 bne L0493
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
688 ldd $03,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
689 std $0B,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
690 L0493 puls u,y,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
691 leau $04,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
692 cmpu <D.ModDir+2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
693 bcs L045B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
694 L049C comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
695 L049D puls pc,u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
696
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
697 EatSpace lda #C$SPAC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
698 EatSpc10 cmpa ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
699 beq EatSpc10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
700 lda ,-x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
701 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
702
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
703 FFork ldx <D.PrcDBT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
704 os9 F$All64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
705 bcs L0517
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
706 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
707 pshs x save calling proc desc on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
708 ldd P$User,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
709 std P$User,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
710 lda P$Prior,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
711 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
712 std P$Prior,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
713 ldb #SysState
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
714 stb P$State,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
715 sty <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
716 ldd <P$NIO,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
717 std <P$NIO,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
718 ldd <P$NIO+2,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
719 std <P$NIO+2,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
720 leax <P$DIO,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
721 leay <P$DIO,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
722 ldb #DefIOSiz
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
723 * copy I/O stuff from parent to child
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
724 L04D7 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
725 sta ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
726 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
727 bne L04D7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
728 * X/Y = address of path table in respective proc desc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
729 * Dup stdin/stdout/stderr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
730 ldb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
731 L04E0 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
732 os9 I$Dup
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
733 bcc L04E8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
734 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
735 L04E8 sta ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
736 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
737 bne L04E0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
738 bsr L0553
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
739 bcs L050C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
740 puls y get parent proc desc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
741 sty <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
742 lda P$ID,x get ID of new process
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
743 sta R$A,u store in caller's A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
744 ldb P$CID,y get child id of parent
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
745 sta P$CID,y store new proc in parent's CID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
746 lda P$ID,y get ID of parent
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
747 std P$PID,x store in child proc desc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
748 ldb P$State,x update state of child
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
749 andb #^SysState
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
750 stb P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
751 os9 F$AProc insert child in active Q
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
752 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
753 L050C pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
754 os9 F$Exit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
755 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
756 puls x,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
757 stx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
758 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
759 L0517 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
760 ldb #E$PrcFul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
761 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
762
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
763 FChain bsr L0543
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
764 bcs L0531
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
765 orcc #IntMasks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
766 ldb $0D,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
767 andb #$7F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
768 stb $0D,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
769 L0527 os9 F$AProc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
770 os9 F$NProc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
771
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
772 SFChain bsr L0543
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
773 bcc L0527
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
774 L0531 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
775 stb <P$Signal,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
776 ldb P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
777 orb #Condem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
778 stb P$State,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
779 ldb #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
780 stb P$Prior,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
781 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
782 puls pc,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
783 L0543 pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
784 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
785 ldu <P$PModul,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
786 os9 F$UnLink
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
787 ldu ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
788 bsr L0553
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
789 puls pc,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
790 L0553 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
791 pshs u,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
792 ldd <D.UsrSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
793 std <P$SWI,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
794 std <P$SWI2,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
795 std <P$SWI3,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
796 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
797 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
798 sta <P$Signal,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
799 std <P$SigVec,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
800 lda R$A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
801 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
802 os9 F$Link
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
803 bcc L0578
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
804 os9 F$Load
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
805 bcs L05E7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
806 L0578 ldy <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
807 stu <P$PModul,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
808 cmpa #Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
809 beq L058B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
810 cmpa #Systm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
811 beq L058B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
812 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
813 ldb #E$NEMod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
814 bra L05E7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
815 L058B leay ,u Y = addr of module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
816 ldu 2,s get U off stack (caller regs)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
817 stx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
818 lda R$B,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
819 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
820 cmpd M$Mem,y compare passed mem to module's
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
821 bcc L059B branch if less than
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
822 ldd M$Mem,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
823 L059B addd #$0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
824 bne L05A0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
825 L05A0 os9 F$Mem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
826 bcs L05E7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
827 subd #R$Size subtract registers
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
828 subd R$Y,u subtract parameter area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
829 bcs L05E5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
830 ldx R$U,u get parameter area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
831 ldd R$Y,u get parameter size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
832 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
833 beq L05BE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
834 leax d,x point to end of param area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
835 L05B6 lda ,-x get byte, dec X
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
836 sta ,-y save byte in data area, dec X
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
837 cmpx R$U,u at top of param area?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
838 bhi L05B6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
839 * set up registers for return of F$Fork/F$Chain
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
840 L05BE ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
841 sty -$08,y put in X on caller stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
842 leay -R$Size,y back up register size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
843 sty P$SP,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
844 lda P$ADDR,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
845 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
846 std R$U,y lowest address
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
847 sta R$DP,y set direct page
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
848 adda P$PagCnt,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
849 std R$Y,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
850 puls b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
851 std R$D,y size of param area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
852 ldb #Entire
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
853 stb R$CC,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
854 ldu <P$PModul,x get addr of prim. mod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
855 ldd M$Exec,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
856 leau d,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
857 stu R$PC,y put in PC on caller reg
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
858 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
859 L05E5 ldb #E$IForkP
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
860 L05E7 puls pc,u,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
861
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
862 FSRqMem ldd R$D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
863 addd #$00FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
864 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
865 std R$D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
866 ldx <D.FMBM+2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
867 ldd #$01FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
868 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
869 bra L0604
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
870 L05FA dec $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
871 ldb $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
872 L05FE lsl ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
873 bcc L060A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
874 rol ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
875 L0604 leax -1,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
876 cmpx <D.FMBM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
877 bcs L0620
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
878 L060A lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
879 anda ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
880 bne L05FA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
881 dec 1,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
882 subb 1,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
883 cmpb 1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
884 rora
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
885 addb 1,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
886 rola
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
887 bcs L05FE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
888 ldb 1,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
889 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
890 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
891 L0620 leas 2,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
892 bcs L0635
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
893 ldx <D.FMBM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
894 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
895 ldb 1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
896 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
897 exg d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
898 bsr L065A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
899 exg a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
900 std 8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
901 L0633 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
902 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
903 L0635 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
904 ldb #E$MemFul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
905 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
906
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
907 FSRtMem ldd R$D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
908 addd #$00FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
909 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
910 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
911 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
912 ldd R$U,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
913 beq L0633
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
914 tstb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
915 beq L064E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
916 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
917 ldb #E$BPAddr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
918 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
919 L064E exg a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
920 ldx <D.FMBM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
921 bra L06AD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
922
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
923 FAllBit ldd R$D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
924 leau R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
925 pulu y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
926 L065A pshs y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
927 bsr L0690
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
928 tsta
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
929 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
930 bmi L0671
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
931 lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
932 L0665 ora ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
933 leay -1,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
934 beq L0689
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
935 lsr ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
936 bcc L0665
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
937 sta ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
938 L0671 tfr y,d
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
939 sta ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
940 lda #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
941 bra L067B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
942 L0679 sta ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
943 L067B subb #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
944 bcc L0679
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
945 dec ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
946 bpl L0679
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
947 L0683 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
948 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
949 bne L0683
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
950 ora ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
951 L0689 sta ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
952 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
953 leas 1,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
954 puls pc,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
955 L0690 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
956 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
957 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
958 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
959 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
960 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
961 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
962 leax d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
963 puls b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
964 lda #$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
965 andb #$07
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
966 beq L06A6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
967 L06A2 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
968 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
969 bne L06A2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
970 L06A6 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
971
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
972 FDelBit ldd R$D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
973 leau R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
974 pulu y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
975 L06AD pshs y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
976 bsr L0690
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
977 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
978 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
979 bpl L06C4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
980 lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
981 L06B8 anda ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
982 leay -1,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
983 beq L06D8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
984 asr ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
985 bcs L06B8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
986 sta ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
987 L06C4 tfr y,d
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
988 bra L06CA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
989 L06C8 clr ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
990 L06CA subd #$0008
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
991 bhi L06C8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
992 beq L06D8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
993 L06D1 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
994 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
995 bne L06D1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
996 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
997 anda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
998 L06D8 sta ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
999 clr ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1000 puls pc,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1002 FSchBit pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1003 ldd R$D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1004 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1005 ldy R$Y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1006 ldu R$U,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1007 bsr L06F3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1008 puls u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1009 std R$D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1010 sty R$Y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1011 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1012 L06F3 pshs u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1013 pshs y,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1014 clr 8,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1015 clr 9,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1016 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1017 bsr L0690
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1018 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1019 bra L0710
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1020 L0703 leay $01,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1021 sty $05,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1022 L0708 lsr ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1023 bcc L0714
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1024 ror ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1025 leax $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1026 L0710 cmpx $0B,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1027 bcc L0732
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1028 L0714 lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1029 anda ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1030 bne L0703
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1031 leay $01,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1032 tfr y,d
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1033 subd $05,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1034 cmpd $03,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1035 bcc L0739
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1036 cmpd $09,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1037 bls L0708
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1038 std $09,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1039 ldd $05,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1040 std $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1041 bra L0708
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1042 L0732 ldd $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1043 std $05,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1044 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1045 bra L073B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1046 L0739 std $09,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1047 L073B leas $05,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1048 puls pc,u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1049
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1050 FPrsNam ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1051 bsr L074D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1052 std R$D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1053 bcs L0749
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1054 stx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1055 L0749 sty R$Y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1056 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1057 L074D lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1058 cmpa #PDELIM pathlist char?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1059 bne L0755 branch if not
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1060 leax 1,x go past pathlist char
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1061 L0755 leay ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1062 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1063 lda ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1064 anda #$7F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1065 bsr L0792
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1066 bcs L0772
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1067 L0760 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1068 lda -1,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1069 bmi L076F hi bit set on this char, done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1070 lda ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1071 anda #$7F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1072 bsr IllChar
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1073 bcc L0760
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1074 lda ,-y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1075 L076F andcc #^Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1076 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1077 L0772 cmpa #C$COMA comma?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1078 bne L0778
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1079 L0776 lda ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1080 L0778 cmpa #C$SPAC space?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1081 beq L0776
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1082 lda ,-y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1083 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1084 ldb #E$BNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1085 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1086
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1087 * check for illegal characters in a pathlist
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1088 IllChar cmpa #C$PERD period?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1089 beq L07C9 branch if so
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1090 cmpa #'0 zero?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1091 bcs L07A2 branch if less than
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1092 cmpa #'9 number?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1093 bls L07C9 branch if lower/same
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1094 cmpa #'_ underscore?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1095 beq L07C9 branch if so
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1096 L0792 cmpa #'A A?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1097 bcs L07A2 branch if less than
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1098 cmpa #'Z Z?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1099 bls L07C9 branch if less or equal
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1100 cmpa #'a a?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1101 bcs L07A2 branch if lower
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1102 cmpa #'z z?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1103 bls L07C9 branch if less or equal
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1104 L07A2 orcc #Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1105 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1106
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1107 FCmpNam ldb R$B,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1108 leau R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1109 pulu y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1110 L07AB pshs y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1111 L07AD lda ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1112 bmi L07BE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1113 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1114 beq L07BA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1115 eora ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1116 anda #$DF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1117 beq L07AD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1118 L07BA orcc #Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1119 puls pc,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1120 L07BE decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1121 bne L07BA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1122 eora ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1123 anda #$5F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1124 bne L07BA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1125 puls y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1126 L07C9 andcc #^Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1127 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1128
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1129 FSSvc ldy R$Y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1130 bra InstSSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1131 SSvcLoop tfr b,a put syscall code in A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1132 anda #$7F kill hi bit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1133 cmpa #$7F is code $7F?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1134 beq SSvcOK
977
dd89c62ea2ca os9.asm and oscode.asm now use BTStart symbolic from systype
boisy
parents: 308
diff changeset
1135 cmpa #$37 compare against highest call allowed
dd89c62ea2ca os9.asm and oscode.asm now use BTStart symbolic from systype
boisy
parents: 308
diff changeset
1136 bcs SSvcOK branch if A less than highest call
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1137 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1138 ldb #E$ISWI
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1139 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1140 SSvcOK lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1141 ldu <D.SysDis
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1142 leau b,u U points to entry in table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1143 ldd ,y++ get addr of func
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1144 leax d,y get absolute addr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1145 stx ,u store in system table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1146 bcs InstSSvc branch if system only
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1147 stx <$70,u else store in user table too
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1148 InstSSvc ldb ,y+ get system call code in B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1149 cmpb #$80 end of table?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1150 bne SSvcLoop branch if not
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1151 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1152
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1153 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1154 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1155
165
473b9aec5828 Set labels on vectors
boisy
parents: 0
diff changeset
1156 fdb Clock
247
7b282be4703e More slight source changes
boisy
parents: 201
diff changeset
1157 Vectors fdb SWI3 SWI3
7b282be4703e More slight source changes
boisy
parents: 201
diff changeset
1158 fdb SWI2 SWI2
7b282be4703e More slight source changes
boisy
parents: 201
diff changeset
1159 fdb DUMMY FIRQ
7b282be4703e More slight source changes
boisy
parents: 201
diff changeset
1160 fdb SVCIRQ IRQ
7b282be4703e More slight source changes
boisy
parents: 201
diff changeset
1161 fdb SWI SWI
7b282be4703e More slight source changes
boisy
parents: 201
diff changeset
1162 fdb DUMMY NMI
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1163
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1164 end
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1165