;Minimal boot loader for system with ROM v. 6 and lower.
;Enter bytes on input port switches using Program_loader.
;Includes port initialization commands.
;When runs, will load 256 bytes from serial port into memory at 0900h and jump there.
			org	0800h			;org not necessary, all jumps relative
			ld 	a,04eh			;1 stop bit, no parity, 8-bit char, 16x baud
			out 	(3),a			;write to control port
			ld 	a,037h			;enable receive and transmit
			out 	(3),a			;write to control port
			ld	hl,0900h		;where to put received code
			ld	b,0ffh			;number of bytes to receive
boot_receive_loop:	in	a,(3)			;get status
			and	002h			;check Rx ready bit
			jr	z,boot_receive_loop	;not ready, loop
			in	a,(2)			;ready, get byte
			ld	(hl),a			;store in memory
			inc	hl			;point to next location
			djnz	boot_receive_loop	;keep going
			jp	0900h			;done, jump to received code block