;*************************************************************************
;
;  Quick binary file loader for the Altair 88-2SIO
;
;  	Using the front panel or a ROM monitor, enter the bytes of this
;	program into memory at address zero. Run the program from
;	address zero and then send the file PC2FLOP.COM (8-bit binary)
;	through the serial port. Nothing is displayed while the file
;	loads. After the file transfer is complete, reset the machine
;	and run PC2FLOP from address 0100h.
;
;************************************************************************
sio1Ctl	equ	010h		;1st port on 2SIO board
sio1Dat	equ	011h
sioRst	equ	003h		;code to reset the ACIA
sio8N1	equ	015h		;select 8N1

loadAdr	equ	0100h		;address of program being loaded

	org	0

	mvi	a,sioRst	;reset 2SIO port 1
	out	sio1Ctl
	mvi	a,sio8N1	;set for 8N1
	out	sio1Ctl	
	lxi	h,loadAdr	;hl->starting address for program
loop	in	sio1Ctl		;wait for a character
	rrc
	jnc	loop
	in	sio1Dat		;get the character
	mov	m,a		;store it
	inx	h		;move to next location
	jmp	loop

	end
