2 / This program will receive a RK05 image and write it to the disk. The
3 / entire disk it written, with each sector having a reread check.
5 / This program should be started before the program (PC) sending the data
7 / See dump for the format of the serial data.
8 / To run start at 0200.
9 / SR 9-11 should be drive
10 / Should halt at HLT at label GDHLT (140) with AC = 0 if it worked.
11 / Hit cont to display in AC number of recoverable errors
12 / At normal exit hitting cont again will restart the program
14 / The current location being written to will be displayed in the AC
15 / while running. It is (cylinder * 16 + sector) / 2
24 INAD=400 / Address of serial input, 30 for console
32 OUTAD=410 / Address of serial output, 40 for console
41 ERRCNT, 7760 / Stop when err count = 0, init at startup
42 DRIVE, 0 / Drive # * 2
45 FLD, 10 / Use field 1 for data buffer
51 WRTLOC, 0000 / Address to write data to disk
52 BUFLOC, 0000 / Address to store next word received
53 NUMSEC, 0 / Number of sectors received but not written
54 RDBUF, 1000 / Buffer for reread check
66 DONEFG, 0 / 1 when end of data flag received
67 STATE, 0 / Where in serial data we are 0 = Need ff sector head,
68 / -1 = byte1, ... -3 = byte 3
69 BUFCNT, 0 / Count of words received in sector
85 JMP I RISR / Interrupt handler
88 GDHLT, / HLT / Stop with sum of all words (including -checksum)
93 / HLT / Normal good halt
94 / JMP START / And restart if requested
107 START, CDF 0 / Init all our variables
109 / CLA CLL OSR / Init variables changed during run
111 / AND K6 / Clear out high bits such as 0200 start address
126 FLUSH, KSF2 / Get waiting TTI bytes out of the way.
131 CLA CLL IAC / Set bit 11 to enable interrupts
134 / RPE / PTR Testing, use paper tape with emulator
136 RECAL, CLA CLL IAC / Recal drive, clear errors and set to cyl 0
163 /DCA DSPTRK / Save track for display
166 /TAD DSPTRK / Display write location
167 /AND DSPTRK / Kill time to make brighter
170 IOF / Turn off interrupts so we can safely update
171 CLA / # of sectors in buffer
177 IAC / 1 flags sector to write
178 NODAT, SNA / PHPH no ION if we have still data to write.
181 JMP DOWRT / Got data write it
182 TAD DONEFG / No more data flag?
184 JMP CDAT / No, try again
186 DOWRT, CLA CLL IAC / We have one waiting, write it
206 JMP NOREAD / PHPH Don't want to read back and compare!
207 RDCHK, CLA CLL IAC / And now reread sector
230 CHKDAT, CDF 10 / And now compare
236 HLT / Big trouble, sector is bad without CRC error
243 INCTRK, ISZ TRACK / Increment track and exbit value for next sector
249 CLA CLL CMA / Done, wait for one more word
254 TAD CHKSUM / Get final checksum, receive has added checksum
255 SZA / word to running sum, Halt here if checksum
259 ERROR, ISZ ERRCNT / To many errors?
260 JMP I RECALF / No, recal drive and try again
261 DRST / Yes, leave error in AC and halt
268 DCA ISRFLG / And flags
269 CDF 10 / Buffer in field 1
271 KSF2 / Have character waiting
272 HLT / Stop, not our interrupt
273 / JMP IRET / No, not our interrupt
278 TAD STATE / Find out where in sequence we are
280 JMP SBLK / Start of block
304 DCA STATE / End of sector, set to 0 to check header byte
305 ISZ NUMSEC / Inc number of sectors buffered
310 HLT / To many buffered, halt. Must of had to many
315 IOF / PH Turn off interrupts before one can happen...!!!
351 TAD TEMP / Is is a ff?
359 FLAGOK, STA / -1 for byte 1
361 TAD NBLKSZ / And setup to look for 256 words
365 / OLD ROUTINE, COLD RK05 REBOOT