

L 	EQU 	000H

H 	EQU 	001H

R 	EQU 	002H

Z 	EQU 	003H

Y 	EQU 	004H

X 	EQU 	005H

PFLAG 	EQU 	006H
	Z 	EQU  	PFLAG.0
	DC 	EQU  	PFLAG.1
	C 	EQU  	PFLAG.2
	PD 	EQU  	PFLAG.6
	TO 	EQU  	PFLAG.7

RBANK 	EQU 	007H
	RBANKS0 	EQU  	RBANK.0

W0 	EQU 	008H

W1 	EQU 	009H

W2 	EQU 	00AH

W3 	EQU 	00BH

W4 	EQU 	00CH

W5 	EQU 	00DH

W6 	EQU 	00EH

W7 	EQU 	00FH

PCL 	EQU 	013H

PCH 	EQU 	014H

OSCM 	EQU 	015H
	STPHX 	EQU  	OSCM.1
	CLKMD 	EQU  	OSCM.2
	CPUM0 	EQU  	OSCM.3
	CPUM1 	EQU  	OSCM.4
	XTSEL 	EQU  	OSCM.5

WDTR 	EQU 	016H

INTRQ0 	EQU 	017H
	INT0IF 	EQU  	INTRQ0.0
	INT1IF 	EQU  	INTRQ0.1
	INT2IF 	EQU  	INTRQ0.2
	T1IF 	EQU  	INTRQ0.4
	TC0IF 	EQU  	INTRQ0.5
	T2IF 	EQU  	INTRQ0.6

INTRQ1 	EQU 	018H
	TC3IF 	EQU  	INTRQ1.0
	I2CIF 	EQU  	INTRQ1.6

INTEN0 	EQU 	019H
	INT0IE 	EQU  	INTEN0.0
	INT1IE 	EQU  	INTEN0.1
	INT2IE 	EQU  	INTEN0.2
	T1IE 	EQU  	INTEN0.4
	TC0IE 	EQU  	INTEN0.5
	T2IE 	EQU  	INTEN0.6

INTEN1 	EQU 	019H
	TC3IE 	EQU  	INTEN1.0
	I2CIE 	EQU  	INTEN1.6

P0W 	EQU 	01BH

P1W 	EQU 	01CH

P2W 	EQU 	01DH

P4W 	EQU 	01EH

PEDGE 	EQU 	01FH
	PG0 	EQU  	PEDGE.0
	PG1 	EQU  	PEDGE.1

P0M0 	EQU 	020H

P1M0 	EQU 	021H

P2M0 	EQU 	022H

P4M0 	EQU 	023H

P0 	EQU 	025H

P1 	EQU 	026H

P2 	EQU 	027H

P4 	EQU 	028H

P0UR 	EQU 	02AH

P1UR 	EQU 	02BH

P2UR 	EQU 	02CH

P4UR 	EQU 	02DH

REMCON 	EQU 	02FH
	REM_SEL0 	EQU  	REMCON.0
	REM_SEL1 	EQU  	REMCON.1
	REM_SEL2 	EQU  	REMCON.2
	REM_SEL3 	EQU  	REMCON.3
	REM_SEL4 	EQU  	REMCON.4
	ELE_EN 	EQU  	REMCON.5
	D_SEL 	EQU  	REMCON.6
	IE_SEL 	EQU  	REMCON.7

LCD_CT0 	EQU 	030H
	SCANSEL 	EQU  	LCD_CT0.0
	LCDPR 	EQU  	LCD_CT0.2
	DUTY0 	EQU  	LCD_CT0.4
	DUTY1 	EQU  	LCD_CT0.5
	PUMPEN 	EQU  	LCD_CT0.6
	LCDEN 	EQU  	LCD_CT0.7

LCD_DB 	EQU 	031H

LCD_ADDR 	EQU 	032H

LCD_CT2 	EQU 	034H
	COMSX0 	EQU  	LCD_CT2.0
	COMSX1 	EQU  	LCD_CT2.1
	COMSX4 	EQU  	LCD_CT2.4

T1M0 	EQU 	035H
	TCOGN 	EQU  	T1M0.0
	TC3GN 	EQU  	T1M0.1
	T1CK 	EQU  	T1M0.2
	TP1SEL 	EQU  	T1M0.3
	TP1S0 	EQU  	T1M0.4
	TP1S1 	EQU  	T1M0.5
	TP1S2 	EQU  	T1M0.6
	TR1 	EQU  	T1M0.7

TC1L 	EQU 	036H

TC1H 	EQU 	037H

TC0M 	EQU 	038H
	PWM0EN 	EQU  	TC0M.0
	RLOAD 	EQU  	TC0M.1
	TC0I2 	EQU  	TC0M.2
	TC0I1 	EQU  	TC0M.3
	TC0S0 	EQU  	TC0M.4
	TC0S1 	EQU  	TC0M.5
	TC0S2 	EQU  	TC0M.6
	TCOTR 	EQU  	TC0M.7

TC0C 	EQU 	039H

TC0R 	EQU 	03AH

TC0D 	EQU 	03BH

TC0M1 	EQU 	03CH
	PWM1EN 	EQU  	TC0M1.0
	PWM2EN 	EQU  	TC0M1.1
	TC0M12 	EQU  	TC0M1.2
	TC0M13 	EQU  	TC0M1.3

TC0D1 	EQU 	03DH

TC0D2 	EQU 	03EH

P0SS 	EQU 	040H

P1SS 	EQU 	041H

P2SS 	EQU 	042H

P4SS 	EQU 	043H

LCD_CT3 	EQU 	044H
	SCANPON0 	EQU  	LCD_CT3.0
	SCANPON1 	EQU  	LCD_CT3.1
	SCANPON2 	EQU  	LCD_CT3.2
	SCANPON3 	EQU  	LCD_CT3.3
	LCDCLKS0 	EQU  	LCD_CT3.6
	LCDCLKS1 	EQU  	LCD_CT3.7

PICON 	EQU 	045H
	PICON0 	EQU  	PICON.0
	PICON1 	EQU  	PICON.1
	PICON2 	EQU  	PICON.2
	PICON4 	EQU  	PICON.4
	PICON5 	EQU  	PICON.5
	PICON7 	EQU  	PICON.7

PCTRL 	EQU 	046H
	PCTRL7 	EQU  	PCTRL.7

WDTRCON 	EQU 	04CH
	WDT_PRE0 	EQU  	WDTRCON.4
	WDT_PRE1 	EQU  	WDTRCON.5
	WDT_PRE1 	EQU  	WDTRCON.6
	WDT_EN 	EQU  	WDTRCON.7

LEDCT0 	EQU 	04DH
	LEDPCON 	EQU  	LEDCT0.5
	LEDODEN 	EQU  	LEDCT0.6
	LEDEN 	EQU  	LEDCT0.7

LVDCON 	EQU 	04FH
	LVD18 	EQU  	LVDCON.0
	LVD2X 	EQU  	LVDCON.1
	LVDS0 	EQU  	LVDCON.3
	LVDS1 	EQU  	LVDCON.4
	REM_SEL5 	EQU  	LVDCON.5
	REM_SEL6 	EQU  	LVDCON.6
	REM_SEL7 	EQU  	LVDCON.7

P0SD 	EQU 	050H

P1SD 	EQU 	051H

P2SD 	EQU 	052H

P4SD 	EQU 	053H

TC3M 	EQU 	055H
	PWMX0EN 	EQU  	TC3M.0
	RLOADX 	EQU  	TC3M.1
	TC3SEL 	EQU  	TC3M.2
	TC3I1 	EQU  	TC3M.3
	TC3S0 	EQU  	TC3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 	06FH
	STKPB0 	EQU  	STKP.0
	STKPB1 	EQU  	STKP.1
	STKPB2 	EQU  	STKP.2
	GIE 	EQU  	STKP.7

STK7L 	EQU 	070H

STK7H 	EQU 	071H

STK6L 	EQU 	072H

STK6H 	EQU 	073H

STK5L 	EQU 	074H

STK5H 	EQU 	075H

STK4L 	EQU 	076H

STK4H 	EQU 	077H

STK3L 	EQU 	078H

STK3H 	EQU 	079H

STK2L 	EQU 	07AH

STK2H 	EQU 	07BH

STK1L 	EQU 	07CH

STK1H 	EQU 	07DH

STK0L 	EQU 	07EH

STK0H 	EQU 	07FH


; -----------------------------------------------------
; Clear watchdog macro. 
;  
; Total Cycle: 2

	@RST_WDT	macro
		   MOV  A, #0x5A
		   B0MOV  WDTR, A
	endm
; -----------------------------------------------------
; Sleep Mode control macro for compatibility in S8KD-2 ICE
;  
; Total Cycle: 1

	SleepMode	macro	
		B0BSET	FCPUM0
	endm
; -----------------------------------------------------
; Green Mode control macro for compatibility in S8KD-2 ICE
;  
; Total Cycle: 3

	GreenMode	macro	
		B0BSET	FCPUM1
		NOP
		NOP
	endm
; -----------------------------------------------------
; Slow Mode control macro for compatibility in S8KD-2 ICE
;  
; Total Cycle: 2

	SlowMode	macro	
		B0BSET	FCLKMD
		B0BSET	FSTPHX
	endm
; -----------------------------------------------------
;  Slow mode to Normal Mode control macro for compatibility in S8KD-2 ICE
;  
; Total Cycle: 5

	Slow2Normal	macro	
		B0BCLR	FSTPHX
		NOP
		NOP
		NOP
		B0BCLR	FCLKMD
	endm
; -----------------------------------------------------
;  Slow mode to Normal Mode control macro for compatibility in S8KD-2 ICE
;  
; Total Cycle: 5

	Set_P3_Input_Pullup	macro	
    DW	0x2D00 		;mov	a, #0x00	; Port 3: Input pull-up high
    DW 	0x2FC3 		;b0mov	P3M,a
    DW	0x2DFF 		;mov	a, #0xFF
    DW	0x2FD3 		;b0mov	P3,a
    DW	0x2FE3 		;b0mov	P3UR,a
	endm
; -----------------------------------------------------
