; Dump of M873-YA boot roms ; 23-044A2, 23-045A2 ; Entry point -- RF11 disk 173000 010702 MOV PC, R2 173002 000464 BR DOSIMP 173004 177462 ; RFWC 173006 000005 ; Entry point -- RK11 disk 173010 010702 MOV PC, R2 173012 000460 BR DOSIMP 173014 177406 ; RKWC 173016 000005 ; Entry point -- contents of console switch register 173020 013707 MOV @#177570, PC 173022 177570 ; New PC/PS pair for forced boot in non-volatile memory system ; ; Note that the new PC points off the end of the ROM in the -YA; ; it's not clear that these will actually be used, since in a normal ; power-on the M873 doesn't play with the PS/PC fetch; and in PS/PC ; fetches caused by actuating the BM783 via one of its input lines, ; the data in the PC fetch is specially provided by the card (from ; the address specified by the appropriate diode array) 173024 173776 173026 000340 ; Entry point -- TC11 DECtape 173030 010702 MOV PC, R2 173032 000426 BR DOEXT 173034 177344 ; TCWC 173036 004003 173040 100000 173042 024000 173044 000445 173046 000005 ; Entry point -- TM11 magnetic tape 173050 010702 MOV PC, R2 173052 000416 BR DOEXT 173054 172524 ; TMBC 173056 060017 173060 000200 173062 100000 173064 000413 173066 060011 173070 000200 173072 100000 173074 000431 173076 060003 ; Entry point -- RP11 disk 173100 010702 MOV PC, R2 173102 000424 BR DOSIMP 173104 176716 ; RPWC 173106 000005 ; General extended read routine read routine for more complex devices ; (such as tape drives); called with pointer to word before words ; containing the device register and various commands, results, etc ; in R2 173110 010200 DOEXT: MOV R2, R0 173112 005720 TST (R0)+ 173114 000005 RESET ; ALso clears BAR 173116 005720 TST (R0)+ 173120 016201 MOV 2(R2), R1 ; Get device register 173122 000002 173124 005311 DEC @R1 173126 012041 MOV (R0)+, -(R1) 173130 031011 1$: BIT @R0, @R1 173132 001776 BEQ 1$ 173134 005720 TST (R0)+ 173136 032041 BIT (R0)+, -(R1) 173140 001063 BNE xxx 173142 000110 JMP @R0 ; Entry point -- RC11 disk 173144 010702 MOV PC, R2 173146 000402 BR DOSIMP 173150 177450 173152 000005 ; General read routine read routine for 'simple' devices (such as disk ; drives); called with pointer to word before pair of words containing ; the device's Word Count register and 'Read Go' command in R2 173154 010200 DOSIMP: MOV R2, R0 ; Get command pointer 173156 005720 TST (R0)+ 173160 005720 TST (R0)+ 173162 000005 RESET ; Also clears device BAR 173164 016201 MOV 2(R2), R1 ; Get addr of WC reg 173166 000002 173170 012711 MOV #177000, @R1 ; Set word count 173172 177000 173174 011041 MOV @R0, -(R1) ; Command 173176 105711 1$: TSTB @R1 ; Wait for done 173200 100376 BPL 1$ 173202 005711 TST @R1 ; Check error bit, jump to 173204 100441 BMI xxx ; xxx if set, otherwise 173206 005007 CLR PC ; jump to newly loaded code ; Entry point -- KL11/DL11 serial line; low speed paper tape reader 173210 012704 MOV #177560, R4 ; Low speed reader address 173212 177560 173214 000440 BR RDBOOT ; ?? 173216 017640 173220 002415 173222 112024 ; New power-fail/resume PC/PS pair for boot in volatile memory system ; See comments under PC/PS pair for non-volatile memory, at 173024 173224 173776 173226 000340 ; Entry point -- TA11 casette tape 173230 005004 CLR R4 173232 012700 MOV #177500, R0 173234 177500 173236 000005 RESET 173240 010410 173242 012701 MOV #173216, R1 173244 173216 173246 012702 MOV #375, R2 173250 000375 173252 112103 MOVB (R1)+, R3 173254 112110 MOVB (R1)+, @R0 173256 100407 BMI 1$ 173260 130310 2$: BITB R3, @R0 173262 001776 BEQ 2$ 173264 105202 INCB R2 173266 100772 BMI xx 173270 116012 SUB 2(R0), @R2 173272 000002 173274 000771 BR yy 173276 005710 1$: TST @R0 173300 100756 BMI xx 173302 005002 CLR R2 173304 120312 CMPB R3, @R2 173306 001377 BNE . ; Loop on error? 173310 000112 JMP @R2 ; Entry point -- PC11 high speed paper tape reader 173312 012704 MOV #177550, R4 ; High speed read address 173314 177550 ; Falls through ; Paper tape read routine; first sizes memory, then loads bootstrap ; format tape. ; ; The memory sizing assumes contiguous lower memory; the way it works ; is that the two instruction sequence, setting the SP and then the ; auto-decrement store, will continuously execute (via NXM traps) ; until some memory is found that responds. (Note that the data being ; stored is the device CSR, which by convention is in the high word in ; memory with the bootloader). The code then falls through into ; the code below, which sets up the memory for the incoming program in ; bootstrap format (usually the absolute loader). ; ; That code is extemely 'tense'; the stack location was chosen such ; that, when ANDed with the top of memory (which should be of the form ; xxx776), it produces the location of the load location offset, ; used by bootload format to self-modify the bootloader to i) start ; depositing data, and later ii) to branch to the start of the recently ; loaded code. Here, it is an actual pointer, not an offset, but the ; low byte of it is still modified in the same way, to the same ends. ; ; There is no bootloader here, of course, but this code notices when ; the high byte of the notional 'BR' at the end of the 'bootloader' ; is modified at the end of the bootload process, and finishes creating ; an actual BR there, and jumps to it. ; ; That all won't work properly unless the bootloader format tape has at ; least one 0 pad byte on the end (after the two bytes that, with the ; actual bootloader, over-write the low byte of the BR at the end of the ; bootloader), for two reasons. i) The code above only notices when ; the _high_ byte of the branch is written, which will be by the first ; 0 pad byte; and ii) unless that byte in memory is a zero - and this ; code does not clear memory - the INCB at the end will not create a 'BR' ; instruction there. 173316 000005 RDBOOT: RESET 173320 012701 MOV #160000, R1 ; Start at top of address 173322 160000 ; space, looking for memory 173324 012702 MOV #6, R2 ; Set up NXM vector 173326 000006 173330 012712 MOV #340, @R2 173332 000340 173334 010742 MOV PC, -(R2) ; On fault, go to next inst 173336 012706 MOV #24, SP ; Set up stack at special location; 173340 000024 ; happens to be power fail vector 173342 010441 MOV R4, -(R1) ; Store data 173344 040601 BIC SP, R1 ; Get bootloader load offset 173346 010111 MOV R1, @R1 ; Store it there 173350 011102 2$: MOV @R1, R2 ; Get location to store in 173352 005214 INC @R4 ; Turn reader on 173354 105714 1$: TSTB @R4 ; Wait for next byte to be there 173356 100376 BPL 1$ 173360 116412 MOVB 2(R4), @R2 ; Get byte and save it 173362 000002 173364 005211 INC @R1 ; Increment save location 173366 120227 CMPB R2, #375 ; Did we just finish 173370 000375 ; over-writing the 'BR'? 173372 001366 BNE 2$ ; No, keep going 173374 105222 INCB (R2)+ ; Turn that location into a 'BR' 173376 000142 JMP -(R2) ; And jump to it