annotate level2/modules/kernel/fvmodul.asm @ 1624:bb75784a1ec5

Minor source change by Rodney H.
author boisy
date Wed, 30 Jun 2004 01:07:36 +0000
parents 81ab09af8c3f
children 039ddb7c8ad7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
1 **************************************************
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
2 * System Call: F$VModul
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
3 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
4 * Function: Verify a module
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
5 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
6 * Input: X = Address of module to verify
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
7 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
8 * Output: U = Address of module directory entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
9 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
10 * Error: CC = C bit set; B = error code
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
11 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
12 FVModul pshs u preserve register stack pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
13 ldx R$X,u get block offset
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
14 ldy R$D,u get DAT image pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
15 bsr L0463 validate it
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
16 ldx ,s get register stack pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
17 stu R$U,x save address of module directory entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
18 puls u,pc restore & return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
19
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
20 * Validate module - shortcut for calls within OS9p1 go here (ex. OS9Boot)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
21 * Entry: X=Module block offset
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
22 * Y=Module DAT image pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
23 L0463 pshs x,y save block offset & DAT Image ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
24 lbsr L0586 Go check module ID & header parity
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
25 bcs L0495 Error, exit
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
26 ldd #M$Type Get offset to module type
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
27 lbsr L0B02 get it
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
28 andb #LangMask Just keep language mask
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
29 pshs d Preserve ??? & language
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
30 ldd #M$Name get offset to module name
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
31 lbsr L0B02
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
32 leax d,x Point X to module name
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
33 puls a Restore type/language
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
34 lbsr L068D
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
35 puls a
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
36 bcs L0497
1248
81ab09af8c3f Style change
boisy
parents: 1239
diff changeset
37 andb #$0F
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
38 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
39 subr a,b
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
40 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
41 pshs a
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
42 subb ,s+
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
43 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
44 blo L0497 If wrapped, skip ahead
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
45 ldb #E$KwnMod
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
46 fcb $8C skip 2 bytes
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
47 L0491 ldb #E$DirFul
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
48 L0493 orcc #Carry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
49 L0495 puls x,y,pc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
50
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
51 L0497 ldx ,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
52 lbsr L0524
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
53 bcs L0491
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
54 sty ,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
55 stx MD$MPtr,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
56 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
57 clrd
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
58 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
59 clra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
60 clrb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
61 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
62 std MD$Link,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
63 ldd #M$Size Get offset to size of module
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
64 lbsr L0B02
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
65 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
66 addr x,d Add it to module ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
67 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
68 pshs x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
69 addd ,s++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
70 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
71 std MD$MBSiz,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
72 ldy [MD$MPDAT,u] get pointer to module DAT
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
73 ldx <D.ModDir get module directory pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
74 pshs u save module pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
75 fcb $8C skip 2 bytes
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
76
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
77 L04BC leax MD$ESize,x move to next entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
78 L04BE cmpx <D.ModEnd
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
79 bcc L04CD
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
80 cmpx ,s match?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
81 beq L04BC no, keep looking
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
82 cmpy [MD$MPDAT,x] DAT match?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
83 bne L04BC no, keep looking
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
84 bsr L04F2
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
85
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
86 L04CD puls u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
87 ldx <D.BlkMap Get ptr to block map
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
88 ldd MD$MBSiz,u Get size of module
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
89 addd #$1FFF Round up to nearest 8K block
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
90 lsra Divide by 32
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
91 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
92 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
93 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
94 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
95 ldy MD$MPDAT,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
96
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
97 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
98 tfr a,e
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
99 L04DE ldd ,y++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
100 oim #ModBlock,d,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
101 dece
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
102 ELSE
1239
90bad6d8388c Major changes to bring kernel closer to L2 port
boisy
parents: 1145
diff changeset
103 L04DE pshs a,x save block size, blkmap
90bad6d8388c Major changes to bring kernel closer to L2 port
boisy
parents: 1145
diff changeset
104 ldd ,y++ D = image block #
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
105 leax d,x X = blkmap ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
106 ldb ,x get block marker
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
107 orb #ModBlock set module in block
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
108 stb ,x marker
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
109 puls x,a
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
110 deca count--
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
111 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
112 bne L04DE no, keep going
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
113
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
114 clrb clear carry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
115 puls x,y,pc return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
116
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
117 L04F2 pshs d,x,y,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
118 ldx ,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
119
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
120 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
121 tfr x,w Dupe to faster index register
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
122 clrd
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
123 L04FA ldy ,w
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
124 beq L0503
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
125 std ,w++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
126 bra L04FA
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
127 L0503 ldy 2,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
128 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
129 pshs x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
130 clra D=0000
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
131 clrb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
132 L04FA ldy ,x last entry?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
133 beq L0503 ..yes
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
134 std ,x++ no, clear
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
135 bra L04FA and loop
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
136 L0503 puls x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
137 ldy 2,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
138 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
139
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
140 ldu MD$MPDAT,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
141 puls d
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
142
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
143 L050C cmpx MD$MPDAT,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
144 bne L051B
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
145 stu MD$MPDAT,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
146 cmpd MD$MBSiz,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
147 bcc L0519
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
148 ldd MD$MBSiz,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
149 L0519 std MD$MBSiz,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
150 L051B leay MD$ESize,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
151 cmpy <D.ModEnd
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
152 bne L050C
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
153 puls x,y,u,pc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
154
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
155 L0524 pshs x,y,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
156 ldd #M$Size
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
157 lbsr L0B02
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
158 addd ,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
159 addd #$1FFF
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
160 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
161 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
162 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
163 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
164 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
165 tfr a,b
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
166 pshs b
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
167 * incb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
168 comb one byte shorter than incb;lslg;negb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
169 lslb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
170 * negb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
171 sex
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
172 bsr L054E
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
173 bcc L054C
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
174 os9 F$GCMDir get rid of empty slots in module directory
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
175 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
176 tfr 0,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
177 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
178 ldu #$0000
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
179 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
180 stu $05,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
181 bsr L054E
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
182 L054C puls b,x,y,u,pc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
183
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
184 L054E ldx <D.ModDAT
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
185 leax d,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
186 cmpx <D.ModEnd
1239
90bad6d8388c Major changes to bring kernel closer to L2 port
boisy
parents: 1145
diff changeset
187 bcs S.Poll
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
188 ldu 7,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
189 bne L056E
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
190 ldy <D.ModEnd
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
191 leay MD$ESize,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
192 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
193 cmpr x,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
194 ELSE
1239
90bad6d8388c Major changes to bring kernel closer to L2 port
boisy
parents: 1145
diff changeset
195 pshs x
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
196 cmpy ,s++
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
197 ENDC
1239
90bad6d8388c Major changes to bring kernel closer to L2 port
boisy
parents: 1145
diff changeset
198 bhi S.Poll
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
199 sty <D.ModEnd
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
200 leay -MD$ESize,y
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
201 sty $07,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
202 L056E stx <D.ModDAT
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
203 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
204 ldd $05,s Get source ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
205 stx $05,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
206 ldf 2,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
207 clre
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
208 rolw
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
209 tfm d+,x+
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
210 stw ,x Save 0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
211 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
212 ldy 5,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
213 ldb 2,s B=block count
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
214 stx 5,s return dir datimg ptr
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
215 L0577 ldu ,y++ copy images
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
216 stu ,x++ to new mod dat entry
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
217 decb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
218 bne L0577
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
219 clr ,x zero flag
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
220 clr 1,x
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
221 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
222 rts
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
223
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
224 * Default interrupt handling routine on first booting OS9p1
1239
90bad6d8388c Major changes to bring kernel closer to L2 port
boisy
parents: 1145
diff changeset
225 S.Poll orcc #Carry
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
226 rts
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
227
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
228 * Check module ID & calculate module header parity & CRC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
229 * Entry: X=Block offset of module
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
230 * Y=DAT image pointer of module
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
231 L0586 pshs x,y save block offset & DAT pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
232 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
233 clrd
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
234 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
235 clra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
236 clrb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
237 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
238 lbsr L0B02 get module ID
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
239 cmpd #M$ID12 legal module?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
240 beq L0597 yes, calculate header parity
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
241 ldb #E$BMID get bad module ID error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
242 bra L05F3 return error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
243 * Calculate module header parity
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
244 L0597 leax 2,x point to start location of header calc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
245 lbsr AdjBlk0 adjust it for block 0
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
246 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
247 ldw #($4A*256+M$Revs) Get initial value & count (7 bytes of header)
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
248 L05A2 lbsr LDAXY get a byte from module
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
249 eorr a,e add it into running parity
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
250 decf done full header?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
251 bne L05A2 no, keep going
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
252 ince valid parity?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
253 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
254 leas -1,s make var
1239
90bad6d8388c Major changes to bring kernel closer to L2 port
boisy
parents: 1145
diff changeset
255 ldd #($4A*256+M$Revs) Get initial value & count (7 bytes of header)
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
256 L05A2 sta ,s save crc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
257 lbsr LDAXY get next byte
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
258 eora ,s do crc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
259 decb more?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
260 bne L05A2 ..loop
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
261 leas 1,s drop var
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
262 inca $FF+1 = 00
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
263 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
264 beq L05B5 yes, skip ahead
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
265 ldb #E$BMHP get module header parity error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
266 bra L05F3 return with error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
267 L05B5 puls x,y restore module pointer & DAT pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
268 * this checks if the module CRC checking is on or off
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
269 lda <D.CRC is CRC checking on?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
270 bne L05BA yes - go check it
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
271 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
272 clrd no, clear out
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
273 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
274 clra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
275 clrb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
276 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
277 rts and return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
278 * Begin checking Module CRC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
279 * Entry: X=Module pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
280 * Y=DAT image pointer of module
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
281 L05BA ldd #M$Size get offset to module size
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
282 lbsr L0B02 get module size
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
283 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
284 tfr d,w move length to W
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
285 pshs y,x preserve [X]=Buffer pointer,[Y]=DAT pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
286 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
287 pshs y,x,b,a preserve [X]=Buffer pointer,[Y]=DAT pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
288 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
289 ldd #$FFFF initial CRC value of $FFFFFF
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
290 pshs d set up local 24 bit variable
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
291 pshs b
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
292 lbsr AdjBlk0 adjust module pointer into block 0 for mapping
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
293 leau ,s point to CRC accumulator
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
294 * Loop: W=# bytes left to use in CRC calc
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
295 L05CB equ *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
296 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
297 tstf on 256 byte boundary?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
298 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
299 tstb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
300 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
301 bne L05D8 no, keep going
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
302 pshs x give up some time to system
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
303 ldx #1
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
304 os9 F$Sleep
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
305 puls x restore module pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
306 L05D8 lbsr LDAXY get a byte from module into A
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
307 bsr CRCCalc add it to running CRC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
308 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
309 decw Dec # bytes left to calculate CRC with
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
310 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
311 ldd 3,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
312 subd #$0001
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
313 std 3,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
314 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
315 bne L05CB Still more, continue
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
316 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
317 puls b,x yes, restore CRC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
318 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
319 puls b,x,y yes, restore CRC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
320 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
321 cmpb #CRCCon1 CRC MSB match constant?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
322 bne L05F1 no, exit with error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
323 cmpx #CRCCon23 LSW match constant?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
324 beq L05F5 yes, skip ahead
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
325 L05F1 ldb #E$BMCRC Bad Module CRC error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
326 L05F3 orcc #Carry Set up for error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
327 L05F5 puls x,y,pc exit
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
328
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
329 * Calculate 24 bit CRC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
330 * Entry: A=Byte to add to CRC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
331 * U=Pointer to 24 bit CRC accumulator
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
332 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
333 * Future reference note: Do not use W unless preserved, contains module
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
334 * byte counts from routines that come here!!
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
335 CRCCalc eora ,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
336 pshs a
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
337 ldd 1,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
338 std ,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
339 clra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
340 ldb ,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
341 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
342 lsld
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
343 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
344 aslb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
345 rola
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
346 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
347 eora 1,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
348 std 1,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
349 clrb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
350 lda ,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
351 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
352 lsrd
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
353 lsrd
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
354 eord 1,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
355 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
356 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
357 rorb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
358 lsra
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
359 rorb
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
360 eora 1,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
361 eorb 2,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
362 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
363 std 1,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
364 lda ,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
365 lsla
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
366 eora ,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
367 sta ,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
368 lsla
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
369 lsla
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
370 eora ,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
371 sta ,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
372 lsla
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
373 lsla
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
374 lsla
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
375 lsla
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
376 eora ,s+
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
377 bpl L0635
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
378 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
379 eim #$80,,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
380 eim #$21,2,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
381 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
382 ldd #$8021
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
383 eora ,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
384 sta ,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
385 eorb 2,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
386 stb 2,u
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
387 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
388 L0635 rts
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
389
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
390
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
391 **************************************************
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
392 * System Call: F$CRC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
393 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
394 * Function: Compute CRC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
395 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
396 * Input: X = Address to start computation
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
397 * Y = Byte count
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
398 * U = Address of 3 byte CRC accumulator
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
399 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
400 * Output: CRC accumulator is updated
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
401 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
402 * Error: CC = C bit set; B = error code
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
403 *
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
404 FCRC ldd R$Y,u get # bytes to do
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
405 beq L0677 nothing there, so nothing to do, return
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
406 ldx R$X,u get caller's buffer pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
407 pshs d,x save # bytes & buffer pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
408 leas -3,s allocate a 3 byte buffer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
409 ldx <D.Proc point to current process descriptor
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
410 lda P$Task,x get its task number
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
411 ldb <D.SysTsk get the system task number
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
412 ldx R$U,u point to user's 24 bit CRC accumulator
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
413 ldy #3 number of bytes to move
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
414 leau ,s point to our temp buffer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
415 pshs d,x,y save [D]=task #'s,[X]=Buff,[Y]=3
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
416 lbsr L0B2C move CRC accumulator to temp buffer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
417 ldx <D.Proc point to current process descriptor
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
418 leay <P$DATImg,x point to its DAT image
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
419 ldx 11,s restore the buffer pointer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
420 lbsr AdjBlk0 make callers buffer visible
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
421 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
422 ldw 9,s get byte count
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
423 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
424 L065D lbsr LDAXY get byte from callers buffer
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
425 bsr CRCCalc add it to CRC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
426 IFNE H6309
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
427 decw done?
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
428 ELSE
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
429 ldd 9,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
430 subd #$0001
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
431 std 9,s
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
432 ENDC
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
433 bne L065D no, keep going
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
434 puls d,x,y restore pointers
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
435 exg a,b swap around the task numbers
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
436 exg x,u and the pointers
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
437 lbsr L0B2C move accumulator back to user
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
438 leas 7,s clean up stack
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
439 L0677 clrb no error
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
440 rts