annotate level1/modules/kernel.asm @ 297:eda95fad0c31

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