annotate level1/modules/kernel.asm @ 300:e2ac8a38f22c

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