;--------------------------------------------------------
; 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:17:21 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	_iic_data_fun
	.global	_delay_ms
	.global	_int_fun0
	.global	_int_fun1
	.global	_init_mcu
	.global	_SPI
	.global	_main
	.global	_time
	.global	_time1
	.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
r0x1009	.res	1
UDL_main_1	.udata
r0x1008	.res	1
UDL_main_2	.udata
r0x100A	.res	1
UDL_main_3	.udata
r0x100B	.res	1
UDL_main_4	.udata
r0x100C	.res	1
UDL_main_5	.udata
r0x100D	.res	1
UDL_main_6	.udata
r0x100E	.res	1
UDL_main_7	.udata
r0x100F	.res	1
UDL_main_8	.udata
r0x1010	.res	1
UDL_main_9	.udata
r0x1011	.res	1
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------

ID_main_0	.idata
_time
	.db	0x00, 0x00


ID_main_1	.idata
_time1
	.db	0x00, 0x00


ID_main_2	.idata
_Freq
	.db	0x00, 0x00


ID_main_3	.idata
_Temp
	.db	0x00


ID_main_4	.idata
_ADDR
	.db	0x00


ID_main_5	.idata
_DATA
	.db	0x00


ID_main_6	.idata
_DATAcnt
	.db	0x00


ID_main_7	.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	61; "../main.c"	if(T0IF)
	BANKSEL	_INTCTL_bits
	JB	_INTCTL_bits, 2
	JMP	_00020_DS_
;	op : =
;	.line	63; "../main.c"	T0IF = 0;
	BANKSEL	_INTCTL_bits
	CLR	_INTCTL_bits, 2
;	op : =
;	.line	64; "../main.c"	T0 = 0X9C;
	MOV	R0,# 0x9c
	BANKSEL	_T0
	MOV	_T0, R0
;	op : +
;	.line	65; "../main.c"	time++;
	BANKSEL	_time
	INC	_time
	JB	PSW, 2
	JMP	_00126_DS_
	BANKSEL	_time
	INC	(_time + 1)
;	op : +
_00126_DS_
;	.line	66; "../main.c"	time1++;
	BANKSEL	_time1
	INC	_time1
	JB	PSW, 2
	JMP	_00127_DS_
	BANKSEL	_time1
	INC	(_time1 + 1)
;	op : >
_00127_DS_
;	.line	67; "../main.c"	if(time>Freq)
	BANKSEL	_time
	MOVZ	R0, (_time + 1)
	BANKSEL	_Freq
	SUB	R0, (_Freq + 1)
;comparing bytes at offset 1
	JB	PSW, 2
	JMP	_00025_DS_
	BANKSEL	_time
	MOVZ	R0, _time
	BANKSEL	_Freq
	SUB	R0, _Freq
_00025_DS_
	JNB	PSW, 0
	JMP	_00020_DS_
;	op : =
;	.line	69; "../main.c"	time=0;
	BANKSEL	_time
	CLR	_time
	BANKSEL	_time
	CLR	(_time + 1)
;	op : IFX
;	.line	70; "../main.c"	if(ON)LED4=!LED4;
	MOV	R0,# 0x00
	BANKSEL	_ON
	ORL	R0, _ON
	JNB	PSW, 2
	JMP	_00020_DS_
;	op : GET_VALUE_AT_ADDRESS
;	op : !
;	op : =
	BANKSEL	_P2LR_bits
	JB	_P2LR_bits, 0
	JMP	_00026_DS_
	BANKSEL	_P2LR_bits
	CLR	_P2LR_bits, 0
	JMP	_00020_DS_
_00026_DS_
	BANKSEL	_P2LR_bits
	SET	_P2LR_bits, 0
;	op : LABEL
;	op : ENDFUNCTION
_00020_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
_00028_DS_
;	.line	79; "../main.c"	}
	IRET	



func._main	.code
;***
;  PostBlock Stats: dbName = M
;***
;entry:  _main	;Function start
; 2 exit points
;has an exit
;functions called:
;   _init_mcu
;   _iic_data_fun
;   _delay_ms
;   _SPI
;   _delay_ms
;   _SPI
;   _SPI
;   _init_mcu
;   _iic_data_fun
;   _delay_ms
;   _SPI
;   _delay_ms
;   _SPI
;   _SPI
;5 compiler assigned registers:
;   r0x100E
;   r0x100F
;   r0x1010
;   STK00
;   r0x1011
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_main	;Function start
; 2 exit points
;	op : =
;	.line	150; "../main.c"	uchar i=0,j=0;
	BANKSEL	r0x100E
	CLR	r0x100E
;	op : =
	BANKSEL	r0x100F
	CLR	r0x100F
;	op : =
;	.line	151; "../main.c"	uchar da=0;
	BANKSEL	r0x1010
	CLR	r0x1010
;	op : CALL
;	.line	152; "../main.c"	init_mcu();
	PAGESEL	_init_mcu
	CALL	_init_mcu
	PAGESEL	$
;	op : LABEL
;	op : SEND
;	op : CALL
_00102_DS_
;	.line	156; "../main.c"	iic_data_fun(DATA);
	BANKSEL	_DATA
	MOVZ	R0, _DATA
	PAGESEL	_iic_data_fun
	CALL	_iic_data_fun
	PAGESEL	$
;	op : GET_VALUE_AT_ADDRESS
;	.line	157; "../main.c"	if(!KEY3)
	BANKSEL	_P0_bits
	JNB	_P0_bits, 3
	JMP	_00087_DS_
;	op : SEND
;	op : CALL
;	.line	159; "../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	160; "../main.c"	if(!KEY3)
	BANKSEL	_P0_bits
	JNB	_P0_bits, 3
	JMP	_00087_DS_
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00070_DS_
;	.line	162; "../main.c"	while(!KEY3);
	BANKSEL	_P0_bits
	JB	_P0_bits, 3
	JMP	_00070_DS_
;	op : +
;	.line	163; "../main.c"	i++;
	BANKSEL	r0x100E
	INC	r0x100E
;	op : >
;swapping arguments (AOP_TYPEs 1/2)
;unsigned compare: left >= lit(0x8=8), size=1
;	.line	164; "../main.c"	if(i>7)i=1;
	MOV	R0,# 0x08
	BANKSEL	r0x100E
	SUB	R0, r0x100E
;comparing bytes at offset 0
	JB	PSW, 0
	JMP	_00074_DS_
;	op : =
	MOV	R0,# 0x01
	BANKSEL	r0x100E
	MOV	r0x100E, R0
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x1=1), size=1
_00074_DS_
;	.line	165; "../main.c"	switch(i)
	MOV	R0,# 0x01
	BANKSEL	r0x100E
	SUB	R0, r0x100E
;comparing bytes at offset 0
	JB	PSW, 0
	JMP	_00083_DS_
;	op : >
;swapping arguments (AOP_TYPEs 1/2)
;unsigned compare: left >= lit(0x8=8), size=1
	MOV	R0,# 0x08
	BANKSEL	r0x100E
	SUB	R0, r0x100E
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00083_DS_
;	op : -
	BANKSEL	r0x100E
	DECR	r0x100E
	BANKSEL	r0x1011
	MOV	r0x1011, R0
;	op : JUMPTABLE
	MOV	R0,#high _00122_DS_
	MOV	PCH, R0
	MOV	R0,#_00122_DS_
	BANKSEL	r0x1011
	ADD	R0, r0x1011
	JNB	PSW, 0
	INC	PCH
	MOV	PCL, R0
_00122_DS_
	JMP	_00075_DS_
	JMP	_00076_DS_
	JMP	_00077_DS_
	JMP	_00078_DS_
	JMP	_00079_DS_
	JMP	_00080_DS_
	JMP	_00081_DS_
;	op : LABEL
;	op : =
_00075_DS_
;	.line	167; "../main.c"	case 1:da=0xE1;break;
	MOV	R0,# 0xe1
	BANKSEL	r0x1010
	MOV	r0x1010, R0
;	op : GOTO
	JMP	_00083_DS_
;	op : LABEL
;	op : =
_00076_DS_
;	.line	168; "../main.c"	case 2:da=0xE2;break;
	MOV	R0,# 0xe2
	BANKSEL	r0x1010
	MOV	r0x1010, R0
;	op : GOTO
	JMP	_00083_DS_
;	op : LABEL
;	op : =
_00077_DS_
;	.line	169; "../main.c"	case 3:da=0xE3;break;
	MOV	R0,# 0xe3
	BANKSEL	r0x1010
	MOV	r0x1010, R0
;	op : GOTO
	JMP	_00083_DS_
;	op : LABEL
;	op : =
_00078_DS_
;	.line	170; "../main.c"	case 4:da=0xE4;break;
	MOV	R0,# 0xe4
	BANKSEL	r0x1010
	MOV	r0x1010, R0
;	op : GOTO
	JMP	_00083_DS_
;	op : LABEL
;	op : =
_00079_DS_
;	.line	171; "../main.c"	case 5:da=0xE5;break;
	MOV	R0,# 0xe5
	BANKSEL	r0x1010
	MOV	r0x1010, R0
;	op : GOTO
	JMP	_00083_DS_
;	op : LABEL
;	op : =
_00080_DS_
;	.line	172; "../main.c"	case 6:da=0xE6;break;
	MOV	R0,# 0xe6
	BANKSEL	r0x1010
	MOV	r0x1010, R0
;	op : GOTO
	JMP	_00083_DS_
;	op : LABEL
;	op : =
_00081_DS_
;	.line	173; "../main.c"	case 7:da=0xE7;break;
	MOV	R0,# 0xe7
	BANKSEL	r0x1010
	MOV	r0x1010, R0
;	op : LABEL
;	op : =
_00083_DS_
;	.line	176; "../main.c"	SS=0;
	BANKSEL	_P2LR_bits
	CLR	_P2LR_bits, 1
;	op : SEND
;	op : CALL
;	.line	177; "../main.c"	DATA=SPI(da);
	BANKSEL	r0x1010
	MOVZ	R0, r0x1010
	PAGESEL	_SPI
	CALL	_SPI
	PAGESEL	$
	BANKSEL	_DATA
	MOV	_DATA, R0
;	op : =
;	.line	178; "../main.c"	SS=1;
	BANKSEL	_P2LR_bits
	SET	_P2LR_bits, 1
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00087_DS_
;	.line	183; "../main.c"	if(!KEY4)
	BANKSEL	_P0_bits
	JNB	_P0_bits, 5
	JMP	_00102_DS_
;	op : SEND
;	op : CALL
;	.line	185; "../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	186; "../main.c"	if(!KEY4)
	BANKSEL	_P0_bits
	JNB	_P0_bits, 5
	JMP	_00102_DS_
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00088_DS_
;	.line	188; "../main.c"	while(!KEY4);
	BANKSEL	_P0_bits
	JB	_P0_bits, 5
	JMP	_00088_DS_
;	op : +
;	.line	189; "../main.c"	j++;
	BANKSEL	r0x100F
	INC	r0x100F
;	op : >
;swapping arguments (AOP_TYPEs 1/2)
;unsigned compare: left >= lit(0x3=3), size=1
;	.line	190; "../main.c"	if(j>2)j=1;
	MOV	R0,# 0x03
	BANKSEL	r0x100F
	SUB	R0, r0x100F
;comparing bytes at offset 0
	JB	PSW, 0
	JMP	_00092_DS_
;	op : =
	MOV	R0,# 0x01
	BANKSEL	r0x100F
	MOV	r0x100F, R0
;	op : LABEL
;	op : EQ_OP
_00092_DS_
;	.line	191; "../main.c"	if(j==1)
	BANKSEL	r0x100F
	MOVZ	R0, r0x100F
	XOR	R0,# 0x01
	JB	PSW, 2
	JMP	_00094_DS_
;	op : =
;	.line	193; "../main.c"	SS=0;
	BANKSEL	_P2LR_bits
	CLR	_P2LR_bits, 1
;	op : SEND
;	op : CALL
;	.line	194; "../main.c"	DATA=SPI(0X55);
	MOV	R0,# 0x55
	PAGESEL	_SPI
	CALL	_SPI
	PAGESEL	$
	BANKSEL	_DATA
	MOV	_DATA, R0
;	op : =
;	.line	195; "../main.c"	SS=1;
	BANKSEL	_P2LR_bits
	SET	_P2LR_bits, 1
;	op : LABEL
;	op : EQ_OP
_00094_DS_
;	.line	197; "../main.c"	if(j==2)
	BANKSEL	r0x100F
	MOVZ	R0, r0x100F
	XOR	R0,# 0x02
	JB	PSW, 2
	JMP	_00102_DS_
;	op : =
;	.line	199; "../main.c"	SS=0;
	BANKSEL	_P2LR_bits
	CLR	_P2LR_bits, 1
;	op : SEND
;	op : CALL
;	.line	200; "../main.c"	DATA=SPI(0XAA);
	MOV	R0,# 0xaa
	PAGESEL	_SPI
	CALL	_SPI
	PAGESEL	$
	BANKSEL	_DATA
	MOV	_DATA, R0
;	op : =
;	.line	201; "../main.c"	SS=1;
	BANKSEL	_P2LR_bits
	SET	_P2LR_bits, 1
;	op : GOTO
	JMP	_00102_DS_
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _main



func._SPI	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _SPI	;Function start
; 2 exit points
;has an exit
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_SPI	;Function start
; 2 exit points
;	op : RECEIVE
;	.line	140; "../main.c"	uchar SPI(uchar d)
	BANKSEL	_SSCIBUFR
	MOV	_SSCIBUFR, R0
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00063_DS_
;	.line	143; "../main.c"	while(!SSCIIF);
	BANKSEL	_EIF2_bits
	JB	_EIF2_bits, 0
	JMP	_00063_DS_
;	op : =
;	.line	144; "../main.c"	SSCIIF=0;
	BANKSEL	_EIF2_bits
	CLR	_EIF2_bits, 0
;	op : RETURN
;	.line	145; "../main.c"	return SSCIBUFR;
	BANKSEL	_SSCIBUFR
	MOVZ	R0, _SSCIBUFR
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _SPI



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	100; "../main.c"	OSCCTL = 0x70;           //32M
	MOV	R0,# 0x70
	BANKSEL	_OSCCTL
	MOV	_OSCCTL, R0
;	op : INLINEASM
	NOP 
;	op : INLINEASM
	NOP 
;	op : =
;	.line	105; "../main.c"	TR0 = 0X2E;              //0000 0110
	MOV	R0,# 0x2e
	BANKSEL	_TR0
	MOV	_TR0, R0
;	op : =
;	.line	106; "../main.c"	TR1 = 0X02;              //0000 0011 P10为SCK，P11为SDI
	MOV	R0,# 0x02
	BANKSEL	_TR1
	MOV	_TR1, R0
;	op : =
;	.line	107; "../main.c"	TR2 = 0X00;              //0000 0000
	BANKSEL	_TR2
	CLR	_TR2
;	op : =
;	.line	108; "../main.c"	TR3 = 0X00;				 //0111 0000 P37为SDO，从机输出，P36为SS选择端，设为输入
	BANKSEL	_TR3
	CLR	_TR3
;	op : =
;	.line	110; "../main.c"	P0LR = 0Xff;             //0011 1000
	MOV	R0,# 0xff
	BANKSEL	_P0LR
	MOV	_P0LR, R0
;	op : =
;	.line	111; "../main.c"	P1LR = 0Xff;             //0000 0000
	MOV	R0,# 0xff
	BANKSEL	_P1LR
	MOV	_P1LR, R0
;	op : =
;	.line	112; "../main.c"	P2LR = 0xff;             //0011 0001
	MOV	R0,# 0xff
	BANKSEL	_P2LR
	MOV	_P2LR, R0
;	op : =
;	.line	113; "../main.c"	P3LR = 0Xff;			 //0101 0000
	MOV	R0,# 0xff
	BANKSEL	_P3LR
	MOV	_P3LR, R0
;	op : =
;	.line	116; "../main.c"	OPTR = 0X83;     //16分频，4us计数1，
	MOV	R0,# 0x83
	BANKSEL	_OPTR
	MOV	_OPTR, R0
;	op : =
;	.line	117; "../main.c"	T0 = 0X06;      //1ms定时
	MOV	R0,# 0x06
	BANKSEL	_T0
	MOV	_T0, R0
;	op : =
;	.line	118; "../main.c"	T0IE = 1;
	BANKSEL	_INTCTL_bits
	SET	_INTCTL_bits, 5
;	op : =
;	.line	119; "../main.c"	T0IF = 0;
	BANKSEL	_INTCTL_bits
	CLR	_INTCTL_bits, 2
;	op : =
;	.line	122; "../main.c"	SSCIEN=0;				//关闭SPI模块，初始化完之后再打开
	BANKSEL	_SSCICTL0_bits
	CLR	_SSCICTL0_bits, 5
;	op : =
;	.line	124; "../main.c"	SSCICTL0=0X02;			//0100
	MOV	R0,# 0x02
	BANKSEL	_SSCICTL0
	MOV	_SSCICTL0, R0
;	op : =
;	.line	125; "../main.c"	SSCICTL1=0X00;
	BANKSEL	_SSCICTL1
	CLR	_SSCICTL1
;	op : =
;	.line	126; "../main.c"	SSCISTA=0X00;
	BANKSEL	_SSCISTA
	CLR	_SSCISTA
;	op : =
;	.line	128; "../main.c"	MODE4
	BANKSEL	_SSCICTL0_bits
	SET	_SSCICTL0_bits, 4
;	op : =
	BANKSEL	_SSCISTA_bits
	SET	_SSCISTA_bits, 6
;	op : =
;	.line	130; "../main.c"	SSCIEN=1;
	BANKSEL	_SSCICTL0_bits
	SET	_SSCICTL0_bits, 5
;	op : =
;	.line	132; "../main.c"	SSCIIE=0;				//关闭SPI中断
	BANKSEL	_EIE2_bits
	CLR	_EIE2_bits, 0
;	op : =
;	.line	133; "../main.c"	SSCIIF=0;				//清零SPI中断标志
	BANKSEL	_EIF2_bits
	CLR	_EIF2_bits, 0
;	op : =
;	.line	136; "../main.c"	AIE = 1;		//打开总中断
	BANKSEL	_INTCTL_bits
	SET	_INTCTL_bits, 7
;	op : =
;	.line	137; "../main.c"	PUIE=1;			//使能所有未屏蔽的外设中断
	BANKSEL	_INTCTL_bits
	SET	_INTCTL_bits, 6
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _init_mcu



func._iic_data_fun	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _iic_data_fun	;Function start
; 2 exit points
;has an exit
;1 compiler assigned register :
;   r0x1008
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_iic_data_fun	;Function start
; 2 exit points
;	op : RECEIVE
;	.line	81; "../main.c"	void iic_data_fun(uchar control_data)
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : EQ_OP
;	.line	83; "../main.c"	switch(control_data)
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	XOR	R0,# 0x55
	JNB	PSW, 2
	JMP	_00038_DS_
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	XOR	R0,# 0xaa
	JNB	PSW, 2
	JMP	_00037_DS_
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	XOR	R0,# 0xe1
	JNB	PSW, 2
	JMP	_00030_DS_
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	XOR	R0,# 0xe2
	JNB	PSW, 2
	JMP	_00031_DS_
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	XOR	R0,# 0xe3
	JNB	PSW, 2
	JMP	_00032_DS_
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	XOR	R0,# 0xe4
	JNB	PSW, 2
	JMP	_00033_DS_
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	XOR	R0,# 0xe5
	JNB	PSW, 2
	JMP	_00034_DS_
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	XOR	R0,# 0xe6
	JNB	PSW, 2
	JMP	_00035_DS_
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	XOR	R0,# 0xe7
	JNB	PSW, 2
	JMP	_00036_DS_
	JMP	_00041_DS_
_00030_DS_
;	.line	85; "../main.c"	case 0XE1:Freq=100;break;
	MOV	R0,# 0x64
	BANKSEL	_Freq
	MOV	_Freq, R0
	BANKSEL	_Freq
	CLR	(_Freq + 1)
;	op : GOTO
	JMP	_00041_DS_
;	op : LABEL
;	op : =
_00031_DS_
;	.line	86; "../main.c"	case 0XE2:Freq=200;break;
	MOV	R0,# 0xc8
	BANKSEL	_Freq
	MOV	_Freq, R0
	BANKSEL	_Freq
	CLR	(_Freq + 1)
;	op : GOTO
	JMP	_00041_DS_
;	op : LABEL
;	op : =
_00032_DS_
;	.line	87; "../main.c"	case 0XE3:Freq=300;break;
	MOV	R0,# 0x2c
	BANKSEL	_Freq
	MOV	_Freq, R0
	MOV	R0,# 0x01
	BANKSEL	_Freq
	MOV	(_Freq + 1), R0
;	op : GOTO
	JMP	_00041_DS_
;	op : LABEL
;	op : =
_00033_DS_
;	.line	88; "../main.c"	case 0XE4:Freq=400;break;
	MOV	R0,# 0x90
	BANKSEL	_Freq
	MOV	_Freq, R0
	MOV	R0,# 0x01
	BANKSEL	_Freq
	MOV	(_Freq + 1), R0
;	op : GOTO
	JMP	_00041_DS_
;	op : LABEL
;	op : =
_00034_DS_
;	.line	89; "../main.c"	case 0XE5:Freq=500;break;
	MOV	R0,# 0xf4
	BANKSEL	_Freq
	MOV	_Freq, R0
	MOV	R0,# 0x01
	BANKSEL	_Freq
	MOV	(_Freq + 1), R0
;	op : GOTO
	JMP	_00041_DS_
;	op : LABEL
;	op : =
_00035_DS_
;	.line	90; "../main.c"	case 0XE6:Freq=600;break;
	MOV	R0,# 0x58
	BANKSEL	_Freq
	MOV	_Freq, R0
	MOV	R0,# 0x02
	BANKSEL	_Freq
	MOV	(_Freq + 1), R0
;	op : GOTO
	JMP	_00041_DS_
;	op : LABEL
;	op : =
_00036_DS_
;	.line	91; "../main.c"	case 0XE7:Freq=700;break;
	MOV	R0,# 0xbc
	BANKSEL	_Freq
	MOV	_Freq, R0
	MOV	R0,# 0x02
	BANKSEL	_Freq
	MOV	(_Freq + 1), R0
;	op : GOTO
	JMP	_00041_DS_
;	op : LABEL
;	op : =
_00037_DS_
;	.line	92; "../main.c"	case 0XAA:ON=0;LED4=1;break;
	BANKSEL	_ON
	CLR	_ON
;	op : =
	BANKSEL	_P2LR_bits
	SET	_P2LR_bits, 0
;	op : GOTO
	JMP	_00041_DS_
;	op : LABEL
;	op : =
_00038_DS_
;	.line	93; "../main.c"	case 0X55:ON=1;Freq=0;break;
	MOV	R0,# 0x01
	BANKSEL	_ON
	MOV	_ON, R0
;	op : =
	BANKSEL	_Freq
	CLR	_Freq
	BANKSEL	_Freq
	CLR	(_Freq + 1)
;	op : LABEL
;	op : ENDFUNCTION
_00041_DS_
;	.line	95; "../main.c"	}
	CRET	
; exit point of _iic_data_fun



func._delay_ms	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _delay_ms	;Function start
; 2 exit points
;has an exit
;7 compiler assigned registers:
;   r0x1008
;   STK00
;   r0x1009
;   r0x100A
;   r0x100B
;   r0x100C
;   r0x100D
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_delay_ms	;Function start
; 2 exit points
;	op : RECEIVE
;	.line	45; "../main.c"	void delay_ms(uint ms_data)
	BANKSEL	r0x1008
	MOV	r0x1008, R0
	BANKSEL	STK00
	MOVZ	R0, STK00
	BANKSEL	r0x1009
	MOV	r0x1009, R0
;	op : =
;	op : LABEL
;	op : =
_00004_DS_
;	.line	48; "../main.c"	while(ms_data--)
	BANKSEL	r0x1009
	MOVZ	R0, r0x1009
	BANKSEL	r0x100A
	MOV	r0x100A, R0
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	BANKSEL	r0x100B
	MOV	r0x100B, R0
;	op : -
	MOV	R0,# 0xff
	BANKSEL	r0x1009
	ADD	r0x1009, R0
	JNB	PSW, 0
	JMP	_00124_DS_
	BANKSEL	r0x1008
	DEC	r0x1008
;	op : IFX
_00124_DS_
	BANKSEL	r0x100A
	MOVZ	R0, r0x100A
	BANKSEL	r0x100B
	ORL	R0, r0x100B
	JNB	PSW, 2
	JMP	_00007_DS_
;	op : =
;	.line	51; "../main.c"	while(j--)
	MOV	R0,# 0x7c
	BANKSEL	r0x100A
	MOV	r0x100A, R0
	BANKSEL	r0x100B
	CLR	r0x100B
;	op : LABEL
;	op : =
_00001_DS_
	BANKSEL	r0x100A
	MOVZ	R0, r0x100A
	BANKSEL	r0x100C
	MOV	r0x100C, R0
	BANKSEL	r0x100B
	MOVZ	R0, r0x100B
	BANKSEL	r0x100D
	MOV	r0x100D, R0
;	op : -
	MOV	R0,# 0xff
	BANKSEL	r0x100A
	ADD	r0x100A, R0
	JNB	PSW, 0
	JMP	_00125_DS_
	BANKSEL	r0x100B
	DEC	r0x100B
;	op : IFX
_00125_DS_
	BANKSEL	r0x100C
	MOVZ	R0, r0x100C
	BANKSEL	r0x100D
	ORL	R0, r0x100D
	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:
;	  319+  141 =   460 instructions ( 1202 byte)


	.end
