;-----------------------------------
;File: 8052.def - To define the IOs
;-----------------------------------
;I/O Addressing
;Inputs
I1_8		xdata 01000h	
I9_16		xdata 00800h	
I17_24		xdata 00400h	

;Outputs
O1_8		xdata 08000h	
O9_16		xdata 04000h	
O17_24		xdata 02000h		

;Watchdog
;WMCON Watchdog & Memory Control  AT89S8252 only Load to B
WDTEN	bit	B.0	;Watchdog timer enable = 1
WDTRST	bit	B.1	;Watchdog reset and EEPROM rdy/bsy flag.
DPS	bit	B.2	;Data pointer register select
EEMEN	bit	B.3	;Internal EEPROM access enable = 1 MOVX instruction

EEMWE	bit	B.4	;EEPROM data memory write
PS0	bit	B.5	;Prescaler for watchdog timer
PS1	bit	B.6	;Prescaler for watchdog timer
PS2	bit 	B.7	;Prescaler for watchdog timer

Inputs1_8	data 0x2a  	;8 direct inputs bit to process 1-8
Inputs9_16	data 02bh       ;8 direct inputs bit to process 9-16
Inputs17_24	data 02ch       ;8 direct inputs bit to process 17-24
;------------------------------------------
; File: IOs.h - to read I/P and turn on O/P
;------------------------------------------
	mov	B,WMCON
	clr	EEMEN		;Disable EEPROM read
	mov	WMCON,B		;and save

	mov 	DPTR,#I1_8	;Read inputs and save to bit addressed area.
	movx 	A,@DPTR
	mov 	Inputs1_8,A	
	nop
	nop

	mov	DPTR,#I9_16
	movx 	A,@DPTR
	mov 	Inputs9_16,A
	nop
	nop

	mov	DPTR,#I17_24
	movx 	A,@DPTR
	mov 	Inputs17_24,A
	nop	
	nop

	mov	B,WMCON
	setb	EEMEN		;Enable EEPROM read
	mov	WMCON,B		;and save
