A large commit.
[pdp8.git] / sw / dumprest / hachti_std / console / console-READR0.PA
1 / RK05 DUMP Program
2 / This program will send a RK05 image out the console port.
3 / The format of the data sent is 0xff (0377) or 0xfd if read error
4 / followed by 256 word of data for each sector.
5 / After the last sector a 0xfe (0376) is sent
6 / with a two byte checksum, low 8 bits first then upper 4.
7 / The words in a sector are sent as three bytes for each 2 words.
8 / 1 = low 8 bits first word
9 / 2 = upper 4 bits first and lower 4 bits second
10 / 3 = upper 8 bits second word
11 /
12 / The program (PC) receiving the data should be started before this program
13 /
14 / To run start at 0200.
15 / The SR should have the drive # is 9-11
16 / Should halt at label finish with number of recoverable errors in AC
17 / At normal exit hitting cont will restart the program
18 / The current location being read will be displayed in the AC
19 / while running. It is (cylinder * 16 + sector) / 2
20
21 / If a unrecoverable error occurs the program will halt with the error in
22 / the AC. Hit continue to dump more or comment out hlt, search for *****.
23 / The PC program will print out the bad location if an error occurs
24
25 DSKP=6741
26 DCLR=6742
27 DLAG=6743
28 DLCA=6744
29 DRST=6745
30 DLDC=6746
31
32 INAD=30 / Address of serial input, 30 for console
33 KCF2=6000 INAD
34 KSF2=6001 INAD
35 KCC2=6002 INAD
36 KRS2=6004 INAD
37 KIE2=6005 INAD
38 KRB2=6006 INAD
39
40 OUTAD=40 / Address of serial output, 40 for console
41 TFL2=6000 OUTAD
42 TSF2=6001 OUTAD
43 TCF2=6002 OUTAD
44 TPC2=6004 OUTAD
45 TSK2=6005 OUTAD
46 TLS2=6006 OUTAD
47
48 *20
49 ERRCNT, 7760 / Stop when err count = 0, init at startup
50 DRIVE, 0 / Drive # * 2
51 ERRCN2, 0 / Total # of errors
52 RETCNT, 200 / Max retries
53 K0200, 0200
54 K4000, 4000
55 FLD, 0
56 TRACK, 0
57 EXBIT, 0
58 CURBUF, 1000 / Address to read data into
59 LSTBUF, 1000 / Address to send data from
60 BUFORG, 1000 / First buffer address
61 BUFSZ, 400
62 MAXTRK, 4537
63 REDDAT, 0000
64 LOC, 0
65 TEMP, 0
66 MASK1, 17
67 MASK2, 360
68 FF, 377
69 FE, 376
70 FD, 375
71 K6, 6
72 CHKSUM, 0
73 DECIMAL
74 BLKSZ, -128
75 OCTAL
76 LEN, 0
77 READST, 377
78 PUNF, PUN
79 SENDF, SEND
80 READF, READ
81
82 *1000
83 1234
84 4321
85
86 *200
87 START, CAF
88 CLA CLL / OSR / Init variables changed during run
89 / RAL
90 / AND K6 / Clear out high bits such as 0200 start address
91 / DCA DRIVE
92 DCA TRACK
93 DCA EXBIT
94 DCA CHKSUM
95 TAD RETCNT
96 CMA
97 DCA ERRCNT
98 DCA ERRCN2
99 JMS RECAL
100
101 DUMP, JMS I READF / Start read operation
102 DMPLP, JMS CHKRD / Wait until done and check for errors
103 JMS INCTRK / Set read loc to next sector
104 SZA
105 JMP LAST / Last, send checksum
106 CLA
107 TAD CURBUF
108 DCA LSTBUF / Save buffer data read into for dumping
109 TAD CURBUF / And setup to read into next buffer
110 TAD BUFSZ
111 AND BUFSZ
112 TAD BUFORG
113 DCA CURBUF
114 JMS I READF / Start the read
115 JMS I SENDF / Send the last buffer
116 JMP DMPLP / And check read started etc
117
118 RECAL, 0
119 CLA CLL IAC / Recal drive, clear errors and set to cyl 0
120 DCLR / From manual
121 TAD DRIVE
122 DLDC
123 CLA CLL CML RTL
124 DCLR
125 DSKP
126 JMP .-1
127 TAD K0200
128 TAD DRIVE
129 DLDC
130 DSKP
131 JMP .-1
132 DRST
133 CIA
134 TAD K4000
135 SZA CLA
136 JMP BADSTA
137 JMP I RECAL
138 /JMP DUMP
139 BADSTA, HLT
140
141 LAST, CLA / Send FE and -checksum of all words
142 TAD CURBUF
143 DCA LSTBUF
144 JMS I SENDF
145 CLA CLL
146 TAD FE
147 JMS I PUNF
148 CLA CLL
149 TAD CHKSUM
150 CIA
151 JMS I PUNF
152 CLA CLL
153 TAD CHKSUM
154 CIA
155 RTL
156 RTL
157 RAL
158 AND MASK1
159 JMS I PUNF
160 CLA
161 TAD ERRCN2 / Leave AC with # of errors
162 FINISH,
163 JMP I XFINI
164 XFINI, FINI
165
166 / HLT / Normal good halt
167 / JMP START / And restart if requested
168
169 / REBOOT FROM RK05
170 BO1, 6743
171 BO2, JMP 31
172
173 CHKRD, 0
174 CLA CLL
175 TAD FF / Set good read flag
176 DCA READST
177 CLA CLL / Display address reading in AC
178 TAD EXBIT
179 RAR
180 TAD TRACK
181 RAR
182 DSKP / Done?
183 JMP .-1
184 DRST / Any errors
185 CIA
186 TAD K4000
187 SZA CLA
188 JMP ERROR
189 TAD RETCNT / Reset error counter for next read
190 CMA
191 DCA ERRCNT
192 JMP I CHKRD
193
194 ERROR, ISZ ERRCN2 / Inc total # of errors
195 ISZ ERRCNT / To many errors?
196 JMP RETRY
197 DRST / Yes, leave error in AC and halt
198 / HLT / ********* Put in to halt on errors
199 JMS RECAL
200 CLA CLL
201 TAD FD / Set bad read flag
202 DCA READST
203 TAD RETCNT / Reset error counter for next read
204 CMA
205 DCA ERRCNT
206 JMP I CHKRD
207 RETRY,
208 JMS RECAL / No, recal drive and try again
209 JMP DUMP /
210
211
212 INCTRK, 0 / Increment track and exbit value for next sector
213 CLA CLL / AC non zero on return if done
214 TAD EXBIT
215 SZA
216 JMP CHKCYL
217 INC2, ISZ TRACK
218 JMP I INCTRK
219 ISZ EXBIT
220 JMP I INCTRK
221 HLT
222 CHKCYL, CLA
223 TAD TRACK
224 CIA
225 TAD MAXTRK
226 SNA
227 JMP FIN
228 CLA
229 JMP INC2
230 FIN, CLA IAC
231 JMP I INCTRK
232
233 PAGE
234 READ, 0
235 CLA CLL IAC / Standard read from manual
236 DCLR
237 TAD CURBUF
238 DLCA
239 TAD DRIVE
240 TAD REDDAT
241 TAD FLD
242 TAD EXBIT
243 DLDC
244 TAD TRACK / Display address reading in AC
245 DLAG
246 JMP I READ
247
248 SEND, 0 / Send data, each sector starts with FF
249 CLA CLL / then 2 12 bit words in 3 bytes
250 TAD LSTBUF
251 DCA LOC
252 TAD BLKSZ
253 DCA LEN
254 CLA CLL
255 TAD READST
256 JMS PUN
257 OUT, CLA CLL
258 TAD I LOC
259 TAD CHKSUM / Keep checksum of all words sent
260 DCA CHKSUM
261 TAD I LOC
262 JMS PUN
263 CLA CLL
264 TAD I LOC
265 RTL / Shift top 4 bits to low 4
266 RTL
267 RAL
268 AND MASK1
269 DCA TEMP
270 ISZ LOC
271 TAD I LOC
272 TAD CHKSUM
273 DCA CHKSUM
274 TAD I LOC
275 RTL
276 RTL
277 AND MASK2
278 TAD TEMP
279 JMS PUN
280 CLA CLL
281 TAD I LOC
282 RTR
283 RTR
284 JMS PUN
285 ISZ LOC
286 ISZ LEN
287 JMP OUT
288 JMP I SEND
289
290 PUN, 0
291 / PLS / Punch for testing with emulator
292 TLS2 / Send out console
293 CLA CLL
294 TAD EXBIT
295 RAR
296 TAD TRACK
297 RAR
298 / PSF
299 TSF2 /Wait until character sent
300 JMP .-1
301 JMP I PUN
302
303 / OLD ROUTINE, COLD RK05 REBOOT
304 /OFINI, CLA
305 / TAD BO1
306 / DCA 30
307 / TAD BO2
308 / DCA 31
309 / CAF
310 / JMP 30
311
312 *7600
313 FINI,
314 HLT
315 JMP I K200
316 K200, 200
317
318 $