A large commit.
[pdp8.git] / sw / dumprest / original / dumprk05.pal
CommitLineData
81e70d48
PH
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=030 / 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=040 / 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
49ERRCNT, 7760 / Stop when err count = 0, init at startup
50DRIVE, 0 / Drive # * 2
51ERRCN2, 0 / Total # of errors
52RETCNT, 200 / Max retries
53K0200, 0200
54K4000, 4000
55FLD, 0
56TRACK, 0
57EXBIT, 0
58CURBUF, 1000 / Address to read data into
59LSTBUF, 1000 / Address to send data from
60BUFORG, 1000 / First buffer address
61BUFSZ, 400
62MAXTRK, 4537
63REDDAT, 0000
64LOC, 0
65TEMP, 0
66MASK1, 17
67MASK2, 360
68FF, 377
69FE, 376
70FD, 375
71K6, 6
72CHKSUM, 0
73 DECIMAL
74BLKSZ, -128
75 OCTAL
76LEN, 0
77READST, 377
78PUNF, PUN
79SENDF, SEND
80READF, READ
81
82 *1000
83 1234
84 4321
85
86 *200
87START, 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
101DUMP, JMS I READF / Start read operation
102DMPLP, 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
118RECAL, 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
139BADSTA, HLT
140
141LAST, 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
162FINISH, HLT / Normal good halt
163 JMP START
164
165CHKRD, 0
166 CLA CLL
167 TAD FF / Set good read flag
168 DCA READST
169 CLA CLL / Display address reading in AC
170 TAD EXBIT
171 RAR
172 TAD TRACK
173 RAR
174 DSKP / Done?
175 JMP .-1
176 DRST / Any errors
177 CIA
178 TAD K4000
179 SZA CLA
180 JMP ERROR
181 TAD RETCNT / Reset error counter for next read
182 CMA
183 DCA ERRCNT
184 JMP I CHKRD
185
186ERROR, ISZ ERRCN2 / Inc total # of errors
187 ISZ ERRCNT / To many errors?
188 JMP RETRY
189 DRST / Yes, leave error in AC and halt
190/ HLT / ********* Put in to halt on errors
191 JMS RECAL
192 CLA CLL
193 TAD FD / Set bad read flag
194 DCA READST
195 TAD RETCNT / Reset error counter for next read
196 CMA
197 DCA ERRCNT
198 JMP I CHKRD
199RETRY,
200 JMS RECAL / No, recal drive and try again
201 JMP DUMP /
202
203
204INCTRK, 0 / Increment track and exbit value for next sector
205 CLA CLL / AC non zero on return if done
206 TAD EXBIT
207 SZA
208 JMP CHKCYL
209INC2, ISZ TRACK
210 JMP I INCTRK
211 ISZ EXBIT
212 JMP I INCTRK
213 HLT
214CHKCYL, CLA
215 TAD TRACK
216 CIA
217 TAD MAXTRK
218 SNA
219 JMP FIN
220 CLA
221 JMP INC2
222FIN, CLA IAC
223 JMP I INCTRK
224
225 PAGE
226READ, 0
227 CLA CLL IAC / Standard read from manual
228 DCLR
229 TAD CURBUF
230 DLCA
231 TAD DRIVE
232 TAD REDDAT
233 TAD FLD
234 TAD EXBIT
235 DLDC
236 TAD TRACK / Display address reading in AC
237 DLAG
238 JMP I READ
239
240SEND, 0 / Send data, each sector starts with FF
241 CLA CLL / then 2 12 bit words in 3 bytes
242 TAD LSTBUF
243 DCA LOC
244 TAD BLKSZ
245 DCA LEN
246 CLA CLL
247 TAD READST
248 JMS PUN
249OUT, CLA CLL
250 TAD I LOC
251 TAD CHKSUM / Keep checksum of all words sent
252 DCA CHKSUM
253 TAD I LOC
254 JMS PUN
255 CLA CLL
256 TAD I LOC
257 RTL / Shift top 4 bits to low 4
258 RTL
259 RAL
260 AND MASK1
261 DCA TEMP
262 ISZ LOC
263 TAD I LOC
264 TAD CHKSUM
265 DCA CHKSUM
266 TAD I LOC
267 RTL
268 RTL
269 AND MASK2
270 TAD TEMP
271 JMS PUN
272 CLA CLL
273 TAD I LOC
274 RTR
275 RTR
276 JMS PUN
277 ISZ LOC
278 ISZ LEN
279 JMP OUT
280 JMP I SEND
281
282PUN, 0
283/ PLS / Punch for testing with emulator
284 TLS2 / Send out console
285 CLA CLL
286 TAD EXBIT
287 RAR
288 TAD TRACK
289 RAR
290/ PSF
291 TSF2 /Wait until character sent
292 JMP .-1
293 JMP I PUN
294
295 $