ifndef __SN8P26L38__INC__H
SN8P26L38__INC__H equ 1
	L	EQU	0x80
	H	EQU	0x81
	R	EQU	0x82
	Z	EQU	0x83
	Y	EQU	0x84
	reg_085h	EQU	0x85
	PFLAG	EQU	0x86
		FZ	EQU	PFLAG.0
		FDC	EQU	PFLAG.1
		FC	EQU	PFLAG.2
		FLVD24	EQU	PFLAG.4
		FLVD28	EQU	PFLAG.5
		FNPD	EQU	PFLAG.6
		FNT0	EQU	PFLAG.7
	RBANK	EQU	0x87
		FBANKS0	EQU	RBANK.0
		FBANKS1	EQU	RBANK.1
		FBANKS2	EQU	RBANK.2
	reg_088h	EQU	0x88
	reg_089h	EQU	0x89
	reg_08ah	EQU	0x8a
	reg_08bh	EQU	0x8b
	reg_08ch	EQU	0x8c
	reg_08dh	EQU	0x8d
	reg_08eh	EQU	0x8e
	reg_08fh	EQU	0x8f
	reg_090h	EQU	0x90
	reg_091h	EQU	0x91
	reg_092h	EQU	0x92
	reg_093h	EQU	0x93
	reg_094h	EQU	0x94
	reg_095h	EQU	0x95
	reg_096h	EQU	0x96
	reg_097h	EQU	0x97
	reg_098h	EQU	0x98
	reg_099h	EQU	0x99
	reg_09ah	EQU	0x9a
	reg_09bh	EQU	0x9b
	CMP0M	EQU	0x9c
		FCMS0	EQU	CMP0M.0
		FCMS1	EQU	CMP0M.1
		FCM0OUT	EQU	CMP0M.2
		FCM0REF	EQU	CMP0M.3
		FCM0OEN	EQU	CMP0M.4
		FCM0IRQ	EQU	CMP0M.5
		FCM0IEN	EQU	CMP0M.6
		FCM0EN	EQU	CMP0M.7
	CMP1M	EQU	0x9d
		FCM1OUT	EQU	CMP1M.2
		FCM1REF	EQU	CMP1M.3
		FCM1OEN	EQU	CMP1M.4
		FCM1IRQ	EQU	CMP1M.5
		FCM1IEN	EQU	CMP1M.6
		FCM1EN	EQU	CMP1M.7
	reg_09eh	EQU	0x9e
	reg_09fh	EQU	0x9f
	T1M	EQU	0xa0
		FT1ENB	EQU	T1M.7
		FT1r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INTEN	EQU	0xc9
		FP00IEN	EQU	INTEN.0
		FP01IEN	EQU	INTEN.1
		FTXIEN	EQU	INTEN.2
		FRXIEN	EQU	INTEN.3
		FT0IEN	EQU	INTEN.4
		FT1IEN	EQU	INTEN.5
		FTC1IEN	EQU	INTEN.6
		FSIOIEN	EQU	INTEN.7
	OSCM	EQU	0xca
		FCPUM1	EQU	OSCM.4
		FCPUM0	EQU	OSCM.3
		FCLKMD	EQU	OSCM.2
		FSTPHX	EQU	OSCM.1
	WDTC	EQU	0xcb
	WDTR	EQU	0xcc
	IRR	EQU	0xcd
	PCL	EQU	0xce
	PCH	EQU	0xcf
	P0	EQU	0xd0
		FP00	EQU	P0.0
		FP01	EQU	P0.1
		FP02	EQU	P0.2
		FP03	EQU	P0.3
		FP04	EQU	P0.4
		FP05	EQU	P0.5
		FP06	EQU	P0.6
		FP07	EQU	P0.7
	P1	EQU	0xd1
		FP10	EQU	P1.0
		FP11	EQU	P1.1
		FP12	EQU	P1.2
		FP13	EQU	P1.3
		FP14	EQU	P1.4
		FP15	EQU	P1.5
		FP16	EQU	P1.6
		FP17	EQU	P1.7
	P2	EQU	0xd2
		FP20	EQU	P2.0
		FP21	EQU	P2.1
		FP22	EQU	P2.2
		FP23	EQU	P2.3
		FP24	EQU	P2.4
		FP25	EQU	P2.5
		FP26	EQU	P2.6
		FP27	EQU	P2.7
	P3	EQU	0xd3
		FP30	EQU	P3.0
		FP31	EQU	P3.1
		FP32	EQU	P3.2
		FP33	EQU	P3.3
	P4	EQU	0xd4
		FP40	EQU	P4.0
		FP41	EQU	P4.1
		FP42	EQU	P4.2
		FP43	EQU	P4.3
		FP44	EQU	P4.4
		FP45	EQU	P4.5
		FP46	EQU	P4.6
		FP47	EQU	P4.7
	P5	EQU	0xd5
		FP50	EQU	P5.0
		FP51	EQU	P5.1
		FP52	EQU	P5.2
		FP53	EQU	P5.3
		FP54	EQU	P5.4
		FP55	EQU	P5.5
		FP56	EQU	P5.6
		FP57	EQU	P5.7
	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		   B0MOV  WDTR, A
	endm

SleepMode	macro	
		B0BSET	FCPUM0
	endm

GreenMode	macro	
		B0BSET	FCPUM1
		B0BSET	0XFF.7
		NOP
	endm

SlowMode	macro	
		B0BSET	FCLKMD
		B0BSET	FSTPHX
	endm

Slow2Normal	macro	
		B0BCLR	FSTPHX
		NOP
		NOP
		NOP
		B0BCLR	FCLKMD
	endm

endif
