238
|
1 ********************************************************************
|
507
|
2 * Boot - Dragon floppy boot module
|
238
|
3 *
|
|
4 * $Id$
|
|
5 *
|
1287
|
6 * Edt/Rev YYYY/MM/DD Modified by
|
|
7 * Comment
|
238
|
8 * ------------------------------------------------------------------
|
1287
|
9 * 1r2 ????/??/??
|
|
10 * Original Dragon Data distribution version
|
238
|
11 *
|
|
12 * $Log$
|
1287
|
13 * Revision 1.3 2003/08/30 20:16:51 boisy
|
|
14 * Made all modules rev 0
|
|
15 *
|
507
|
16 * Revision 1.2 2002/10/10 14:50:21 boisy
|
|
17 * Added appropriate header
|
|
18 *
|
238
|
19 * Revision 1.1 2002/07/18 19:46:07 roug
|
|
20 * We can now build a Dragon 64 kernel
|
|
21 *
|
|
22 * Revision 1.1 2002/04/21 21:27:50 roug
|
|
23 * These are the kernel modules from Dragon 64's OS9Boot.
|
|
24 * OS9 and OS9p2 are older than what's in ../MODULES so I checked them
|
|
25 * in as well.
|
|
26
|
|
27 nam Boot
|
507
|
28 ttl Dragon floppy boot module
|
238
|
29
|
|
30 * Disassembled 02/04/21 22:37:43 by Disasm v1.6 (C) 1988 by RML
|
|
31
|
1287
|
32 IFP1
|
238
|
33 use defsfile
|
1287
|
34 ENDC
|
|
35
|
238
|
36 tylg set Systm+Objct
|
|
37 atrv set ReEnt+rev
|
1287
|
38 rev set $02
|
238
|
39 edition set 1
|
1287
|
40
|
238
|
41 mod eom,name,tylg,atrv,start,size
|
1287
|
42
|
238
|
43 u0000 rmb 2
|
|
44 u0002 rmb 1
|
|
45 u0003 rmb 1
|
|
46 u0004 rmb 1
|
|
47 size equ .
|
1287
|
48
|
|
49 name fcs /Boot/
|
238
|
50 fcb edition
|
|
51
|
|
52 * First, we make a stack...
|
|
53 start clra
|
|
54 ldb #size
|
|
55 MakeStak pshs a
|
|
56 decb
|
|
57 bne MakeStak
|
|
58
|
|
59 tfr s,u
|
|
60 ldx #$FF40
|
|
61 u001F lda #$D0
|
|
62 u0021 sta ,x
|
|
63 u0023 lbsr L0178
|
|
64 lda ,x
|
|
65 lda >$FF22
|
|
66 lda #$FF
|
|
67 sta u0004,u
|
|
68 leax >L0105,pcr
|
|
69 stx >$010A
|
|
70 lda #$7E
|
|
71 sta >$0109
|
|
72 lda #$04
|
|
73 sta >$FF48
|
|
74
|
|
75 * delay loop
|
|
76 u0040 ldd #$C350
|
|
77 L0043 nop
|
|
78 nop
|
|
79 subd #$0001
|
|
80 u0048 bne L0043
|
|
81
|
|
82 pshs u,x,b,a
|
|
83 clra
|
|
84 clrb
|
|
85 ldy #$0001
|
|
86 ldx <u001F+1
|
|
87 ldu <u0021+1
|
|
88 os9 F$SchBit
|
|
89 bcs L009C
|
|
90 exg a,b
|
|
91 ldu $04,s
|
|
92 std u0002,u
|
|
93 clrb
|
|
94 * go get LSN0
|
|
95 ldx #$0000
|
|
96 bsr L00B9
|
|
97 bcs L009C
|
|
98
|
|
99 * get bootfile size from LSN0 and allocate memory for it
|
|
100 ldd <$18,y
|
|
101 std ,s
|
|
102 os9 F$SRqMem
|
|
103 bcs L009C
|
|
104 stu $02,s
|
|
105 ldu $04,s
|
|
106 ldx $02,s
|
|
107 stx u0002,u
|
|
108 ldx <$16,y
|
|
109 ldd <$18,y
|
|
110 beq L0095
|
|
111
|
|
112 * this loop reads a sector at a time from the bootfile
|
|
113 L0083 pshs x,b,a
|
|
114 clrb
|
|
115 bsr L00B9
|
|
116 bcs L009A
|
|
117 puls x,b,a
|
|
118 inc u0002,u
|
|
119 leax $01,x
|
|
120 subd #$0100
|
|
121 bhi L0083
|
|
122 L0095 clrb
|
|
123 puls b,a
|
|
124 bra L009E
|
|
125 L009A leas $04,s
|
|
126 L009C leas $02,s
|
|
127 L009E puls u,x
|
|
128 leas $05,s
|
|
129 rts
|
|
130 L00A3 clr ,u
|
|
131 clr u0004,u
|
|
132 lda #$05
|
|
133 L00A9 ldb #$43
|
|
134 pshs a
|
|
135 bsr L00B6
|
|
136 puls a
|
|
137 deca
|
|
138 bne L00A9
|
|
139 ldb #$03
|
|
140 L00B6 lbra L0164
|
|
141 L00B9 lda #$91
|
|
142 cmpx #$0000
|
|
143 bne L00D1
|
|
144 bsr L00D1
|
|
145 bcs L00C8
|
|
146 ldy u0002,u
|
|
147 clrb
|
|
148 L00C8 rts
|
|
149
|
|
150 L00C9 bcc L00D1
|
|
151 pshs x,b,a
|
|
152 bsr L00A3
|
|
153 puls x,b,a
|
|
154 L00D1 pshs x,b,a
|
|
155 bsr L00DC
|
|
156 puls x,b,a
|
|
157 bcc L00C8
|
|
158 lsra
|
|
159 bne L00C9
|
|
160 L00DC bsr L011B
|
|
161 bcs L00C8
|
|
162 ldx u0002,u
|
|
163 orcc #$50
|
|
164 pshs y,dp,cc
|
|
165 lda #$FF
|
|
166 tfr a,dp
|
|
167 lda #$34
|
|
168 sta <u0003
|
|
169 lda #$37
|
|
170 sta <u0023
|
|
171 lda <u0021+1
|
|
172 ldb #$88
|
|
173 stb <u0040
|
|
174 ldb #$24
|
|
175 stb <u0048
|
|
176 L00FC sync
|
|
177 lda <L0043
|
|
178 ldb <u0021+1
|
|
179 sta ,x+
|
|
180 bra L00FC
|
|
181 L0105 leas $0C,s
|
|
182 lda #$04
|
|
183 sta <u0048
|
|
184 lda #$34
|
|
185 sta <u0023
|
|
186 ldb <u0040
|
|
187 puls y,dp,cc
|
|
188 bitb #$04
|
|
189 beq L015E
|
|
190 L0117 comb
|
|
191 ldb #$F4
|
|
192 rts
|
|
193 L011B clr ,u
|
|
194 tfr x,d
|
|
195 cmpd #$0000
|
|
196 beq L0134
|
|
197 clr ,-s
|
|
198 bra L012B
|
|
199 L0129 inc ,s
|
|
200 L012B subd #$0012
|
|
201 bcc L0129
|
|
202 addb #$12
|
|
203 puls a
|
|
204 L0134 incb
|
|
205 L0135 stb >$FF42
|
|
206 bsr L0178
|
|
207 cmpb >$FF42
|
|
208 bne L0135
|
|
209 ldb u0004,u
|
|
210 stb >$FF41
|
|
211 cmpa u0004,u
|
|
212 beq L015C
|
|
213 sta u0004,u
|
|
214 sta >$FF43
|
|
215 ldb #$13
|
|
216 bsr L0164
|
|
217 pshs x
|
|
218 ldx #$222E
|
|
219 L0156 leax -$01,x
|
|
220 bne L0156
|
|
221 puls x
|
|
222 L015C clrb
|
|
223 rts
|
|
224 L015E bitb #$98
|
|
225 bne L0117
|
|
226 clrb
|
|
227 rts
|
|
228 L0164 bsr L0176
|
|
229 L0166 ldb >$FF40
|
|
230 lsrb
|
|
231 bcs L0166
|
|
232 rts
|
|
233 L016D lda #$04
|
|
234 sta >$FF48
|
|
235 stb >$FF40
|
|
236 rts
|
|
237 L0176 bsr L016D
|
|
238 L0178 lbsr L017B
|
|
239 L017B lbsr L017E
|
|
240 L017E rts
|
1287
|
241
|
238
|
242 emod
|
|
243 eom equ *
|
1287
|
244 end
|