;--------------------------------------------------------
; File Created by ChiponCC : aolisn inc.
; Version 3.0.4#6752 (Mar  1 2016 15:13:08) (MSVC)
; This file was generated Thu Apr 28 17:38:10 2016
;--------------------------------------------------------
; chipon port for the 16-bit core
;--------------------------------------------------------
;	.file	"../debug_touch.c"
	.radix dec
	.include "KF8S1011.inc"
;--------------------------------------------------------
; external declarations
;--------------------------------------------------------
	.extern	_init_mcu
	.extern	__KF8S_Get_Ver_Waterproof_
	.extern	__KF8S_Lib_Set_Waterproof_Parameter
	.extern	__KF8S_Init_Touch_Waterproof_
	.extern	__KF8S_Touch_Process_Waterproof_
	.extern	__KF8S_Touch_TEST_Waterproof_
	.extern	_delay_ms
	.extern	_delay_us
	.extern	__R2PCL
	.extern	_PSW_bits
	.extern	_P0_bits
	.extern	_P2_bits
	.extern	_P1_bits
	.extern	_P3_bits
	.extern	_P4_bits
	.extern	_INTCTL_bits
	.extern	_EIF1_bits
	.extern	_EIF2_bits
	.extern	_T1CTL_bits
	.extern	_PWMCTL_bits
	.extern	_CMCTL1_bits
	.extern	_ANSEH_bits
	.extern	_ADCCTL0_bits
	.extern	_OPTR_bits
	.extern	_TR0_bits
	.extern	_TR2_bits
	.extern	_TR1_bits
	.extern	_TR3_bits
	.extern	_TR4_bits
	.extern	_EIE1_bits
	.extern	_EIE2_bits
	.extern	_PCTL_bits
	.extern	_OSCCTL_bits
	.extern	_ANSEL_bits
	.extern	_PUR_bits
	.extern	_IOCL_bits
	.extern	_ADCCTL1_bits
	.extern	_T3L_bits
	.extern	_CTCTL_bits
	.extern	_RSCTL_bits
	.extern	_OSCLDOCAL_bits
	.extern	_BRCTL_bits
	.extern	_TSCTL_bits
	.extern	_EUBRGL_bits
	.extern	_EUBRGH_bits
	.extern	__KF8_LIBi_channel_flag_
	.extern	__KF8_LIBc_channel_
	.extern	__KF8_LIBc_channel_Buf
	.extern	__KF8_LIBi_Date_Change_
	.extern	__KF8_LIBc_baseline_count_
	.extern	__KF8_LIBi_buff_hit_
	.extern	__KF8_LIBi_buff_baseline_
	.extern	__KF8_LIBc_touch_count_
	.extern	_CHS_AMOUNT
	.extern	_TCS_AMOUNT
	.extern	__KF8_Disturb_Protect_Circle_
	.extern	__KF8_DoubleKey_Compages_Limitable_Circle_
	.extern	__KF8_Key_Max_Pressed_Limitable_Circle_
	.extern	__KF8_BaseLine_Update_Circle_Count_For_UP_
	.extern	__KF8_BaseLine_Update_Circle_Count_For_Down_
	.extern	__KF8_Define_Disturb_Channels_Amount_
	.extern	__KF8_BasicLine_UP_Noise_Threshold_
	.extern	__KF8_BasicLine_Down_Noise_Threshold_
	.extern	__KF8_Data_Steady_Threshold_Set_
	.extern	__KF8_Inside_Reference_Channel_Disturb_Threshold_Set_
	.extern	__KF8_Inside_Reference_Channel_Declare_
	.extern	__KF8_Config_Finger_Threshold
	.extern	__KF8_CONFIG_FINGER_THRESHOLD_IN_WATER_
	.extern	_Double_Key_SET_EN_1
	.extern	_Double_Key_SET_EN_2
	.extern	_Double_Key_SET_EN_3
	.extern	__KF8_TOUCH_CH_EN
	.extern	_T0
	.extern	_PCL
	.extern	_PSW
	.extern	_P0
	.extern	_P2
	.extern	_P1
	.extern	_P3
	.extern	_P4
	.extern	_PCH
	.extern	_INTCTL
	.extern	_EIF1
	.extern	_EIF2
	.extern	_T1L
	.extern	_T1H
	.extern	_T1CTL
	.extern	_PWMCTL
	.extern	_CMCTL1
	.extern	_VRECAL
	.extern	_ANSEH
	.extern	_ADCDATAH
	.extern	_ADCCTL0
	.extern	_OPTR
	.extern	_TR0
	.extern	_TR2
	.extern	_TR1
	.extern	_TR3
	.extern	_TR4
	.extern	_EIE1
	.extern	_EIE2
	.extern	_PCTL
	.extern	_OSCCTL
	.extern	_OSCCAL0
	.extern	_ANSEL
	.extern	_PUR
	.extern	_IOCL
	.extern	_OSCCAL1
	.extern	_BADDRH
	.extern	_BADDRL
	.extern	_EECTL1
	.extern	_EECTL2
	.extern	_ADCDATAL
	.extern	_ADCCTL1
	.extern	_T3L
	.extern	_CTCTL
	.extern	_RSCTL
	.extern	_TXSDR
	.extern	_RXSDR
	.extern	_OSCLDOCAL
	.extern	_T1U
	.extern	_BRCTL
	.extern	_TSCTL
	.extern	_EUBRGL
	.extern	_EUBRGH

	.extern STK12
	.extern STK11
	.extern STK10
	.extern STK09
	.extern STK08
	.extern STK07
	.extern STK06
	.extern STK05
	.extern STK04
	.extern STK03
	.extern STK02
	.extern STK01
	.extern STK00
;--------------------------------------------------------
; global declarations
;--------------------------------------------------------
	.global	_TOUCH_DEBUG_SEND_OUT
	.global	_TOUCH_DEBUG_TRS_DEAL
	.global	_TOUCH_CH_TRS_EN
	.global	_T_buf
	.global	_i_T_D
	.global	_sentbuf1
	.global	_sentbuf2
	.global	_sentbuf3
	.global	_sentbuf4

;--------------------------------------------------------
; global definitions
;--------------------------------------------------------
UD_debug_touch_0	.udata
_T_buf	.res	1

UD_debug_touch_1	.udata
_i_T_D	.res	1

UD_debug_touch_2	.udata
_sentbuf1	.res	1

UD_debug_touch_3	.udata
_sentbuf2	.res	1

UD_debug_touch_4	.udata
_sentbuf3	.res	1

UD_debug_touch_5	.udata
_sentbuf4	.res	1

;--------------------------------------------------------
; absolute symbol definitions
;--------------------------------------------------------
;--------------------------------------------------------
; compiler-defined variables
;--------------------------------------------------------
UDL_debug_touch_0	.udata
r0x1008	.res	1
UDL_debug_touch_1	.udata
r0x1009	.res	1
UDL_debug_touch_2	.udata
r0x1006	.res	1
UDL_debug_touch_3	.udata
r0x1007	.res	1
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------

ID_debug_touch_0	.idata
_TOUCH_CH_TRS_EN
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00
	.db	0x00

;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
;	.udata_ovr


func._TOUCH_DEBUG_SEND_OUT	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _TOUCH_DEBUG_SEND_OUT	;Function start
; 2 exit points
;has an exit
;functions called:
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;3 compiler assigned registers:
;   STK00
;   r0x1006
;   r0x1007
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_TOUCH_DEBUG_SEND_OUT	;Function start
; 2 exit points
;	op : =
;	.line	322; "../debug_touch.c"	CLK_SET_IN;
	SET	_TR0_bits, 1
;	op : =
;	.line	323; "../debug_touch.c"	DAT_SET_IN;
	SET	_TR0_bits, 0
;	op : SEND
;	op : CALL
;	.line	324; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : GET_VALUE_AT_ADDRESS
;	.line	328; "../debug_touch.c"	if(CLK_GET_STATE)
	JB	_P0_bits, 1
	JMP	_00078_DS_
;	op : SEND
;	op : CALL
;	.line	330; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : GET_VALUE_AT_ADDRESS
;	.line	331; "../debug_touch.c"	if(!CLK_GET_STATE)
	JNB	_P0_bits, 1
	JMP	_00079_DS_
;	op : RETURN
;	.line	332; "../debug_touch.c"	return;
	JMP	_00116_DS_
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00078_DS_
;	.line	334; "../debug_touch.c"	else if(!CLK_GET_STATE)
	JNB	_P0_bits, 1
	JMP	_00075_DS_
;	op : RETURN
;	.line	336; "../debug_touch.c"	return;
	JMP	_00116_DS_
;	op : LABEL
;	op : RETURN
_00075_DS_
;	.line	339; "../debug_touch.c"	return;
	JMP	_00116_DS_
;	op : LABEL
;	op : =
_00079_DS_
;	.line	341; "../debug_touch.c"	CLK_SET_OUT;
	CLR	_TR0_bits, 1
;	op : =
;	.line	343; "../debug_touch.c"	CLK_SET_LOW;
	CLR	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	344; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : =
;	.line	346; "../debug_touch.c"	CLK_SET_HIGH;		//上升沿
	SET	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	348; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
;	.line	350; "../debug_touch.c"	if(!DAT_GET_STATE)
	PAGESEL	$
;	.line	352; "../debug_touch.c"	return;
	JB	_P0_bits, 0
;	.line	355; "../debug_touch.c"	CLK_SET_LOW;			//下降沿
	JMP	_00116_DS_
	CLR	_P0_bits, 1
;	.line	358; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : =
;	.line	360; "../debug_touch.c"	DAT_SET_OUT;
	CLR	_TR0_bits, 0
;	op : =
;	.line	363; "../debug_touch.c"	j=5;
	MOV	R0,# 0x05
	BANKSEL	r0x1006
	MOV	r0x1006, R0
;	op : =
;	.line	365; "../debug_touch.c"	for(step=0;step<5;step++)
	BANKSEL	r0x1007
	CLR	r0x1007
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x5=5), size=1
_00108_DS_
	MOV	R0,# 0x05
	BANKSEL	r0x1007
	SUB	R0, r0x1007
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00111_DS_
;	op : >
;swapping arguments (AOP_TYPEs 1/2)
;unsigned compare: left >= lit(0x5=5), size=1
;	.line	368; "../debug_touch.c"	switch(step)
	MOV	R0,# 0x05
	BANKSEL	r0x1007
	SUB	R0, r0x1007
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00087_DS_
;	op : JUMPTABLE
	MOV	R0,#high _00138_DS_
	MOV	PCH, R0
	MOV	R0,#_00138_DS_
	BANKSEL	r0x1007
	ADD	R0, r0x1007
	JNB	PSW, 0
	INC	PCH
	MOV	PCL, R0
_00138_DS_
	JMP	_00082_DS_
	JMP	_00083_DS_
	JMP	_00084_DS_
	JMP	_00085_DS_
	JMP	_00086_DS_
;	op : LABEL
;	op : =
_00082_DS_
;	.line	372; "../debug_touch.c"	j=5;
	MOV	R0,# 0x05
	BANKSEL	r0x1006
	MOV	r0x1006, R0
;	op : =
;	.line	373; "../debug_touch.c"	T_buf=0x04;
	MOV	R0,# 0x04
	BANKSEL	_T_buf
	MOV	_T_buf, R0
;	op : GOTO
;	.line	374; "../debug_touch.c"	}break;
	JMP	_00087_DS_
;	op : LABEL
;	op : =
_00083_DS_
;	.line	378; "../debug_touch.c"	j=8;
	MOV	R0,# 0x08
	BANKSEL	r0x1006
	MOV	r0x1006, R0
;	op : =
;	.line	380; "../debug_touch.c"	T_buf=sentbuf1;
	BANKSEL	_sentbuf1
	MOVZ	R0, _sentbuf1
	BANKSEL	_T_buf
	MOV	_T_buf, R0
;	op : GOTO
;	.line	382; "../debug_touch.c"	}break;
	JMP	_00087_DS_
;	op : LABEL
;	op : =
_00084_DS_
;	.line	386; "../debug_touch.c"	j=8;
	MOV	R0,# 0x08
	BANKSEL	r0x1006
	MOV	r0x1006, R0
;	op : =
;	.line	387; "../debug_touch.c"	T_buf=sentbuf2;
	BANKSEL	_sentbuf2
	MOVZ	R0, _sentbuf2
	BANKSEL	_T_buf
	MOV	_T_buf, R0
;	op : GOTO
;	.line	389; "../debug_touch.c"	}break;
	JMP	_00087_DS_
;	op : LABEL
;	op : =
_00085_DS_
;	.line	393; "../debug_touch.c"	j=8;
	MOV	R0,# 0x08
	BANKSEL	r0x1006
	MOV	r0x1006, R0
;	op : =
;	.line	394; "../debug_touch.c"	T_buf=sentbuf3;
	BANKSEL	_sentbuf3
	MOVZ	R0, _sentbuf3
	BANKSEL	_T_buf
	MOV	_T_buf, R0
;	op : GOTO
;	.line	395; "../debug_touch.c"	}break;
	JMP	_00087_DS_
;	op : LABEL
;	op : =
_00086_DS_
;	.line	399; "../debug_touch.c"	j=8;
	MOV	R0,# 0x08
	BANKSEL	r0x1006
	MOV	r0x1006, R0
;	op : =
;	.line	400; "../debug_touch.c"	T_buf=sentbuf4;
	BANKSEL	_sentbuf4
	MOVZ	R0, _sentbuf4
	BANKSEL	_T_buf
	MOV	_T_buf, R0
;	op : LABEL
;	op : =
_00087_DS_
;	.line	404; "../debug_touch.c"	for(i_T_D=0;i_T_D<j;i_T_D++)
	BANKSEL	_i_T_D
	CLR	_i_T_D
;	op : LABEL
;	op : <
_00104_DS_
	BANKSEL	r0x1006
	MOVZ	R0, r0x1006
	BANKSEL	_i_T_D
	SUB	R0, _i_T_D
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00107_DS_
;	op : BITWISEAND
;	.line	406; "../debug_touch.c"	if(T_buf&0x01)
	BANKSEL	_T_buf
	JB	_T_buf, 0
	JMP	_00089_DS_
;	op : =
;	.line	407; "../debug_touch.c"	DAT_SET_HIGH;
	SET	_P0_bits, 0
;	op : GOTO
	JMP	_00090_DS_
;	op : LABEL
;	op : =
_00089_DS_
;	.line	409; "../debug_touch.c"	DAT_SET_LOW;
	CLR	_P0_bits, 0
;	op : LABEL
;	op : =
_00090_DS_
;	.line	411; "../debug_touch.c"	CLK_SET_HIGH;
	SET	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	412; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : =
;	.line	414; "../debug_touch.c"	CLK_SET_LOW;
	CLR	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	415; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : RIGHT_OP
;	.line	417; "../debug_touch.c"	T_buf=T_buf>>1;
	CLR	PSW, 0
	BANKSEL	_T_buf
	RRC	_T_buf
;	op : +
;	.line	404; "../debug_touch.c"	for(i_T_D=0;i_T_D<j;i_T_D++)
	BANKSEL	_i_T_D
	INC	_i_T_D
;	op : GOTO
	JMP	_00104_DS_
;	op : LABEL
;	op : SEND
;	op : CALL
_00107_DS_
;	.line	420; "../debug_touch.c"	Touch_Delay2;
	MOV	R0,# 0x6e
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : +
;	.line	365; "../debug_touch.c"	for(step=0;step<5;step++)
	BANKSEL	r0x1007
	INC	r0x1007
;	op : GOTO
	JMP	_00108_DS_
;	op : LABEL
;	op : =
_00111_DS_
;	.line	424; "../debug_touch.c"	DAT_SET_IN;
	SET	_TR0_bits, 0
;	op : SEND
;	op : CALL
;	.line	425; "../debug_touch.c"	Touch_Delay2;	//编程器判断需要时间
	MOV	R0,# 0x6e
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : =
;	.line	427; "../debug_touch.c"	CLK_SET_HIGH;
	SET	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	428; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	429; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	430; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : GET_VALUE_AT_ADDRESS
;	.line	433; "../debug_touch.c"	if(DAT_GET_STATE)
	JB	_P0_bits, 0
	JMP	_00102_DS_
;	op : =
;	.line	435; "../debug_touch.c"	CLK_SET_LOW;
	CLR	_P0_bits, 1
;	op : =
;	.line	436; "../debug_touch.c"	T_buf=0;
	BANKSEL	_T_buf
	CLR	_T_buf
;	op : SEND
;	op : CALL
;	.line	437; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : =
;	.line	438; "../debug_touch.c"	for(i_T_D=0;i_T_D<6;i_T_D++)
	BANKSEL	_i_T_D
	CLR	_i_T_D
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x6=6), size=1
_00112_DS_
	MOV	R0,# 0x06
	BANKSEL	_i_T_D
	SUB	R0, _i_T_D
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00103_DS_
;	op : =
;	.line	440; "../debug_touch.c"	CLK_SET_HIGH;
	SET	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	441; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : EQ_OP
;	.line	443; "../debug_touch.c"	if(i_T_D!=5)
	BANKSEL	_i_T_D
	MOVZ	R0, _i_T_D
;	.line	445; "../debug_touch.c"	T_buf=T_buf>>1;
	XOR	R0,# 0x05
	JNB	PSW, 2
	JMP	_00099_DS_
	CLR	PSW, 0
	BANKSEL	_T_buf
	RRC	_T_buf
;	op : GET_VALUE_AT_ADDRESS
;	.line	446; "../debug_touch.c"	if(DAT_GET_STATE)
	JB	_P0_bits, 0
	JMP	_00100_DS_
;	op : |
;	.line	447; "../debug_touch.c"	T_buf=T_buf|0x10;
	BANKSEL	_T_buf
	SET	_T_buf, 4
;	op : GOTO
	JMP	_00100_DS_
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x10=16), size=1
_00099_DS_
;	.line	451; "../debug_touch.c"	if(T_buf<16)   //传输错误的，防下非影响其他数据
	MOV	R0,# 0x10
	BANKSEL	_T_buf
	SUB	R0, _T_buf
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00100_DS_
;	op : GET_VALUE_AT_ADDRESS
;	.line	453; "../debug_touch.c"	if(DAT_GET_STATE)
	JB	_P0_bits, 0
	JMP	_00094_DS_
;	op : INLINEASM
	BANKSEL _T_buf
	MOV R0,_T_buf
	ADD R0,#(_TOUCH_CH_TRS_EN+0)
	MOV R1,#0x01
	BANKSEL _TOUCH_CH_TRS_EN
	ST [R0],R1
	
;	op : GOTO
	JMP	_00100_DS_
;	op : LABEL
;	op : INLINEASM
_00094_DS_
	BANKSEL _T_buf
	MOV R0,_T_buf
	ADD R0,#(_TOUCH_CH_TRS_EN+0)
	MOV R1,#0x00
	BANKSEL _TOUCH_CH_TRS_EN
	ST [R0],R1
	
;	op : LABEL
;	op : =
_00100_DS_
;	.line	479; "../debug_touch.c"	CLK_SET_LOW;
	CLR	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	480; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : +
;	.line	438; "../debug_touch.c"	for(i_T_D=0;i_T_D<6;i_T_D++)
	BANKSEL	_i_T_D
	INC	_i_T_D
;	op : GOTO
	JMP	_00112_DS_
;	op : LABEL
;	op : =
_00102_DS_
;	.line	485; "../debug_touch.c"	CLK_SET_LOW;
	CLR	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	486; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : LABEL
;	op : =
_00103_DS_
;	.line	489; "../debug_touch.c"	CLK_SET_IN;
	SET	_TR0_bits, 1
;	op : =
;	.line	490; "../debug_touch.c"	DAT_SET_IN;
	SET	_TR0_bits, 0
;	op : LABEL
;	op : ENDFUNCTION
_00116_DS_
	CRET	
; exit point of _TOUCH_DEBUG_SEND_OUT



func._TOUCH_DEBUG_TRS_DEAL	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _TOUCH_DEBUG_TRS_DEAL	;Function start
; 2 exit points
;has an exit
;functions called:
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;   _delay_us
;3 compiler assigned registers:
;   STK00
;   r0x1008
;   r0x1009
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_TOUCH_DEBUG_TRS_DEAL	;Function start
; 2 exit points
;	op : INLINEASM
	MOV R1,#High(__KF8_TOUCH_CH_EN+0)
	MOV R0,#(0)
	ADD R0,#Low(__KF8_TOUCH_CH_EN+0)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCL
	CALL __R2PCL
	PAGESEL $
	ADD R0,#(_TOUCH_CH_TRS_EN+0)
	MOV R1,#0x01
	BANKSEL _TOUCH_CH_TRS_EN
	ST [R0],R1
	
;	op : INLINEASM
	BANKSEL __KF8_LIBc_channel_
	MOV R0,__KF8_LIBc_channel_
	ADD R0,#Low(__KF8_TOUCH_CH_EN+0)
	MOV R1,#High(__KF8_TOUCH_CH_EN+0)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCL
	CALL __R2PCL
	PAGESEL $
	ADD R0,#(_TOUCH_CH_TRS_EN+0)
	BANKSEL _TOUCH_CH_TRS_EN
	LD R1,[R0]
	XOR R1,#0x00
	JNB PSW,2
	JMP Label_x_y_z_a
	
;	op : =
;	.line	64; "../debug_touch.c"	CLK_SET_IN;
	SET	_TR0_bits, 1
;	op : =
;	.line	65; "../debug_touch.c"	DAT_SET_IN;
	SET	_TR0_bits, 0
;	op : SEND
;	op : CALL
;	.line	66; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : GET_VALUE_AT_ADDRESS
;	.line	70; "../debug_touch.c"	if(CLK_GET_STATE)
	JB	_P0_bits, 1
	JMP	_00007_DS_
;	op : SEND
;	op : CALL
;	.line	72; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : GET_VALUE_AT_ADDRESS
;	.line	73; "../debug_touch.c"	if(!CLK_GET_STATE)
	JNB	_P0_bits, 1
	JMP	_00008_DS_
;	op : RETURN
;	.line	74; "../debug_touch.c"	return;
	JMP	_00045_DS_
;	op : LABEL
;	op : GET_VALUE_AT_ADDRESS
_00007_DS_
;	.line	76; "../debug_touch.c"	else if(!CLK_GET_STATE)
	JNB	_P0_bits, 1
	JMP	_00004_DS_
;	op : RETURN
;	.line	78; "../debug_touch.c"	return;
	JMP	_00045_DS_
;	op : LABEL
;	op : RETURN
_00004_DS_
;	.line	81; "../debug_touch.c"	return;
	JMP	_00045_DS_
;	op : LABEL
;	op : =
_00008_DS_
;	.line	83; "../debug_touch.c"	CLK_SET_OUT;
	CLR	_TR0_bits, 1
;	op : =
;	.line	85; "../debug_touch.c"	CLK_SET_LOW;
	CLR	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	86; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : =
;	.line	88; "../debug_touch.c"	CLK_SET_HIGH;		//上升沿
	SET	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	90; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
;	.line	92; "../debug_touch.c"	if(!DAT_GET_STATE)
	PAGESEL	$
;	.line	94; "../debug_touch.c"	return;
	JB	_P0_bits, 0
;	.line	97; "../debug_touch.c"	CLK_SET_LOW;			//下降沿
	JMP	_00045_DS_
	CLR	_P0_bits, 1
;	.line	101; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : =
;	.line	102; "../debug_touch.c"	DAT_SET_OUT;
	CLR	_TR0_bits, 0
;	op : =
;	.line	104; "../debug_touch.c"	j=5;
	MOV	R0,# 0x05
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : =
;	.line	106; "../debug_touch.c"	for(step=0;step<5;step++)
	BANKSEL	r0x1009
	CLR	r0x1009
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x5=5), size=1
_00037_DS_
	MOV	R0,# 0x05
	BANKSEL	r0x1009
	SUB	R0, r0x1009
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00040_DS_
;	op : >
;swapping arguments (AOP_TYPEs 1/2)
;unsigned compare: left >= lit(0x5=5), size=1
;	.line	109; "../debug_touch.c"	switch(step)
	MOV	R0,# 0x05
	BANKSEL	r0x1009
	SUB	R0, r0x1009
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00016_DS_
;	op : JUMPTABLE
	MOV	R0,#high _00067_DS_
	MOV	PCH, R0
	MOV	R0,#_00067_DS_
	BANKSEL	r0x1009
	ADD	R0, r0x1009
	JNB	PSW, 0
	INC	PCH
	MOV	PCL, R0
_00067_DS_
	JMP	_00011_DS_
	JMP	_00012_DS_
	JMP	_00013_DS_
	JMP	_00014_DS_
	JMP	_00015_DS_
;	op : LABEL
;	op : =
_00011_DS_
;	.line	113; "../debug_touch.c"	j=5;
	MOV	R0,# 0x05
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : INLINEASM
	BANKSEL __KF8_LIBc_channel_
	MOV R0, __KF8_LIBc_channel_
	ADD R0,#Low(__KF8_TOUCH_CH_EN+0)
	MOV R1,#High(__KF8_TOUCH_CH_EN+0)
	JNB PSW,0
	INC R1
	MOV PCH,R1
	PAGESEL __R2PCL
	CALL __R2PCL
	PAGESEL $
	BANKSEL _T_buf
	MOV _T_buf,R0
	
;	op : GOTO
;	.line	132; "../debug_touch.c"	}break;
	JMP	_00016_DS_
;	op : LABEL
;	op : =
_00012_DS_
;	.line	136; "../debug_touch.c"	j=8;
	MOV	R0,# 0x08
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : INLINEASM
	BANKSEL __KF8_LIBc_channel_
	CLR PSW,0
	RLCR __KF8_LIBc_channel_
	BANKSEL __KF8_LIBi_buff_baseline_
	ADD R0,#(__KF8_LIBi_buff_baseline_+0)
	LD R1,[R0]
	BANKSEL _T_buf
	MOV _T_buf,R1
	
;	op : GOTO
;	.line	151; "../debug_touch.c"	}break;
	JMP	_00016_DS_
;	op : LABEL
;	op : =
_00013_DS_
;	.line	155; "../debug_touch.c"	j=8;
	MOV	R0,# 0x08
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : INLINEASM
	BANKSEL __KF8_LIBc_channel_
	CLR PSW,0
	RLCR __KF8_LIBc_channel_
	BANKSEL __KF8_LIBi_buff_baseline_
	ADD R0,#(__KF8_LIBi_buff_baseline_+1)
	LD R1,[R0]
	BANKSEL _T_buf
	MOV _T_buf,R1
	
;	op : GOTO
;	.line	172; "../debug_touch.c"	}break;
	JMP	_00016_DS_
;	op : LABEL
;	op : =
_00014_DS_
;	.line	176; "../debug_touch.c"	j=8;
	MOV	R0,# 0x08
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : INLINEASM
	BANKSEL __KF8_LIBc_channel_
	CLR PSW,0
	RLCR __KF8_LIBc_channel_
	BANKSEL __KF8_LIBi_buff_hit_
	ADD R0,#(__KF8_LIBi_buff_hit_+0)
	LD R1,[R0]
	BANKSEL _T_buf
	MOV _T_buf,R1
	
;	op : GOTO
;	.line	192; "../debug_touch.c"	}break;
	JMP	_00016_DS_
;	op : LABEL
;	op : =
_00015_DS_
;	.line	196; "../debug_touch.c"	j=8;
	MOV	R0,# 0x08
	BANKSEL	r0x1008
	MOV	r0x1008, R0
;	op : INLINEASM
	BANKSEL __KF8_LIBc_channel_
	CLR PSW,0
	RLCR __KF8_LIBc_channel_
	BANKSEL __KF8_LIBi_buff_hit_
	ADD R0,#(__KF8_LIBi_buff_hit_+1)
	LD R1,[R0]
	BANKSEL _T_buf
	MOV _T_buf,R1
	
;	op : LABEL
;	op : =
_00016_DS_
;	.line	214; "../debug_touch.c"	for(i_T_D=0;i_T_D<j;i_T_D++)
	BANKSEL	_i_T_D
	CLR	_i_T_D
;	op : LABEL
;	op : <
_00033_DS_
	BANKSEL	r0x1008
	MOVZ	R0, r0x1008
	BANKSEL	_i_T_D
	SUB	R0, _i_T_D
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00036_DS_
;	op : BITWISEAND
;	.line	216; "../debug_touch.c"	if(T_buf&0x01)
	BANKSEL	_T_buf
	JB	_T_buf, 0
	JMP	_00018_DS_
;	op : =
;	.line	217; "../debug_touch.c"	DAT_SET_HIGH;
	SET	_P0_bits, 0
;	op : GOTO
	JMP	_00019_DS_
;	op : LABEL
;	op : =
_00018_DS_
;	.line	219; "../debug_touch.c"	DAT_SET_LOW;
	CLR	_P0_bits, 0
;	op : LABEL
;	op : =
_00019_DS_
;	.line	221; "../debug_touch.c"	CLK_SET_HIGH;
	SET	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	222; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : =
;	.line	224; "../debug_touch.c"	CLK_SET_LOW;
	CLR	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	225; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : RIGHT_OP
;	.line	227; "../debug_touch.c"	T_buf=T_buf>>1;
	CLR	PSW, 0
	BANKSEL	_T_buf
	RRC	_T_buf
;	op : +
;	.line	214; "../debug_touch.c"	for(i_T_D=0;i_T_D<j;i_T_D++)
	BANKSEL	_i_T_D
	INC	_i_T_D
;	op : GOTO
	JMP	_00033_DS_
;	op : LABEL
;	op : SEND
;	op : CALL
_00036_DS_
;	.line	230; "../debug_touch.c"	Touch_Delay2;
	MOV	R0,# 0x6e
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : +
;	.line	106; "../debug_touch.c"	for(step=0;step<5;step++)
	BANKSEL	r0x1009
	INC	r0x1009
;	op : GOTO
	JMP	_00037_DS_
;	op : LABEL
;	op : =
_00040_DS_
;	.line	234; "../debug_touch.c"	DAT_SET_IN;
	SET	_TR0_bits, 0
;	op : SEND
;	op : CALL
;	.line	235; "../debug_touch.c"	Touch_Delay2;	//编程器判断需要时间
	MOV	R0,# 0x6e
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : =
;	.line	237; "../debug_touch.c"	CLK_SET_HIGH;
	SET	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	238; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	239; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	240; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : GET_VALUE_AT_ADDRESS
;	.line	243; "../debug_touch.c"	if(DAT_GET_STATE)
	JB	_P0_bits, 0
	JMP	_00031_DS_
;	op : =
;	.line	245; "../debug_touch.c"	CLK_SET_LOW;
	CLR	_P0_bits, 1
;	op : =
;	.line	246; "../debug_touch.c"	T_buf=0;
	BANKSEL	_T_buf
	CLR	_T_buf
;	op : SEND
;	op : CALL
;	.line	247; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : =
;	.line	248; "../debug_touch.c"	for(i_T_D=0;i_T_D<6;i_T_D++)
	BANKSEL	_i_T_D
	CLR	_i_T_D
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x6=6), size=1
_00041_DS_
	MOV	R0,# 0x06
	BANKSEL	_i_T_D
	SUB	R0, _i_T_D
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00032_DS_
;	op : =
;	.line	250; "../debug_touch.c"	CLK_SET_HIGH;
	SET	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	251; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : EQ_OP
;	.line	253; "../debug_touch.c"	if(i_T_D!=5)
	BANKSEL	_i_T_D
	MOVZ	R0, _i_T_D
;	.line	255; "../debug_touch.c"	T_buf=T_buf>>1;
	XOR	R0,# 0x05
	JNB	PSW, 2
	JMP	_00028_DS_
	CLR	PSW, 0
	BANKSEL	_T_buf
	RRC	_T_buf
;	op : GET_VALUE_AT_ADDRESS
;	.line	256; "../debug_touch.c"	if(DAT_GET_STATE)
	JB	_P0_bits, 0
	JMP	_00029_DS_
;	op : |
;	.line	257; "../debug_touch.c"	T_buf=T_buf|0x10;
	BANKSEL	_T_buf
	SET	_T_buf, 4
;	op : GOTO
	JMP	_00029_DS_
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x10=16), size=1
_00028_DS_
;	.line	261; "../debug_touch.c"	if(T_buf<16)   //传输错误的，防下非影响其他数据
	MOV	R0,# 0x10
	BANKSEL	_T_buf
	SUB	R0, _T_buf
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00029_DS_
;	op : GET_VALUE_AT_ADDRESS
;	.line	263; "../debug_touch.c"	if(DAT_GET_STATE)
	JB	_P0_bits, 0
	JMP	_00023_DS_
;	op : INLINEASM
	BANKSEL _T_buf
	MOV R0,_T_buf
	ADD R0,#(_TOUCH_CH_TRS_EN+0)
	MOV R1,#0x01
	BANKSEL _TOUCH_CH_TRS_EN
	ST [R0],R1
	
;	op : GOTO
	JMP	_00029_DS_
;	op : LABEL
;	op : INLINEASM
_00023_DS_
	BANKSEL _T_buf
	MOV R0,_T_buf
	ADD R0,#(_TOUCH_CH_TRS_EN+0)
	MOV R1,#0x00
	BANKSEL _TOUCH_CH_TRS_EN
	ST [R0],R1
	
;	op : LABEL
;	op : =
_00029_DS_
;	.line	289; "../debug_touch.c"	CLK_SET_LOW;
	CLR	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	290; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : +
;	.line	248; "../debug_touch.c"	for(i_T_D=0;i_T_D<6;i_T_D++)
	BANKSEL	_i_T_D
	INC	_i_T_D
;	op : GOTO
	JMP	_00041_DS_
;	op : LABEL
;	op : =
_00031_DS_
;	.line	295; "../debug_touch.c"	CLK_SET_LOW;
	CLR	_P0_bits, 1
;	op : SEND
;	op : CALL
;	.line	296; "../debug_touch.c"	Touch_Delay1;
	MOV	R0,# 0x05
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x00
	PAGESEL	_delay_us
	CALL	_delay_us
	PAGESEL	$
;	op : LABEL
;	op : =
_00032_DS_
;	.line	299; "../debug_touch.c"	CLK_SET_IN;
	SET	_TR0_bits, 1
;	op : =
;	.line	300; "../debug_touch.c"	DAT_SET_IN;
	SET	_TR0_bits, 0
;	op : INLINEASM
Label_x_y_z_a:
	
;	op : LABEL
;	op : ENDFUNCTION
_00045_DS_
	CRET	
; exit point of _TOUCH_DEBUG_TRS_DEAL


;	code size estimation:
;	  420+   91 =   511 instructions ( 1204 byte)


	.end
