/ asr33-rim-loader.pal
/
/ Load paper tapes in RIM format from a Teletype Model 33 ASR's paper
/ tape reader.  By contrast with the loader in hs-rim-loader.pal, this
/ is the low-speed paper tape RIM loader.
/
/ This is the RIM loader printed on the front panel of the PDP-8/I.  The
/ RIM loader in hs-rim-loader.pal (which is translated to boot/1.script
/ at build time) is similar to this one, but it works on the DEC high-
/ speed paper tape reader peripheral, which is where the PiDP-8/I's
/ automatic paper tape mounting feature attaches any tape images it
/ finds via USB.
/
/ Therefore, you cannot use this RIM loader if you want to use the
/ PiDP-8/I's automatic media attachment mechanism.  It is included
/ here mainly for documentation at the moment, but also in case
/ someone works out a way to build the simulator so that it can
/ conditionally load tapes from an emulated ASR-33.
/
/ 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 DEC manuals
/ and was printed on the front panel of every PDP-8/I.
/
/ SIMH: echo Installing the RIM loader for the ASR 33 paper tape reader...
/ SIMH: set df disabled

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

	/ normal RIM loader entry point, 7756
NEXT,	KCC		/ clear PTR flag
RBYTE1,	KSF		/ loop until PTR is ready
	JMP RBYTE1
	KRB		/ 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 RBYTE1	/ ...AC contains the addr's value
	RTL		/ ...else rotate it another 2 positions
RBYTE2,	KSF		/ wait for next character
	JMP RBYTE2
	KRS		/ 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 NEXT	/ go round again, getting next value from PTR
BYTE,	0
$
