; DISK I/O ROUTINES FOR THE ALTAIR FLOPPY DISK DRIVE TO WORK
;    WITH THE MITS PROGRAMMING SYSTEM II.
;
; THIS MODULE IS THE PROM BOOT CODE THAT COPIES THE DISK
;    ROUTINES TO RAM FOR FASTER EXECUTION

	ORG	0F000H		;EXECUTION ADDRESS
	ORR	07BEAH		;RIGHT BEFORE 7C00H

RAMLOC	EQU	7C00H		;DESTINATION FOR CODE
LENGTH	EQU	2E0H

	LXI	H,ROMLOC	;HL->CODE IMAGE IN PROM
	LXI	D,RAMLOC	;DE->WHERE TO PUT CODE IN RAM
	LXI	B,LENGTH	;BC=NUMBER OF BYTES TO MOVE

MOVE:	MOV	A,M		;MOVE FROM PROM TO RAM
	STAX	D
	INX	H		;INCREMENT POINTERS
	INX	D

	DCX	B		;DECREMENT AND TEST COUNT
	MOV	A,B
	ORA	C
	JNZ	MOVE

	JMP	RAMLOC		;ENTER AT BOOT IN RAM

ROMLOC:	DS	1		;AM2 CHOKES ON EQU $ HERE

	END
	EOA
