;*****************************************************************************
;
;	Write Internal P89LPC938 EEPROM byte
;	Data byte in Acc.
;	Start address bit 8 in r6, address bits 0-7 in r7
;	r6,r7 incremented by routine
;
;
WriteIntEEPROM:
	push	acc		;save data byte
	mov	DEECON,r6	;eeprom address (xxxxxxx8)
	mov	DEEDAT,a	
	mov	DEEADR,r7	;eeprom address (7:0)
WMc:	mov	a,DEECON
	jnb	acc.7,WMc	;poll for "EE write done"
	inc	r7
	mov	a,r7		;DEBUG next 3 statements NEEDED?
	jnz	WMx
	mov	r6,#1
WMx:	pop	acc
	ret
;
;
;****************************************************************************
;