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