; Bootstrap Loader - loads paper tapes in special bootstrap format; ; used mainly to load the Absolute Loader. ; ; Bootstrap Loader tape format is: ; ; 0351 ; 0351 ; ... Leader ; 0351 ; 0351 ; xxx Load offset (must set the last byte just below the bootloader) ; AAA ; BBB ; CCC ; ... Program to be loaded (up to 0162 words, 0344 bytes) ; XXX ; YYY ; ZZZ Last byte goes in just below the bootstrap loader ; 0301 From here down overlays the bootstrap loader ; 0035 (see below) ; 0026 ; 0000 ; 0302 ; 0025 ; 0373 Modifies the load offset to the offset part of the BR at BRBK ; xxx Jump offset - this modifies the BR to point to the ; start of the code just loaded . = 17744 ; Goes at the very top of available memory; LOAD = 17400 ; Whatever is loaded goes just below it ; (the last bytes of that load will overlay ; the start of this code) ; R1 holds the device address, R2 hold the data load address displacement ; ; The code may be loaded into higher memory provided the base location to ; store the data at (at LDLOC) is updated. ; ; The 351 leader bytes result in the offset (at xxx752) being left ; as it was before; only when a non-351 byte is seen does data start ; being deposited elswhere. ; The end of the program being loaded overlays the start of the bootloader, ; until the last-but-one byte modifies the load offset point to point to ; the byte containing the offset part of the BR at BRBK; that instruction ; is modified by the very last byte of the tape to point to the start of the ; code which was just loaded. 17744 016701 START: MOV DEVICE, R1 ; Get device address 17746 000026 17750 012702 LOOP: MOV (PC)+, R2 ; Get load location offset 17752 000352 LDOFF: .-LOAD 17754 005211 INC @R1 ; Turn reader on 17756 105711 DVWT: TSTB @R1 ; Wait until byte ready 17760 100376 BPL DVWT 17762 116162 MOVB 2(R1), LOAD(R2) ; Store byte 17764 000002 17766 017400 LDLOC: ; Patch here to use elsewhere 17770 005267 INC LDOFF ; Update load offset 17772 177756 17774 000765 BRBK: BR LOOP ; Go get next byte 17776 177560 DEVICE: 177560 ; For serial line