;Read block from EEPROM - starting with the address
;contained in Index Z to a RAM area adressed by the index register X 
;the size of block is passed in R17

Block_read:
	RCALL	EEread
	ST	X+,R16
	ADIW	ZH:ZL,1
	DEC	R17
	BRNE	Block_read
	RET
	
EERead:			
	SBIC	EECR,EEWE	
	RJMP	EERead	
	OUT	EEARH,ZH	
	OUT	EEARL,ZL	
	LDI	R16,$01		
	OUT	EECR, R16	
	IN	R16,EEDR	
	RET		

