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