annotate 3rdparty/drivers/flash/flashpak.asm @ 1366:770c350f4c15

More changes
author boisy
date Fri, 26 Sep 2003 12:43:30 +0000
parents 25aa4b22ade4
children
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 * FlashPak - FLASH Pak device driver based on Disto's RAM Pak driver
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 * Copyright 2001 by Agesino Primatic, Jr.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * Free for any use as long as this copyright message is included.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
9 * ------------------------------------------------------------------
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10 * 1 Original version by A. Primatic AP 01/04/05
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 nam FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14 ttl FLASH Pak device driver
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 tylg set Drivr+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 rev set $01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 edition set 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 * RBF Data Area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 rmb 129
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 * Free for driver use
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 ORGSlot rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 BlkAdr rmb 2 address of our 16K block of memory
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 CurPD rmb 2 our current path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 CurLSN rmb 2 our current LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 FOffset equ 0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 FLSNLo equ 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 FLSNHi equ 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 FData equ 3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 fcb $FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 name fcs /FlashPak/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 start lbra Init
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 lbra Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56 lbra Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 lbra GetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 lbra SetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 lbra Term
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 * Init
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 * Y = address of device descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 Init ldd #($FF*256)+3 this driver can handle 3 "disks"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 stb V.NDRV,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74 leax DRVBEG,u start at beginning of drive table of disk 0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 * For each B, compute total sectors...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 InitLp sta V.TRAK,x initialize to 0xff so first seek gets LSN0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 lda IT.CYL+1,y compute total sectors
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 ldb IT.SCT+1,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 mul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 std DD.TOT+1,x fill in table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 puls b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 leax DRVMEM,x move to drive table of next disk
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 bne InitLp
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 * Reserve 16K of memory for sector copies
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 ldd #$4000 request 16K bytes
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 pshs u save address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 os9 F$SRqMem Request System Memory
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 tfr u,x X = starting address of memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 puls u restore address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 bcs InitErr branch if error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 stx BlkAdr,u store starting address
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 clrb no errors here
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 InitErr rts all done with intialization
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 * Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 * B = MSB of the disk's LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 * X = LSW of the disk's LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 Write pshs cc save carry flags (including interrupt enable)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 * orcc #IntMasks mask interrupts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 lbsr SelSlot get to the proper MPI slot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 stx CurLSN,u save LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 tfr x,d now, D = LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 ldx PD.BUF,y get address of path buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 sty CurPD,u save path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 ldy V.PORT,u get base address of FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 sta FLSNHi,y write LSN hi byte to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 stb FLSNLo,y write LSN lo byte to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 clrb set up for 256 transfers
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 * First, we need to see if a write would work
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 WrLp1 stb FOffset,y write offset to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 lda ,x get what we want to write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 coma data on flash is stored complemented
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 * nop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 anda FData,y logical-and with data from FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 coma get back uncomplemented version
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 * nop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 cmpa ,x+ does result match with what we want to write?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 bne WrErase if no, then we need to erase sector
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 incb go to next word
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 bne WrLp1 branch if not done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 * At this point, write can proceed
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 ldx CurPD,u get back path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 ldx PD.BUF,x get address of the path buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 ldy V.PORT,u get base address of FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 bsr WrBlock write 256-byte block
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 WrExit lbra RstSlot restore MPI slot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 * WrBlock -- copies 256 bytes from memory to flash
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 * B = Offset into flash
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 * X = Address of first memory location
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 * CurLSN,u = current LSN (for WrByte)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 * X = Address of next memory location
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 * Destroys:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 * A, B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 WrBlock clrb start at offset of 0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170 pshs b push offset (of 0) on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 WrLoop lda ,x+ get data from buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174 bsr WrByte write that byte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 bcs WrBlkDn if there was an error, break out
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178 inc ,s increment offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179 ldb ,s get new offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180 bne WrLoop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
182
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183 WrBlkDn leas 1,s remove offset from stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
184 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
185
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 * WrByte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 * A = Byte to write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
191 * B = Offset to write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
192 * Y = base address of FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
193 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 * CurLSN,u = current LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
196 * Destroys:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
197 * B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
198 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199 WrByte pshs d,x save d and x for later
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
200 bsr DoAA55
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
201
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
202
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
203 ldx #$55 flash[0x5555] = 0xa0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 ldd #$a055
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
205 bsr XfrByte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 puls d flash[addr] = ~data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 coma data on flash is complemented
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210 * nop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 ldx CurLSN,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212 bsr XfrByte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
213
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 pshs a save byte that was written on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218 * Now, loop until done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
219 WrBWait ldb FData,y get flash data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 cmpb ,s does it match?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 beq WrBDone if yes, write passed
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
222
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
223
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 bitb #$20 did we exceed the time limit?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
225 beq WrBWait if no, try again
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
226
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
227
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228 * We exceed time limit -- try one more time
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
229 ldb FData,y get flash data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
230 cmpb ,s does it match?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 beq WrBDone whew! just made it
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
233
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 * Write Failure
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
235 lbsr RstFlsh reset flash to read mode
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 comb set carry flag
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 ldb #E$Write set error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 bra WrBExit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
239
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 WrBDone clrb no error here
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
242
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
243
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 WrBExit puls a,x restore stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
245 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
246
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
247
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
248 * XfrByte -- transfers one byte to flash
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
249 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
250 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251 * A = Byte to transfer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 * B = Offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253 * X = LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
254 * Y = base address of FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
255 XfrByte exg d,x get LSN into D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
256 sta FLSNHi,y write LSN hi byte to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
257 stb FLSNLo,y write LSN lo byte to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
258 exg d,x get byte/offset into D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
259 stb FOffset,y write offset to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
260 sta Fdata,y write data to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
261 rts all done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
263
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
264 * DoAA55 Sends 0x5555=0xaa, then 0xaaaa=0x55 to flash
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 DoAA55 ldx #$55 flash[0x5555] = 0xaa
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 ldd #$aa55
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 bsr XfrByte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
268
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
269
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270 ldx #$2a flash[0x2aaa] = 0x55
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
271 ldd #$55aa
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
272 bra XfrByte will also return
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
273
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
274
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
275 * WrErase
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
276 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
277 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
278 * Y = base address of FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
279 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
280 * CurLSN,u = current LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
281 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
282 * First, we need to read the entire sector into BlkAdr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
283 WrErase ldx BlkAdr,u Get start of BlkAddr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
284 ldd CurLSN,u Get current LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
285 sta FLSNHi,y write LSN hi byte to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
286 andb #$C0 Get to first LSN of this sector
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
287
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
288
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
289 WrErLp1 stb FLSNLo,y write LSN lo byte to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
290 pshs b save LSN_lsb on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
291 lbsr RdBlock transfer 256 bytes from flash to memory
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
292 puls b get back LSN_lsb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
293 incb go to next LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
294 bitb #$3f are we done?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
295 bne WrErLp1 if no, go back for some more
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
296
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
297
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
298 * Now, we have the entire sector copied into memory
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
299 * Replace the old LSN with the new one
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
300 ldx BlkAdr,u get start of BlkAddr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
301 ldd CurLSN,u get current LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
302 exg a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
303 anda #$3f find offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
304 clrb start at beginning of LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
305 leax d,x move to LSN in memory
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
306 ldy CurPD,u get back path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
307 ldy PD.BUF,y get address of path buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
308
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
309
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
310 WrErLp2 lda ,y+ get byte from path buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
311 sta ,x+ put byte into BlkMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
312 incb move to next byte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
313 bne WrErLp2 branch if not done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
314
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
315
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
316 * Now, we have the entire sector with the new LSN in memory
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
317 * Erase sector
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
318 ldy V.PORT,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
319 bsr DoAA55
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
320
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
321
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
322 ldx #$55 flash[0x5555] = 0x80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
323 ldd #$8055
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
324 bsr XfrByte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
325
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
326
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
327 bsr DoAA55
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
328
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
329
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
330 ldd CurLSN,u flash[SectAddr] = 0x30
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
331 andb #$C0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
332 tfr d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
333 ldd #$3000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
334 bsr XfrByte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
335
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
336
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
337 * Now, loop until done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
338 WrEWait ldb FData,y get flash data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
339 bmi WrEDone if DQ7 is set, then we're done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
340
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
341
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
342 bitb #$20 did we exceed the time limit?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
343 bne WrETime if yes, go on
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
344
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
345
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
346 * Sleep for 250ms
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
347 ldx #15 15 * 1/60 = 250ms
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
348 os9 F$Sleep
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
349 bra WrEWait go back for more
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
350
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
351
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
352 * We exceeded the time limit -- try one more time
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
353 WrETime ldb FData,y get flash data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
354 bmi WrEDone whew! just made it
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
355
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
356
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
357 * Erase Failure
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
358 bsr RstFlsh reset flash to read mode
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
359 comb set carry flag
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
360 ldb #E$Write set error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
361 bra WrEExit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
362
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
363
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
364 * Finally, we need to write the sector back
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
365 WrEDone ldx BlkAdr,u get pointer to memory version of sector
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
366 ldy V.PORT,u get base address of FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
367 ldd CurLSN,u get current LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
368 andb #$C0 get to beginning of sector
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
369 pshs b push LSN_lsb on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
370
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
371
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
372 WrErLp3 stb CurLSN+1,u write new LSN lsb to CurLSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
373 lbsr WrBlock transfer 256 bytes from memory to flash
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
374 bcs WrEExit branch if error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
375
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
376
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
377 inc ,s go to next LSB_lsb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
378 ldb ,s get back LSN_lsb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
379 bitb #$3f are we done?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
380 bne WrErLp3 if no, go back for some more
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
381
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
382
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
383 clrb no error here
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
384
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
385
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
386 WrEExit leas 1,s remove LSN_lsb from stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
387 bra RstSlot will also return
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
388
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
389
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
390 * RstFlash -- Resets flash to read mode
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
391 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
392 RstFlsh lbsr DoAA55
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
393
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
394
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
395 ldx #$55 flash[0x5555] = 0xf0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
396 ldd #$f055
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
397 lbra XfrByte will also return
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
398
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
399
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
400 * Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
401 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
402 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
403 * B = MSB of the disk's LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
404 * X = LSW of the disk's LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
405 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
406 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
407 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
408 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
409 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
410 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
411 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
412 Read cmpx #$0000 check to see if we're reading LSN0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
413 beq RdLSN0 if we are, do special read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
414
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
415
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
416 RdSect pshs cc save flags (including interrupt enable)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
417 * orcc #IntMasks mask interrupts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
418 bsr SelSlot select the proper MPI slot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
419 tfr x,d now, D = LSN_lsw
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
420 ldx PD.BUF,y get address of the path buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
421 ldy V.PORT,u get base address of FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
422 sta FLSNHi,y write LSN hi byte to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
423 stb FLSNLo,y write LSN lo byte to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
424 bsr RdBlock go get the 256-byte block
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
425
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
426
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
427 * Restore the original MPI slot value we saved off
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
428 RstSlot lda >ORGSlot,u get original slot value
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
429 sta >MPI.Slct put it back
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
430 puls cc get back flags (including interrupt enable)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
431 clrb no errors
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
432 rts we're done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
433
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
434
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
435 * RdBlock -- copies 256 bytes from flash to memory
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
436 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
437 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
438 * B = Offset into flash
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
439 * X = Address of first memory location
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
440 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
441 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
442 * X = Address of next memory location
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
443 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
444 * Destroys:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
445 * A, B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
446 RdBlock clrb will do this 256 times
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
447
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
448
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
449 RdLoop stb FOffset,y write offset to FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
450 lda FData,y get data from FlashPak
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
451 coma data on flash is stored complemented
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
452 * nop
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
453 sta ,x+ write it into buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
454 incb go to next word
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
455 bne RdLoop branch if not done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
456
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
457
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
458 rts all done with RdBlock
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
459
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
460
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
461 * Read LSN0 into our path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
462 RdLSN0 pshs y save address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
463 bsr RdSect go get the sector
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
464 puls y restore address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
465 ldx PD.BUF,y get address of the path buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
466 lda <PD.DRV,y get drive number
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
467 leay DRVBEG,u get address of beginning of drive table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
468 ldb #DRVMEM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
469 mul now, D = offset into table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
470 leay d,y get address of byte following drive table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
471 ldb #DD.SIZ-1 get size of device descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
472
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
473
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
474 * Copy LSN0 device descriptor to drive table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
475 LSN0Lp lda b,x get byte from path buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
476 sta b,y store byte in drive table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
477 decb move to previous entry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
478 bne LSN0Lp loop if not done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
479
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
480
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
481 rts all done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
482
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
483
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
484 * SelSlot - This routine selects the MPI slot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
485 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
486 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
487 * None
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
488 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
489 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
490 * None
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
491 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
492 * Destroys:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
493 * A, B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
494 SelSlot lda >MPI.Slct get current selected slot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
495 sta >ORGSlot,u save off
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
496 lda PD.DRV,y get drive no.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
497 ldb #$11
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
498 mul multiply drive no. times $11
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
499 stb >MPI.Slct set new MPI slot no.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
500 rts all done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
501
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
502
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
503 * GetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
504 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
505 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
506 * A = function code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
507 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
508 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
509 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
510 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
511 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
512 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
513 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
514 GetStat comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
515 ldb #E$UnkSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
516 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
517
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
518
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
519 SetStat clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
520 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
521
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
522
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
523 * Term
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
524 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
525 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
526 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
527 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
528 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
529 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
530 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
531 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
532 Term
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
533 ldu BlkAdr,u release 16384-byte block
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
534 ldd #$2000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
535 os9 F$SRtMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
536 bcs TermErr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
537
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
538
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
539 clrb no errors here
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
540
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
541
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
542 TermErr rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
543
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
544
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
545 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
546 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
547 end