;--------------------------------------------------------
; File Created by ChiponCC : aolisn inc.
; Version 3.0.4#6752 (Mar  1 2016 15:13:08) (MSVC)
; This file was generated Sat May 28 15:24:42 2016
;--------------------------------------------------------
; chipon port for the 16-bit core
;--------------------------------------------------------
;	.file	"../main.c"
	.radix dec
	.include "KF8F4158.inc"
;--------------------------------------------------------
; external declarations
;--------------------------------------------------------
	.extern	_PSW_bits
	.extern	_P0_bits
	.extern	_P2_bits
	.extern	_P1_bits
	.extern	_P3_bits
	.extern	_INTCTL_bits
	.extern	_EIF1_bits
	.extern	_EIF2_bits
	.extern	_T1CTL_bits
	.extern	_T2CTL0_bits
	.extern	_PWMCTL_bits
	.extern	_BANK_bits
	.extern	_ADSCANCTL_bits
	.extern	_C1CTL_bits
	.extern	_COUT_bits
	.extern	_AMPCTL_bits
	.extern	_ANSEH_bits
	.extern	_ADCCTL0_bits
	.extern	_AMPDT_bits
	.extern	_OPTR_bits
	.extern	_IP0_bits
	.extern	_IP1_bits
	.extern	_IP2_bits
	.extern	_TR0_bits
	.extern	_TR2_bits
	.extern	_TR1_bits
	.extern	_OSCSTA_bits
	.extern	_IP3_bits
	.extern	_VRECTL_bits
	.extern	_EIE1_bits
	.extern	_EIE2_bits
	.extern	_PCTL_bits
	.extern	_OSCCTL_bits
	.extern	_ANSEL_bits
	.extern	_PUR0_bits
	.extern	_IOCL_bits
	.extern	_ADCCTL1_bits
	.extern	_P0LR_bits
	.extern	_P2LR_bits
	.extern	_P1LR_bits
	.extern	_P3LR_bits
	.extern	_TR3_bits
	.extern	_EIE3_bits
	.extern	_EIF3_bits
	.extern	_PWM5CTL0_bits
	.extern	_ADCINTCTL_bits
	.extern	_PWM5CTL1_bits
	.extern	_P5ASCTL0_bits
	.extern	_PSTRCTL0_bits
	.extern	_PUR1_bits
	.extern	_PUR2_bits
	.extern	_INTEDGCTL_bits
	.extern	_PWM5OC_bits
	.extern	_T2CTL1_bits
	.extern	_C2CTL_bits
	.extern	_P5ASCTL1_bits
	.extern	_PSTRCTL1_bits
	.extern	_PWM5CTL2_bits
	.extern	_PWM5PC_bits
	.extern	_SSCICTL0_bits
	.extern	_SSCICTL1_bits
	.extern	_SSCISTA_bits
	.extern	_SSCIMSK_bits
	.extern	_WDTPS_bits
	.extern	_MULCTL_bits
	.extern	_DIVCTL_bits
	.extern	_C1FILTCTL_bits
	.extern	_C1FILTPRE_bits
	.extern	_C2FILTCTL_bits
	.extern	_C2FILTPRE_bits
	.extern	_PWM5FC_bits
	.extern	_T4CTL_bits
	.extern	_T0
	.extern	_PCL
	.extern	_PSW
	.extern	_P0
	.extern	_P2
	.extern	_P1
	.extern	_P3
	.extern	_PCH
	.extern	_INTCTL
	.extern	_EIF1
	.extern	_EIF2
	.extern	_T1L
	.extern	_T1H
	.extern	_T1CTL
	.extern	_T2L
	.extern	_T2CTL0
	.extern	_PWM1L
	.extern	_PWM1H
	.extern	_PWMCTL
	.extern	_PP1
	.extern	_BANK
	.extern	_ADSCANCTL
	.extern	_C1CTL
	.extern	_COUT
	.extern	_AMPCTL
	.extern	_ANSEH
	.extern	_ADCDATA0H
	.extern	_ADCCTL0
	.extern	_AMPDT
	.extern	_OPTR
	.extern	_IP0
	.extern	_IP1
	.extern	_IP2
	.extern	_TR0
	.extern	_TR2
	.extern	_TR1
	.extern	_OSCSTA
	.extern	_IP3
	.extern	_VRECAL1
	.extern	_VRECTL
	.extern	_EIE1
	.extern	_EIE2
	.extern	_PCTL
	.extern	_OSCCTL
	.extern	_OSCCAL0
	.extern	_ANSEL
	.extern	_PP2
	.extern	_PWM2L
	.extern	_PWM2H
	.extern	_PUR0
	.extern	_IOCL
	.extern	_OSCCAL1
	.extern	_NVMDATAH
	.extern	_NVMDATAL
	.extern	_NVMADDRH
	.extern	_NVMADDRL
	.extern	_NVMCTL0
	.extern	_NVMCTL1
	.extern	_ADCDATA0L
	.extern	_ADCCTL1
	.extern	_T2CCR0H
	.extern	_T2H
	.extern	_PP5H
	.extern	_PWM5H0
	.extern	_PWM5H1
	.extern	_P0LR
	.extern	_P2LR
	.extern	_P1LR
	.extern	_P3LR
	.extern	_TR3
	.extern	_EIE3
	.extern	_EIF3
	.extern	_OSCCAL2
	.extern	_OSCCAL3
	.extern	_ADCDATA1H
	.extern	_ADCDATA1L
	.extern	_PP5L
	.extern	_T2CCR0L
	.extern	_PWM5L0
	.extern	_PWM5L1
	.extern	_PWM5CTL0
	.extern	_ADCINTCTL
	.extern	_ADCDATA2H
	.extern	_ADCDATA2L
	.extern	_PWM5CTL1
	.extern	_P5ASCTL0
	.extern	_PSTRCTL0
	.extern	_ADCDATA3H
	.extern	_PUR1
	.extern	_PUR2
	.extern	_INTEDGCTL
	.extern	_ADCDATA3L
	.extern	_PWM5L2
	.extern	_PWM5L3
	.extern	_PWM5OC
	.extern	_T2CTL1
	.extern	_C2CTL
	.extern	_P5ASCTL1
	.extern	_PSTRCTL1
	.extern	_PWM5CTL2
	.extern	_PWM5PC
	.extern	_PWM5H2
	.extern	_PWM5H3
	.extern	_SSCICTL0
	.extern	_SSCICTL1
	.extern	_SSCISTA
	.extern	_SSCIBUFR
	.extern	_SSCIMSK
	.extern	_WDTPS
	.extern	_MULAH
	.extern	_MULAL
	.extern	_MULBH
	.extern	_MULBL
	.extern	_MULCTL
	.extern	_MULRES3
	.extern	_MULRES2
	.extern	_MULRES1
	.extern	_MULRES0
	.extern	_DIVCTL
	.extern	_DIVAH
	.extern	_DIVAL
	.extern	_DIVB
	.extern	_DIVQH
	.extern	_DIVQL
	.extern	_DIVR
	.extern	_C1FILTCTL
	.extern	_C1FILTPRE
	.extern	_C2FILTCTL
	.extern	_C2FILTPRE
	.extern	_VRECAL2
	.extern	_VRECAL3
	.extern	_PWM5FC
	.extern	_T2CCR1L
	.extern	_T2CCR1H
	.extern	_T4L
	.extern	_T4H
	.extern	_T4REL
	.extern	_T4REH
	.extern	_T4CTL
	.extern	_RC32KCAL
	.extern	_startup
	.extern	__sdcc_gsinit_startup
;--------------------------------------------------------
; global declarations
;--------------------------------------------------------
	.global	_Delay_ms
	.global	_int_fun0
	.global	_int_fun1
	.global	_Start_I2C
	.global	_Stop_I2C
	.global	_SendB
	.global	_RcvB
	.global	_ack
	.global	_init_mcu
	.global	_main
	.global	_time
	.global	_Freq
	.global	_Temp
	.global	_ADDR
	.global	_DATA
	.global	_DATAcnt
	.global	_ON

	.global I0R1
	.global I0R7
	.global I0PSW
	.global I0PCH
	.global I1R1
	.global I1R7
	.global I1PSW
	.global I1PCH
	.global STK11
	.global STK10
	.global STK09
	.global STK08
	.global STK07
	.global STK06
	.global STK05
	.global STK04
	.global STK03
	.global STK02
	.global STK01
	.global STK00

sharebank .udata
I0R1		.res 1
I0R7		.res 1
I0PSW		.res 1
I0PCH		.res 1
I1R1		.res 1
I1R7		.res 1
I1PSW		.res 1
I1PCH		.res 1
STK11	.res 1
	.type STK11, 108
STK10	.res 1
	.type STK10, 108
STK09	.res 1
	.type STK09, 108
STK08	.res 1
	.type STK08, 108
STK07	.res 1
	.type STK07, 108
STK06	.res 1
	.type STK06, 108
STK05	.res 1
	.type STK05, 108
STK04	.res 1
	.type STK04, 108
STK03	.res 1
	.type STK03, 108
STK02	.res 1
	.type STK02, 108
STK01	.res 1
	.type STK01, 108
STK00	.res 1
	.type STK00, 108

;--------------------------------------------------------
; global definitions
;--------------------------------------------------------
;--------------------------------------------------------
; absolute symbol definitions
;--------------------------------------------------------
;--------------------------------------------------------
; compiler-defined variables
;--------------------------------------------------------
UDL_main_0	.udata
r0x1001	.res	1
UDL_main_1	.udata
r0x1000	.res	1
UDL_main_2	.udata
r0x1002	.res	1
UDL_main_3	.udata
r0x1003	.res	1
UDL_main_4	.udata
r0x1004	.res	1
UDL_main_5	.udata
r0x1005	.res	1
UDL_main_6	.udata
r0x1006	.res	1
UDL_main_7	.udata
r0x1007	.res	1
UDL_main_8	.udata
r0x1008	.res	1
UDL_main_9	.udata
r0x1009	.res	1
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------

ID_main_0	.idata
_time
	.db	0x00, 0x00


ID_main_1	.idata
_Freq
	.db	0x00, 0x00


ID_main_2	.idata
_Temp
	.db	0x00


ID_main_3	.idata
_ADDR
	.db	0x00


ID_main_4	.idata
_DATA
	.db	0x00


ID_main_5	.idata
_DATAcnt
	.db	0x00


ID_main_6	.idata
_ON
	.db	0x00

;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
;	.udata_ovr
;--------------------------------------------------------
; reset vector 
;--------------------------------------------------------
STARTUP	.code 0x0000
	NOP
	PAGESEL	init_imp
	JMP		init_imp

	.global	init_imp
INIT_IMP	.code
init_imp
	PAGESEL	_startup
	CALL	_startup
	PAGESEL	__sdcc_gsinit_startup
	CALL	__sdcc_gsinit_startup
	PAGESEL	_main
	JMP		_main
;--------------------------------------------------------
; interrupt and initialization code
;--------------------------------------------------------
interrupt_0x04	.code	0x4
	MOV		R2,R0
	MOV		R3,BANK
	MOV		R0,PSW
	BANKSEL	I0PSW
	MOV		I0PSW,R0
	MOV		R0,PCH
	BANKSEL	I0PCH
	MOV		I0PCH,R0
	MOV		I0R1,R1
	MOV		I0R7,R7
	PAGESEL	interrupt_service_routine_0x04
	JMP		interrupt_service_routine_0x04



func._int_fun0	.code
;***
;  PostBlock Stats: dbName = I
;***
;entry:  _int_fun0	;Function start
; 0 exit points
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_int_fun0	;Function start
; 0 exit points
;	op : GET_VALUE_AT_ADDRESS
; R3 resprent for wsave,R4 resprent for ssave, R5 resprent for psave
interrupt_service_routine_0x04
;	.line	55; "../main.c"	if(T0IF)
	BANKSEL	_INTCTL_bits
	JB	_INTCTL_bits, 2
	JMP	_00016_DS_
;	op : =
;	.line	57; "../main.c"	T0IF = 0;
	BANKSEL	_INTCTL_bits
	CLR	_INTCTL_bits, 2
;	op : =
;	.line	58; "../main.c"	T0 = 0X9C;
	MOV	R0,# 0x9c
	BANKSEL	_T0
	MOV	_T0, R0
;	op : LABEL
;	op : ENDFUNCTION
_00016_DS_
	BANKSEL	I0R1
	MOV	R1, I0R1
	BANKSEL	I0R7
	MOV	R7, I0R7
	BANKSEL	I0PCH
	MOV	R0, I0PCH
	MOV	PCH, R0
	BANKSEL	I0PSW
	MOV	R0, I0PSW
	MOV	PSW, R0
	MOV	BANK, R3
	MOV	R0, R2
	IRET	



func._int_fun1	.code
;***
;  PostBlock Stats: dbName = I
;***
;entry:  _int_fun1	;Function start
; 0 exit points
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_int_fun1	;Function start
; 0 exit points
;	op : LABEL
;	op : ENDFUNCTION
; R3 resprent for wsave,R4 resprent for ssave, R5 resprent for psave
interrupt_service_routine_0x14
_00019_DS_
;	.line	66; "../main.c"	}
	IRET	



func._main	.code
;***
;  PostBlock Stats: dbName = M
;***
;entry:  _main	;Function start
; 2 exit points
;has an exit
;functions called:
;   _init_mcu
;   _Delay_ms
;   _Start_I2C
;   _SendB
;   _SendB
;   _SendB
;   _SendB
;   _SendB
;   _SendB
;   _SendB
;   _SendB
;   _Stop_I2C
;   _Start_I2C
;   _SendB
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _Stop_I2C
;   _Delay_ms
;   _Start_I2C
;   _SendB
;   _SendB
;   _Stop_I2C
;   _Start_I2C
;   _SendB
;   _SendB
;   _Stop_I2C
;   _init_mcu
;   _Delay_ms
;   _Start_I2C
;   _SendB
;   _SendB
;   _SendB
;   _SendB
;   _SendB
;   _SendB
;   _SendB
;   _SendB
;   _Stop_I2C
;   _Start_I2C
;   _SendB
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _RcvB
;   _ack
;   _Stop_I2C
;   _Delay_ms
;   _Start_I2C
;   _SendB
;   _SendB
;   _Stop_I2C
;   _Start_I2C
;   _SendB
;   _SendB
;   _Stop_I2C
;5 compiler assigned registers:
;   r0x1006
;   r0x1007
;   r0x1008
;   STK00
;   r0x1009
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_main	;Function start
; 2 exit points
;	op : =
;	.line	183; "../main.c"	uchar i=0,j=0;
	BANKSEL	r0x1006
	CLR	r0x1006
;	op : =
	BANKSEL	r0x1007
	CLR	r0x1007
;	op : =
;	.line	184; "../main.c"	uchar da=0;
	BANKSEL	r0x1008
	CLR	r0x1008
;	op : CALL
;	.line	185; "../main.c"	init_mcu();
	PAGESEL	_init_mcu
	CALL	_init_mcu
	PAGESEL	$
;	op : LABEL
;	op : =
_00126_DS_
;	.line	189; "../main.c"	LED4=0;
	BANKSEL	_P2LR_bits
	CLR	_P2LR_bits, 0
;	op : GET_VALUE_AT_ADDRESS
;	.line	190; "../main.c"	if(!KEY3)
	BANKSEL	_P0_bits
	JNB	_P0_bits, 3
	JMP	_00111_DS_
;	op : SEND
;	op : CALL
;	.line	192; "../main.c"	Delay_ms(5);
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_Delay_ms
	CALL	_Delay_ms
	PAGESEL	$
;	op : GET_VALUE_AT_ADDRESS
;	.line	193; "../main.c"	if(!KEY3)
	BANKSEL	_P0_bits
	JNB	_P0_bits, 3
	JMP	_00111_DS_
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00094_DS_
;	.line	195; "../main.c"	while(!KEY3);
	BANKSEL	_P0_bits
	JB	_P0_bits, 3
	JMP	_00094_DS_
;	op : +
;	.line	196; "../main.c"	i++;
	BANKSEL	r0x1006
	INC	r0x1006
;	op : >
;swapping arguments (AOP_TYPEs 1/2)
;unsigned compare: left >= lit(0x8=8), size=1
;	.line	197; "../main.c"	if(i>7)i=1;
	MOV	R0,# 0x08
	BANKSEL	r0x1006
	SUB	R0, r0x1006
;comparing bytes at offset 0
	JB	PSW, 0
	JMP	_00098_DS_
;	op : =
	MOV	R0,# 0x01
	BANKSEL	r0x1006
	MOV	r0x1006, R0
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x1=1), size=1
_00098_DS_
;	.line	198; "../main.c"	switch(i)
	MOV	R0,# 0x01
	BANKSEL	r0x1006
	SUB	R0, r0x1006
;comparing bytes at offset 0
	JB	PSW, 0
	JMP	_00107_DS_
;	op : >
;swapping arguments (AOP_TYPEs 1/2)
;unsigned compare: left >= lit(0x8=8), size=1
	MOV	R0,# 0x08
	BANKSEL	r0x1006
	SUB	R0, r0x1006
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00107_DS_
;	op : -
	BANKSEL	r0x1006
	DECR	r0x1006
	BANKSEL	r0x1009
	MOV	r0x1009, R0
;	op : JUMPTABLE
	MOV	R0,#high _00146_DS_
	MOV	PCH, R0
	MOV	R0,#_00146_DS_
	BANKSEL	r0x1009
	ADD	R0, r0x1009
	JNB	PSW, 0
	INC	PCH
	MOV	PCL, R0
_00146_DS_
	JMP	_00099_DS_
	JMP	_00100_DS_
	JMP	_00101_DS_
	JMP	_00102_DS_
	JMP	_00103_DS_
	JMP	_00104_DS_
	JMP	_00105_DS_
;	op : LABEL
;	op : =
_00099_DS_
;	.line	200; "../main.c"	case 1:da=0xE1;break;
	MOV	R0,# 0xe1
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : GOTO
	JMP	_00107_DS_
;	op : LABEL
;	op : =
_00100_DS_
;	.line	201; "../main.c"	case 2:da=0xE2;break;
	MOV	R0,# 0xe2
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : GOTO
	JMP	_00107_DS_
;	op : LABEL
;	op : =
_00101_DS_
;	.line	202; "../main.c"	case 3:da=0xE3;break;
	MOV	R0,# 0xe3
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : GOTO
	JMP	_00107_DS_
;	op : LABEL
;	op : =
_00102_DS_
;	.line	203; "../main.c"	case 4:da=0xE4;break;
	MOV	R0,# 0xe4
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : GOTO
	JMP	_00107_DS_
;	op : LABEL
;	op : =
_00103_DS_
;	.line	204; "../main.c"	case 5:da=0xE5;break;
	MOV	R0,# 0xe5
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : GOTO
	JMP	_00107_DS_
;	op : LABEL
;	op : =
_00104_DS_
;	.line	205; "../main.c"	case 6:da=0xE6;break;
	MOV	R0,# 0xe6
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : GOTO
	JMP	_00107_DS_
;	op : LABEL
;	op : =
_00105_DS_
;	.line	206; "../main.c"	case 7:da=0xE7;break;
	MOV	R0,# 0xe7
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : LABEL
;	op : CALL
_00107_DS_
;	.line	210; "../main.c"	Start_I2C();
	PAGESEL	_Start_I2C
	CALL	_Start_I2C
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	215; "../main.c"	SendB(0X5A);				//发送7位地址
	MOV	R0,# 0x5a
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	217; "../main.c"	SendB(da);
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	218; "../main.c"	SendB(0X61);
	MOV	R0,# 0x61
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	219; "../main.c"	SendB(0X62);
	MOV	R0,# 0x62
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	220; "../main.c"	SendB(0X63);
	MOV	R0,# 0x63
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	221; "../main.c"	SendB(0X64);
	MOV	R0,# 0x64
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	222; "../main.c"	SendB(0X65);
	MOV	R0,# 0x65
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	223; "../main.c"	SendB(0X66);
	MOV	R0,# 0x66
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : CALL
;	.line	224; "../main.c"	Stop_I2C();
	PAGESEL	_Stop_I2C
	CALL	_Stop_I2C
	PAGESEL	$
;	op : CALL
;	.line	225; "../main.c"	Start_I2C();
	PAGESEL	_Start_I2C
	CALL	_Start_I2C
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	230; "../main.c"	SendB(0X5B);				//发送7位地址
	MOV	R0,# 0x5b
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : CALL
;	.line	233; "../main.c"	da=RcvB();
	PAGESEL	_RcvB
	CALL	_RcvB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	234; "../main.c"	ack(0);
	MOV	R0,# 0x00
	PAGESEL	_ack
	CALL	_ack
	PAGESEL	$
;	op : CALL
;	.line	236; "../main.c"	da=RcvB();
	PAGESEL	_RcvB
	CALL	_RcvB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	237; "../main.c"	ack(0);
	MOV	R0,# 0x00
	PAGESEL	_ack
	CALL	_ack
	PAGESEL	$
;	op : CALL
;	.line	239; "../main.c"	da=RcvB();
	PAGESEL	_RcvB
	CALL	_RcvB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	240; "../main.c"	ack(0);
	MOV	R0,# 0x00
	PAGESEL	_ack
	CALL	_ack
	PAGESEL	$
;	op : CALL
;	.line	242; "../main.c"	da=RcvB();
	PAGESEL	_RcvB
	CALL	_RcvB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	243; "../main.c"	ack(0);
	MOV	R0,# 0x00
	PAGESEL	_ack
	CALL	_ack
	PAGESEL	$
;	op : CALL
;	.line	245; "../main.c"	da=RcvB();
	PAGESEL	_RcvB
	CALL	_RcvB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	246; "../main.c"	ack(0);
	MOV	R0,# 0x00
	PAGESEL	_ack
	CALL	_ack
	PAGESEL	$
;	op : CALL
;	.line	248; "../main.c"	da=RcvB();
	PAGESEL	_RcvB
	CALL	_RcvB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	249; "../main.c"	ack(0);
	MOV	R0,# 0x00
	PAGESEL	_ack
	CALL	_ack
	PAGESEL	$
;	op : CALL
;	.line	251; "../main.c"	da=RcvB();
	PAGESEL	_RcvB
	CALL	_RcvB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	252; "../main.c"	ack(0);
	MOV	R0,# 0x00
	PAGESEL	_ack
	CALL	_ack
	PAGESEL	$
;	op : CALL
;	.line	254; "../main.c"	da=RcvB();
	PAGESEL	_RcvB
	CALL	_RcvB
	PAGESEL	$
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : SEND
;	op : CALL
;	.line	255; "../main.c"	ack(1);
	MOV	R0,# 0x01
	PAGESEL	_ack
	CALL	_ack
	PAGESEL	$
;	op : CALL
;	.line	257; "../main.c"	Stop_I2C();
	PAGESEL	_Stop_I2C
	CALL	_Stop_I2C
	PAGESEL	$
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00111_DS_
;	.line	261; "../main.c"	if(!KEY4)
	BANKSEL	_P0_bits
	JNB	_P0_bits, 5
	JMP	_00126_DS_
;	op : SEND
;	op : CALL
;	.line	263; "../main.c"	Delay_ms(5);
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_Delay_ms
	CALL	_Delay_ms
	PAGESEL	$
;	op : GET_VALUE_AT_ADDRESS
;	.line	264; "../main.c"	if(!KEY4)
	BANKSEL	_P0_bits
	JNB	_P0_bits, 5
	JMP	_00126_DS_
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00112_DS_
;	.line	266; "../main.c"	while(!KEY4);
	BANKSEL	_P0_bits
	JB	_P0_bits, 5
	JMP	_00112_DS_
;	op : +
;	.line	267; "../main.c"	j++;
	BANKSEL	r0x1007
	INC	r0x1007
;	op : >
;swapping arguments (AOP_TYPEs 1/2)
;unsigned compare: left >= lit(0x3=3), size=1
;	.line	268; "../main.c"	if(j>2)j=1;
	MOV	R0,# 0x03
	BANKSEL	r0x1007
	SUB	R0, r0x1007
;comparing bytes at offset 0
	JB	PSW, 0
	JMP	_00116_DS_
;	op : =
	MOV	R0,# 0x01
	BANKSEL	r0x1007
	MOV	r0x1007, R0
;	op : LABEL
;	op : EQ_OP
_00116_DS_
;	.line	269; "../main.c"	if(j==1)
	BANKSEL	r0x1007
	MOVZ	R0, r0x1007
	XOR	R0,# 0x01
	JB	PSW, 2
	JMP	_00118_DS_
;	op : CALL
;	.line	271; "../main.c"	Start_I2C();
	PAGESEL	_Start_I2C
	CALL	_Start_I2C
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	276; "../main.c"	SendB(0X5A);		//发送7位地址
	MOV	R0,# 0x5a
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	278; "../main.c"	SendB(0X55);
	MOV	R0,# 0x55
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : CALL
;	.line	279; "../main.c"	Stop_I2C();
	PAGESEL	_Stop_I2C
	CALL	_Stop_I2C
	PAGESEL	$
;	op : LABEL
;	op : EQ_OP
_00118_DS_
;	.line	281; "../main.c"	if(j==2)
	BANKSEL	r0x1007
	MOVZ	R0, r0x1007
	XOR	R0,# 0x02
	JB	PSW, 2
	JMP	_00126_DS_
;	op : CALL
;	.line	283; "../main.c"	Start_I2C();
	PAGESEL	_Start_I2C
	CALL	_Start_I2C
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	288; "../main.c"	SendB(0X5B);		//发送7位地址
	MOV	R0,# 0x5b
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	290; "../main.c"	SendB(0XAA);
	MOV	R0,# 0xaa
	PAGESEL	_SendB
	CALL	_SendB
	PAGESEL	$
;	op : CALL
;	.line	291; "../main.c"	Stop_I2C();
	PAGESEL	_Stop_I2C
	CALL	_Stop_I2C
	PAGESEL	$
;	op : GOTO
	JMP	_00126_DS_
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _main



func._init_mcu	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _init_mcu	;Function start
; 2 exit points
;has an exit
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_init_mcu	;Function start
; 2 exit points
;	op : =
;	.line	144; "../main.c"	OSCCTL = 0x70;           //32M
	MOV	R0,# 0x70
	BANKSEL	_OSCCTL
	MOV	_OSCCTL, R0
;	op : INLINEASM
	NOP 
;	op : INLINEASM
	NOP 
;	op : =
;	.line	149; "../main.c"	TR0 = 0X2E;              //0000 1110
	MOV	R0,# 0x2e
	BANKSEL	_TR0
	MOV	_TR0, R0
;	op : =
;	.line	150; "../main.c"	TR1 = 0X03;              //0000 0000 P10为SCK，P11为SDA
	MOV	R0,# 0x03
	BANKSEL	_TR1
	MOV	_TR1, R0
;	op : =
;	.line	151; "../main.c"	TR2 = 0X00;              //0000 0000
	BANKSEL	_TR2
	CLR	_TR2
;	op : =
;	.line	152; "../main.c"	TR3 = 0X00;				 //0000 0000
	BANKSEL	_TR3
	CLR	_TR3
;	op : =
;	.line	154; "../main.c"	P0LR = 0X38;             //0011 1000
	MOV	R0,# 0x38
	BANKSEL	_P0LR
	MOV	_P0LR, R0
;	op : =
;	.line	155; "../main.c"	P1LR = 0X03;             //0000 0011
	MOV	R0,# 0x03
	BANKSEL	_P1LR
	MOV	_P1LR, R0
;	op : =
;	.line	156; "../main.c"	P2LR = 0x00;             //0011 0001
	BANKSEL	_P2LR
	CLR	_P2LR
;	op : =
;	.line	157; "../main.c"	P3LR = 0X00;			 //0101 0000
	BANKSEL	_P3LR
	CLR	_P3LR
;	op : =
;	.line	160; "../main.c"	SSCIEN=0;				//关闭I2C模块，初始化完之后再打开
	BANKSEL	_SSCICTL0_bits
	CLR	_SSCICTL0_bits, 5
;	op : =
;	.line	162; "../main.c"	SSCICTL0=0X18;			//I2C主控模式
	MOV	R0,# 0x18
	BANKSEL	_SSCICTL0
	MOV	_SSCICTL0, R0
;	op : =
;	.line	163; "../main.c"	SSCICTL1=0X00;
	BANKSEL	_SSCICTL1
	CLR	_SSCICTL1
;	op : =
;	.line	164; "../main.c"	SSCISTA=0X00;
	BANKSEL	_SSCISTA
	CLR	_SSCISTA
;	op : =
;	.line	166; "../main.c"	SSCIADD=79;	//主控模式下，该寄存器[Fosc/(BandRate*4)]-1决定了波特率
	MOV	R0,# 0x4f
	BANKSEL	_SSCIMSK
	MOV	_SSCIMSK, R0
;	op : =
;	.line	168; "../main.c"	SSCIIF=0;				//清零I2C中断标志
	BANKSEL	_EIF2_bits
	CLR	_EIF2_bits, 0
;	op : =
;	.line	169; "../main.c"	SSCIEN=1;
	BANKSEL	_SSCICTL0_bits
	SET	_SSCICTL0_bits, 5
;	op : =
;	.line	172; "../main.c"	OPTR = 0X03;     //16分频，4us计数1，
	MOV	R0,# 0x03
	BANKSEL	_OPTR
	MOV	_OPTR, R0
;	op : =
;	.line	173; "../main.c"	T0 = 0X06;      //1ms定时
	MOV	R0,# 0x06
	BANKSEL	_T0
	MOV	_T0, R0
;	op : =
;	.line	174; "../main.c"	T0IE = 1;
	BANKSEL	_INTCTL_bits
	SET	_INTCTL_bits, 5
;	op : =
;	.line	175; "../main.c"	T0IF = 0;
	BANKSEL	_INTCTL_bits
	CLR	_INTCTL_bits, 2
;	op : =
;	.line	178; "../main.c"	AIE = 1;		//打开总中断
	BANKSEL	_INTCTL_bits
	SET	_INTCTL_bits, 7
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _init_mcu



func._ack	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _ack	;Function start
; 2 exit points
;has an exit
;1 compiler assigned register :
;   r0x1000
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_ack	;Function start
; 2 exit points
;	op : RECEIVE
;	.line	123; "../main.c"	void ack(uchar a)
	BANKSEL	r0x1000
	MOV	r0x1000, R0
;	op : IFX
;	.line	125; "../main.c"	if(a)SSCIACKDAT=1;//应答信号=1，不应答；应答信号=0，应答
	MOV	R0,# 0x00
	BANKSEL	r0x1000
	ORL	R0, r0x1000
	JNB	PSW, 2
	JMP	_00077_DS_
;	op : =
	BANKSEL	_SSCICTL1_bits
	SET	_SSCICTL1_bits, 5
;	op : GOTO
	JMP	_00078_DS_
;	op : LABEL
;	op : =
_00077_DS_
;	.line	126; "../main.c"	else SSCIACKDAT=0;
	BANKSEL	_SSCICTL1_bits
	CLR	_SSCICTL1_bits, 5
;	op : LABEL
;	op : =
_00078_DS_
;	.line	127; "../main.c"	SSCIACKEN=1;		//使能应答信号发送
	BANKSEL	_SSCICTL1_bits
	SET	_SSCICTL1_bits, 4
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00079_DS_
;	.line	129; "../main.c"	while(SSCIACKEN)	//发送完ACKDAT，硬件自动清零
	BANKSEL	_SSCICTL1_bits
	JB	_SSCICTL1_bits, 4
	JMP	_00081_DS_
;	op : =
;	.line	131; "../main.c"	LED4=1;
	BANKSEL	_P2LR_bits
	SET	_P2LR_bits, 0
;	op : GOTO
	JMP	_00079_DS_
;	op : LABEL
;	op : =
_00081_DS_
;	.line	133; "../main.c"	LED4=0;
	BANKSEL	_P2LR_bits
	CLR	_P2LR_bits, 0
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00082_DS_
;	.line	134; "../main.c"	while(!SSCIIF)
	BANKSEL	_EIF2_bits
	JNB	_EIF2_bits, 0
	JMP	_00084_DS_
;	op : =
;	.line	136; "../main.c"	LED4=1;
	BANKSEL	_P2LR_bits
	SET	_P2LR_bits, 0
;	op : GOTO
	JMP	_00082_DS_
;	op : LABEL
;	op : =
_00084_DS_
;	.line	138; "../main.c"	LED4=0;
	BANKSEL	_P2LR_bits
	CLR	_P2LR_bits, 0
;	op : =
;	.line	139; "../main.c"	SSCIIF=0;
	BANKSEL	_EIF2_bits
	CLR	_EIF2_bits, 0
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _ack



func._RcvB	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _RcvB	;Function start
; 2 exit points
;has an exit
;1 compiler assigned register :
;   r0x1000
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_RcvB	;Function start
; 2 exit points
;	op : =
;	.line	103; "../main.c"	SSCIRCEN=1;
	BANKSEL	_SSCICTL1_bits
	SET	_SSCICTL1_bits, 3
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00064_DS_
;	.line	104; "../main.c"	while(SSCIRCEN)		//接收完毕，硬件自动清零
	BANKSEL	_SSCICTL1_bits
	JB	_SSCICTL1_bits, 3
	JMP	_00066_DS_
;	op : =
;	.line	106; "../main.c"	LED4=1;
	BANKSEL	_P2LR_bits
	SET	_P2LR_bits, 0
;	op : GOTO
	JMP	_00064_DS_
;	op : LABEL
;	op : =
_00066_DS_
;	.line	108; "../main.c"	LED4=0;
	BANKSEL	_P2LR_bits
	CLR	_P2LR_bits, 0
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00067_DS_
;	.line	110; "../main.c"	while(!SSCIIF)
	BANKSEL	_EIF2_bits
	JNB	_EIF2_bits, 0
	JMP	_00069_DS_
;	op : =
;	.line	112; "../main.c"	LED4=1;
	BANKSEL	_P2LR_bits
	SET	_P2LR_bits, 0
;	op : GOTO
	JMP	_00067_DS_
;	op : LABEL
;	op : =
_00069_DS_
;	.line	114; "../main.c"	LED4=0;
	BANKSEL	_P2LR_bits
	CLR	_P2LR_bits, 0
;	op : =
;	.line	115; "../main.c"	SSCIIF=0;
	BANKSEL	_EIF2_bits
	CLR	_EIF2_bits, 0
;	op : =
;	.line	117; "../main.c"	da=SSCIBUFR;
	BANKSEL	_SSCIBUFR
	MOVZ	R0, _SSCIBUFR
	BANKSEL	r0x1000
	MOV	r0x1000, R0
;	op : RETURN
;	.line	119; "../main.c"	return da;
	BANKSEL	r0x1000
	MOVZ	R0, r0x1000
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _RcvB



func._SendB	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _SendB	;Function start
; 2 exit points
;has an exit
;1 compiler assigned register :
;   r0x1000
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_SendB	;Function start
; 2 exit points
;	op : RECEIVE
;	.line	87; "../main.c"	void SendB(uchar c )
	BANKSEL	_SSCIBUFR
	MOV	_SSCIBUFR, R0
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00043_DS_
;	.line	91; "../main.c"	while(SSCIBUF);		//发送完成SSCIBUF清零
	BANKSEL	_SSCISTA_bits
	JNB	_SSCISTA_bits, 0
	JMP	_00043_DS_
;	op : =
;	.line	93; "../main.c"	while(SSCIACKSTA &&j<200)		//判断是否收到应答
	BANKSEL	r0x1000
	CLR	r0x1000
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00047_DS_
	BANKSEL	_SSCICTL1_bits
	JB	_SSCICTL1_bits, 6
	JMP	_00050_DS_
;	op : <
;unsigned compare: left < lit(0xC8=200), size=1
	MOV	R0,# 0xc8
	BANKSEL	r0x1000
	SUB	R0, r0x1000
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00050_DS_
;	op : +
;	.line	94; "../main.c"	{j++;}
	BANKSEL	r0x1000
	INC	r0x1000
;	op : GOTO
	JMP	_00047_DS_
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00050_DS_
;	.line	95; "../main.c"	while(!SSCIIF);
	BANKSEL	_EIF2_bits
	JB	_EIF2_bits, 0
	JMP	_00050_DS_
;	op : =
;	.line	96; "../main.c"	SSCIIF=0;
	BANKSEL	_EIF2_bits
	CLR	_EIF2_bits, 0
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _SendB



func._Stop_I2C	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Stop_I2C	;Function start
; 2 exit points
;has an exit
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_Stop_I2C	;Function start
; 2 exit points
;	op : =
;	.line	80; "../main.c"	STOPEN=1;
	BANKSEL	_SSCICTL1_bits
	SET	_SSCICTL1_bits, 2
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00032_DS_
;	.line	81; "../main.c"	while(STOPEN);
	BANKSEL	_SSCICTL1_bits
	JNB	_SSCICTL1_bits, 2
	JMP	_00032_DS_
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00035_DS_
;	.line	82; "../main.c"	while(!SSCIIF);
	BANKSEL	_EIF2_bits
	JB	_EIF2_bits, 0
	JMP	_00035_DS_
;	op : =
;	.line	83; "../main.c"	SSCIIF=0;
	BANKSEL	_EIF2_bits
	CLR	_EIF2_bits, 0
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _Stop_I2C



func._Start_I2C	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Start_I2C	;Function start
; 2 exit points
;has an exit
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_Start_I2C	;Function start
; 2 exit points
;	op : =
;	.line	71; "../main.c"	STARTEN=1;			//发送START。由硬件自动清零
	BANKSEL	_SSCICTL1_bits
	SET	_SSCICTL1_bits, 0
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00021_DS_
;	.line	72; "../main.c"	while(STARTEN);
	BANKSEL	_SSCICTL1_bits
	JNB	_SSCICTL1_bits, 0
	JMP	_00021_DS_
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00024_DS_
;	.line	73; "../main.c"	while(!SSCIIF);
	BANKSEL	_EIF2_bits
	JB	_EIF2_bits, 0
	JMP	_00024_DS_
;	op : =
;	.line	74; "../main.c"	SSCIIF=0;
	BANKSEL	_EIF2_bits
	CLR	_EIF2_bits, 0
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _Start_I2C



func._Delay_ms	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Delay_ms	;Function start
; 2 exit points
;has an exit
;7 compiler assigned registers:
;   r0x1000
;   STK00
;   r0x1001
;   r0x1002
;   r0x1003
;   r0x1004
;   r0x1005
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_Delay_ms	;Function start
; 2 exit points
;	op : RECEIVE
;	.line	40; "../main.c"	void Delay_ms(uint ms_data)
	BANKSEL	r0x1000
	MOV	r0x1000, R0
	BANKSEL	STK00
	MOVZ	R0, STK00
	BANKSEL	r0x1001
	MOV	r0x1001, R0
;	op : =
;	op : LABEL
;	op : =
_00004_DS_
;	.line	43; "../main.c"	while(ms_data--)
	BANKSEL	r0x1001
	MOVZ	R0, r0x1001
	BANKSEL	r0x1002
	MOV	r0x1002, R0
	BANKSEL	r0x1000
	MOVZ	R0, r0x1000
	BANKSEL	r0x1003
	MOV	r0x1003, R0
;	op : -
	MOV	R0,# 0xff
	BANKSEL	r0x1001
	ADD	r0x1001, R0
	JNB	PSW, 0
	JMP	_00148_DS_
	BANKSEL	r0x1000
	DEC	r0x1000
;	op : IFX
_00148_DS_
	BANKSEL	r0x1002
	MOVZ	R0, r0x1002
	BANKSEL	r0x1003
	ORL	R0, r0x1003
	JNB	PSW, 2
	JMP	_00007_DS_
;	op : =
;	.line	46; "../main.c"	while(j--)
	MOV	R0,# 0x3f
	BANKSEL	r0x1002
	MOV	r0x1002, R0
	BANKSEL	r0x1003
	CLR	r0x1003
;	op : LABEL
;	op : =
_00001_DS_
	BANKSEL	r0x1002
	MOVZ	R0, r0x1002
	BANKSEL	r0x1004
	MOV	r0x1004, R0
	BANKSEL	r0x1003
	MOVZ	R0, r0x1003
	BANKSEL	r0x1005
	MOV	r0x1005, R0
;	op : -
	MOV	R0,# 0xff
	BANKSEL	r0x1002
	ADD	r0x1002, R0
	JNB	PSW, 0
	JMP	_00149_DS_
	BANKSEL	r0x1003
	DEC	r0x1003
;	op : IFX
_00149_DS_
	BANKSEL	r0x1004
	MOVZ	R0, r0x1004
	BANKSEL	r0x1005
	ORL	R0, r0x1005
	JNB	PSW, 2
	JMP	_00004_DS_
;	op : GOTO
	JMP	_00001_DS_
;	op : LABEL
;	op : ENDFUNCTION
_00007_DS_
	CRET	
; exit point of _Delay_ms


;	code size estimation:
;	  379+  122 =   501 instructions ( 1246 byte)


	.end
