/ hs-rim-loader.pal
/
/ Load paper tapes in RIM format from the DEC high-speed PTR.
/
/ This routine differs from that printed in DEC's manuals in that it
/ starts with a HLT instruction so that when you [re]start SIMH with
/ IF=1, running this program, the processor auto-halts, giving the user
/ the opportunity to attach a paper tape via DF or ATTACH, then start
/ the processor at 7756 as normal.
/
/ The RIM loader code printed on the front panel of the PDP-8/I differs
/ because it is for the the paper tape reader built into a Teletype
/ Model 33 ASR.  See asr33-rim-loader.pal for that other implementation,
/ including more information about it.
/
/ Raw disassembly done from the octal values by Bernhard Baehr's PDP-8/E
/ Simulator.  Comments and labels by Warren Young.  Original copyright
/ by Digital Equipment Corporation: this program appeared in many DEC
/ manuals printed throughout the PDP-8 era variants of which were made
/ (and thus documented) from 1965 to 1979.
/
/ SIMH: echo Installing the RIM loader for the DEC high-speed tape reader...
/ SIMH: set df disabled
/ SIMH: set cpu noidle

	*7755
	HLT		/ nonstandard: auto-halt on SIMH startup

	/ normal RIM loader entry point, 7756
	RFC		/ clear PTR flag
RBYTE1,	RSF		/ loop until PTR is ready
	JMP RBYTE1
	RCC		/ read first byte in
	CLL RTL		/ shift it left by 2, clearing link as well
	RTL		/ and 2 more again
	SPA		/ if top bit of AC is set...
	JMP GOTVAL	/ ...AC contains the addr's value
	RTL		/ ...else rotate it another 2 positions
RBYTE2,	RSF		/ wait for next character
	JMP RBYTE2
	RCC		/ read second byte in
	SNL		/ if link is set...
	DCA I BYTE	/ ...it's the value's address
GOTVAL,	DCA BYTE	/ ...else it's the value at that addr
	JMP RBYTE1	/ go round again, getting next value from PTR
BYTE,	0
$
