;--------------------------------------------------------
; File Created by ChiponCC : ChipON  inc.
; Version 3.0.4#6752 (Jul 10 2019 19:07:19) (MSVC)
; This file was generated Tue Sep 24 17:05:12 2019
;--------------------------------------------------------
; chipon port for the 16-bit core
;--------------------------------------------------------
;	.file	"../UART.c"
	.radix dec
	.include "KF8A100FTN.inc"
;--------------------------------------------------------
; external declarations
;--------------------------------------------------------
	.extern	_Init_osc
	.extern	_Init_GPIO
	.extern	_Init_intrup
	.extern	_send_head
	.extern	_send_one_byte
	.extern	_test_new_pag
	.extern	_Delay_2us_loop
	.extern	_Delay_10us_loop
	.extern	_Delay_ms_loop
	.extern	_STKR0
	.extern	_STK00
	.extern	_STK01
	.extern	_STK02
	.extern	_STK03
	.extern	_STK04
	.extern	_STK05
	.extern	_STK06
	.extern	_STK07
	.extern	_STK08
	.extern	_STK09
	.extern	_STK10
	.extern	_STK11
	.extern	_PSW_bits
	.extern	_P0_bits
	.extern	_P2_bits
	.extern	_P1_bits
	.extern	_P3_bits
	.extern	_PCH_bits
	.extern	_INTCTL_bits
	.extern	_EIF1_bits
	.extern	_EIF2_bits
	.extern	_T1CTL_bits
	.extern	_T2CTL0_bits
	.extern	_CCP3CTL_bits
	.extern	_BANK_bits
	.extern	_ADSCANCTL_bits
	.extern	_AMPCTL_bits
	.extern	_ANS1_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	_VREFCTL_bits
	.extern	_EIE1_bits
	.extern	_EIE2_bits
	.extern	_PCTL_bits
	.extern	_OSCCTL_bits
	.extern	_ANS0_bits
	.extern	_ANS2_bits
	.extern	_ANS3_bits
	.extern	_OSC0CAL2_bits
	.extern	_PUR0_bits
	.extern	_IOCL0_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	_T3CTL_bits
	.extern	_PWM5CTL0_bits
	.extern	_ADCINTCTL_bits
	.extern	_PWM5CTL1_bits
	.extern	_P5ASCTL0_bits
	.extern	_PSTRCTL0_bits
	.extern	_PUR1_bits
	.extern	_PUR2_bits
	.extern	_TMRBUZ_bits
	.extern	_ADCCTL2_bits
	.extern	_INTEDGCTL_bits
	.extern	_IOCL4_bits
	.extern	_PUR3_bits
	.extern	_CCP4CTL_bits
	.extern	_PWM5OC_bits
	.extern	_T2CTL1_bits
	.extern	_PWM5FC_bits
	.extern	_P5ASCTL1_bits
	.extern	_PSTRCTL1_bits
	.extern	_PWM5CTL2_bits
	.extern	_PWM5PC_bits
	.extern	_RSCTL1_bits
	.extern	_BRCTL1_bits
	.extern	_TSCTL1_bits
	.extern	_USLPEN1_bits
	.extern	_SSCICTL0_bits
	.extern	_SSCICTL1_bits
	.extern	_SSCISTA_bits
	.extern	_SSCIMSK_bits
	.extern	_WDTPS_bits
	.extern	_MULCTL_bits
	.extern	_DIVCTL_bits
	.extern	_LEDCTL_bits
	.extern	_LEDPRE_bits
	.extern	_LEDDATA0_bits
	.extern	_LEDDATA1_bits
	.extern	_LEDDATA2_bits
	.extern	_LEDDATA3_bits
	.extern	_LEDDATA4_bits
	.extern	_LEDDATA5_bits
	.extern	_LEDDATA6_bits
	.extern	_LEDDATA7_bits
	.extern	_LEDDATA8_bits
	.extern	_LEDDATA9_bits
	.extern	_LEDDATAA_bits
	.extern	_LEDDATAB_bits
	.extern	_LEDDATAC_bits
	.extern	_LEDDATAD_bits
	.extern	_UPINSET1_bits
	.extern	_LPRCCTL_bits
	.extern	_PCAL_bits
	.extern	_LEDDATAE_bits
	.extern	_LEDDATAF_bits
	.extern	_LEDCTL2_bits
	.extern	_LEDOMS_bits
	.extern	_LEDLUM_bits
	.extern	_T4CTL_bits
	.extern	_ANS4_bits
	.extern	_ANS5_bits
	.extern	_P4_bits
	.extern	_P4LR_bits
	.extern	_TR4_bits
	.extern	_PUR4_bits
	.extern	_P5_bits
	.extern	_P5LR_bits
	.extern	_TR5_bits
	.extern	_PUR5_bits
	.extern	_PWMCTL0_bits
	.extern	_PWMCTL1_bits
	.extern	_PWM3CTL_bits
	.extern	_TEMPSNR_bits
	.extern	_UPINSET2_bits
	.extern	_U7816CTL2_bits
	.extern	_U7816RXCTL2_bits
	.extern	_U7816TXCTL2_bits
	.extern	_CLKDIV2_bits
	.extern	_EGTCTL2_bits
	.extern	_TZBRGH2_bits
	.extern	_TZBRGL2_bits
	.extern	_USLPEN2_bits
	.extern	_BRCTL2_bits
	.extern	_RSCTL2_bits
	.extern	_TSCTL2_bits
	.extern	_BKPCTL_bits
	.extern	_EIE4_bits
	.extern	_EIF4_bits
	.extern	_IP4_bits
	.extern	_CTCHCOMB0_bits
	.extern	_CTCHCOMB1_bits
	.extern	_CTCHCOMB2_bits
	.extern	_APFCTL0_bits
	.extern	_APFCTL1_bits
	.extern	_APFCTL2_bits
	.extern	_APFCTL3_bits
	.extern	_APFCTL4_bits
	.extern	_APFCTL5_bits
	.extern	_APFCTL6_bits
	.extern	_APFCTL7_bits
	.extern	_APFCTL8_bits
	.extern	_APFCTL9_bits
	.extern	_APFCTLA_bits
	.extern	_APFCTLB_bits
	.extern	_Rev_buf
	.extern	_Rev_buf_cnt
	.extern	_PID_buf
	.extern	_BUF1
	.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	_CCP3CTL
	.extern	_CCP3H
	.extern	_CCP3L
	.extern	_BANK
	.extern	_ADSCANCTL
	.extern	_AMPCTL
	.extern	_ANS1
	.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	_VREFCTL
	.extern	_EIE1
	.extern	_EIE2
	.extern	_PCTL
	.extern	_OSCCTL
	.extern	_OSCCAL0
	.extern	_ANS0
	.extern	_ANS2
	.extern	_ANS3
	.extern	_OSC0CAL2
	.extern	_PUR0
	.extern	_IOCL0
	.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	_T3CTL
	.extern	_T3L
	.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	_T3H
	.extern	_PUR1
	.extern	_PUR2
	.extern	_TMRBUZ
	.extern	_ADCCTL2
	.extern	_INTEDGCTL
	.extern	_ADCDATA3L
	.extern	_IOCL4
	.extern	_PUR3
	.extern	_CCP4L
	.extern	_CCP4H
	.extern	_DIVRH
	.extern	_CCP4CTL
	.extern	_PWM5L2
	.extern	_PWM5L3
	.extern	_PWM5OC
	.extern	_T2CTL1
	.extern	_DIVBH
	.extern	_T2CCR1L
	.extern	_T2CCR1H
	.extern	_PWM5FC
	.extern	_P5ASCTL1
	.extern	_PSTRCTL1
	.extern	_PWM5CTL2
	.extern	_PWM5PC
	.extern	_PWM5H2
	.extern	_PWM5H3
	.extern	_RSCTL1
	.extern	_TXSDR1
	.extern	_RXSDR1
	.extern	_BRCTL1
	.extern	_TSCTL1
	.extern	_EUBRGL1
	.extern	_EUBRGH1
	.extern	_USLPEN1
	.extern	_SSCICTL0
	.extern	_SSCICTL1
	.extern	_SSCISTA
	.extern	_SSCIBUFR
	.extern	_UARTMTH1
	.extern	_SSCIADD
	.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	_DIVBL
	.extern	_DIVQH
	.extern	_DIVQL
	.extern	_DIVRL
	.extern	_LEDCTL
	.extern	_LEDPRE
	.extern	_LEDDATA0
	.extern	_LEDDATA1
	.extern	_LEDDATA2
	.extern	_LEDDATA3
	.extern	_LEDDATA4
	.extern	_LEDDATA5
	.extern	_LEDDATA6
	.extern	_LEDDATA7
	.extern	_LEDDATA8
	.extern	_LEDDATA9
	.extern	_LEDDATAA
	.extern	_LEDDATAB
	.extern	_LEDDATAC
	.extern	_LEDDATAD
	.extern	_UPINSET1
	.extern	_LPRCCTL
	.extern	_LPRCCAL
	.extern	_XTALCAL
	.extern	_PCAL
	.extern	_LEDDATAE
	.extern	_LEDDATAF
	.extern	_LEDCTL2
	.extern	_LEDOMS
	.extern	_VREFCAL0
	.extern	_VREFCAL1
	.extern	_LEDLUM
	.extern	_T3REL
	.extern	_T3REH
	.extern	_T4L
	.extern	_T4H
	.extern	_T4REL
	.extern	_T4REH
	.extern	_T4CTL
	.extern	_RC32KCAL
	.extern	_ANS4
	.extern	_ANS5
	.extern	_P4
	.extern	_P4LR
	.extern	_TR4
	.extern	_PUR4
	.extern	_P5
	.extern	_P5LR
	.extern	_TR5
	.extern	_PUR5
	.extern	_PWMCTL0
	.extern	_PWMCTL1
	.extern	_PP1
	.extern	_PP2
	.extern	_PWM10L
	.extern	_PWM20H
	.extern	_PWM11L
	.extern	_PWM21H
	.extern	_PWM12L
	.extern	_PWM22H
	.extern	_PWM13L
	.extern	_PWM23H
	.extern	_PWM3CTL
	.extern	_PP3H
	.extern	_PP3L
	.extern	_PWM30H
	.extern	_PWM31H
	.extern	_PWM32H
	.extern	_PWM33H
	.extern	_PWM30L
	.extern	_PWM31L
	.extern	_PWM32L
	.extern	_PWM33L
	.extern	_TEMPSNR
	.extern	_UPINSET2
	.extern	_U7816CTL2
	.extern	_U7816RXCTL2
	.extern	_U7816TXCTL2
	.extern	_CLKDIV2
	.extern	_EGTCTL2
	.extern	_TZBRGH2
	.extern	_TZBRGL2
	.extern	_UARTMTH2
	.extern	_USLPEN2
	.extern	_BRCTL2
	.extern	_RSCTL2
	.extern	_RXSDR2
	.extern	_EUBRGH2
	.extern	_EUBRGL2
	.extern	_TXSDR2
	.extern	_TSCTL2
	.extern	_BKPCTL
	.extern	_EIE4
	.extern	_EIF4
	.extern	_IP4
	.extern	_CTCHCOMB0
	.extern	_CTCHCOMB1
	.extern	_CTCHCOMB2
	.extern	_APFCTL0
	.extern	_APFCTL1
	.extern	_APFCTL2
	.extern	_APFCTL3
	.extern	_APFCTL4
	.extern	_APFCTL5
	.extern	_APFCTL6
	.extern	_APFCTL7
	.extern	_APFCTL8
	.extern	_APFCTL9
	.extern	_APFCTLA
	.extern	_APFCTLB

	.extern I0R1
	.extern I0R7
	.extern I0PSW
	.extern I0PCH
	.extern I1R1
	.extern I1R7
	.extern I1PSW
	.extern I1PCH
	.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	_Write_Bye
	.global	_Write_hello
	.global	_Uart_send
	.global	_UartPutchar
	.global	_Rec_Byte
	.global	_Init_uart
	.global	_Parity_Check_even
	.global	_Parity_Check_odd
	.global	_Parity_Check_even_1
	.global	_Parity_Check_odd_1
	.define _STK11	STK11
	.define _STK10	STK10
	.define _STK09	STK09
	.define _STK08	STK08
	.define _STK07	STK07
	.define _STK06	STK06
	.define _STK05	STK05
	.define _STK04	STK04
	.define _STK03	STK03
	.define _STK02	STK02
	.define _STK01	STK01
	.define _STK00	STK00

;--------------------------------------------------------
; global definitions
;--------------------------------------------------------
;--------------------------------------------------------
; absolute symbol definitions
;--------------------------------------------------------
;--------------------------------------------------------
; compiler-defined variables
;--------------------------------------------------------
UDL_UART_0	.udata
r0x101C	.res	1
UDL_UART_1	.udata
r0x1016	.res	1
UDL_UART_2	.udata
r0x1017	.res	1
UDL_UART_3	.udata
r0x1018	.res	1
UDL_UART_4	.udata
r0x1019	.res	1
UDL_UART_5	.udata
r0x101A	.res	1
UDL_UART_6	.udata
r0x101B	.res	1
UDL_UART_7	.udata
r0x1011	.res	1
UDL_UART_8	.udata
r0x1012	.res	1
UDL_UART_9	.udata
r0x1013	.res	1
UDL_UART_10	.udata
r0x1014	.res	1
UDL_UART_11	.udata
r0x1015	.res	1
UDL_UART_12	.udata
r0x100E	.res	1
UDL_UART_13	.udata
r0x100F	.res	1
UDL_UART_14	.udata
r0x1010	.res	1
UDL_UART_15	.udata
r0x100C	.res	1
UDL_UART_16	.udata
r0x100D	.res	1
UDL_UART_17	.udata
r0x100A	.res	1
UDL_UART_18	.udata
r0x100B	.res	1
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
;	.udata_ovr


func._Write_Bye	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Write_Bye	;Function start
; 2 exit points
;has an exit
;2 compiler assigned registers:
;   r0x100A
;   r0x100B
;; Starting PostCode block
;	::->op : LABEL
;	::->op : FUNCTION
_Write_Bye	;Function start
; 2 exit points
;	::->op : =
;	.line	175; "../UART.c"	for(i=0;i<10;i++)
	BANKSEL	r0x100A
	CLR	r0x100A
;	::->op : LABEL
;	::->op : <
;unsigned compare: left < lit(0xA=10), size=1
_00085_DS_
	MOV	R0,# 0x0a
	BANKSEL	r0x100A
	SUB	R0, r0x100A
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00088_DS_
;	::->op : +
;	.line	177; "../UART.c"	BUF1[i]=0;
	BANKSEL	r0x100A
	MOV	R0, r0x100A
	ADD	R0,# (_BUF1 + 0)
	BANKSEL	r0x100B
	MOV	r0x100B, R0
;	::->op :*  =
	MOV	R0,# 0x00
	BANKSEL	r0x100B
	MOV	R1, r0x100B
	BANKSEL	_BUF1
	ST	[R1], R0
;	::->op : +
;	.line	175; "../UART.c"	for(i=0;i<10;i++)
	BANKSEL	r0x100A
	INC	r0x100A
;	::->op : GOTO
	JMP	_00085_DS_
;	::->op : LABEL
;	::->op :*  =
_00088_DS_
;	.line	180; "../UART.c"	BUF1[0]='B';
	MOV	R0,# 0x42
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 0), R0
;	::->op :*  =
;	.line	181; "../UART.c"	BUF1[1]='y';
	MOV	R0,# 0x79
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 1), R0
;	::->op :*  =
;	.line	182; "../UART.c"	BUF1[2]='e';
	MOV	R0,# 0x65
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 2), R0
;	::->op :*  =
;	.line	183; "../UART.c"	BUF1[3]='B';
	MOV	R0,# 0x42
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 3), R0
;	::->op :*  =
;	.line	184; "../UART.c"	BUF1[4]='y';
	MOV	R0,# 0x79
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 4), R0
;	::->op :*  =
;	.line	185; "../UART.c"	BUF1[5]='e';
	MOV	R0,# 0x65
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 5), R0
;	::->op :*  =
;	.line	186; "../UART.c"	BUF1[6]='!';
	MOV	R0,# 0x21
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 6), R0
;	::->op :*  =
;	.line	187; "../UART.c"	BUF1[7]='\n';
	MOV	R0,# 0x0a
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 7), R0
;	::->op : LABEL
;	::->op : ENDFUNCTION
	CRET	
; exit point of _Write_Bye



func._Write_hello	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Write_hello	;Function start
; 2 exit points
;has an exit
;2 compiler assigned registers:
;   r0x100C
;   r0x100D
;; Starting PostCode block
;	::->op : LABEL
;	::->op : FUNCTION
_Write_hello	;Function start
; 2 exit points
;	::->op : =
;	.line	153; "../UART.c"	for(i=0;i<10;i++)
	BANKSEL	r0x100C
	CLR	r0x100C
;	::->op : LABEL
;	::->op : <
;unsigned compare: left < lit(0xA=10), size=1
_00075_DS_
	MOV	R0,# 0x0a
	BANKSEL	r0x100C
	SUB	R0, r0x100C
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00078_DS_
;	::->op : +
;	.line	155; "../UART.c"	BUF1[i]=0;
	BANKSEL	r0x100C
	MOV	R0, r0x100C
	ADD	R0,# (_BUF1 + 0)
	BANKSEL	r0x100D
	MOV	r0x100D, R0
;	::->op :*  =
	MOV	R0,# 0x00
	BANKSEL	r0x100D
	MOV	R1, r0x100D
	BANKSEL	_BUF1
	ST	[R1], R0
;	::->op : +
;	.line	153; "../UART.c"	for(i=0;i<10;i++)
	BANKSEL	r0x100C
	INC	r0x100C
;	::->op : GOTO
	JMP	_00075_DS_
;	::->op : LABEL
;	::->op :*  =
_00078_DS_
;	.line	158; "../UART.c"	BUF1[0]='H';
	MOV	R0,# 0x48
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 0), R0
;	::->op :*  =
;	.line	159; "../UART.c"	BUF1[1]='E';
	MOV	R0,# 0x45
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 1), R0
;	::->op :*  =
;	.line	160; "../UART.c"	BUF1[2]='L';
	MOV	R0,# 0x4c
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 2), R0
;	::->op :*  =
;	.line	161; "../UART.c"	BUF1[3]='L';
	MOV	R0,# 0x4c
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 3), R0
;	::->op :*  =
;	.line	162; "../UART.c"	BUF1[4]='O';
	MOV	R0,# 0x4f
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 4), R0
;	::->op :*  =
;	.line	163; "../UART.c"	BUF1[5]='!';
	MOV	R0,# 0x21
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 5), R0
;	::->op :*  =
;	.line	164; "../UART.c"	BUF1[6]='\r';
	MOV	R0,# 0x0d
	BANKSEL	_BUF1
	MOV	 (_BUF1 + 6), R0
;	::->op : LABEL
;	::->op : ENDFUNCTION
	CRET	
; exit point of _Write_hello



func._Uart_send	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Uart_send	;Function start
; 2 exit points
;has an exit
;3 compiler assigned registers:
;   r0x100E
;   r0x100F
;   r0x1010
;; Starting PostCode block
;	::->op : LABEL
;	::->op : FUNCTION
_Uart_send	;Function start
; 2 exit points
;	::->op : RECEIVE
;	.line	135; "../UART.c"	void Uart_send(unsigned char k)
	BANKSEL	r0x100E
	MOV	r0x100E, R0
;	::->op : =
;	.line	138; "../UART.c"	for(i=0;i<k;i++)
	BANKSEL	r0x100F
	CLR	r0x100F
;	::->op : LABEL
;	::->op : <
_00063_DS_
	BANKSEL	r0x100E
	MOVZ	R0, r0x100E
	BANKSEL	r0x100F
	SUB	R0, r0x100F
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00067_DS_
;	::->op : +
;	.line	140; "../UART.c"	TXSDR1=BUF1[i];
	BANKSEL	r0x100F
	MOV	R0, r0x100F
	ADD	R0,# (_BUF1 + 0)
	BANKSEL	r0x1010
	MOV	r0x1010, R0
;	::->op : GET_VALUE_AT_ADDRESS
	BANKSEL	r0x1010
	MOV	R1, r0x1010
	BANKSEL	_BUF1
	LD	R0, [R1]
	BANKSEL	_TXSDR1
	MOV	_TXSDR1, R0
;	::->op : LABEL
;	::->op : GET_VALUE_AT_ADDRESS
_00060_DS_
;	.line	141; "../UART.c"	while(TXSRS1==0);
	BANKSEL	_TSCTL1_bits
	JB	_TSCTL1_bits, 1
	JMP	_00060_DS_
;	::->op : +
;	.line	138; "../UART.c"	for(i=0;i<k;i++)
	BANKSEL	r0x100F
	INC	r0x100F
;	::->op : GOTO
	JMP	_00063_DS_
;	::->op : LABEL
;	::->op : ENDFUNCTION
_00067_DS_
	CRET	
; exit point of _Uart_send



func._UartPutchar	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _UartPutchar	;Function start
; 2 exit points
;has an exit
;functions called:
;   _Parity_Check_odd_1
;   _Parity_Check_even_1
;   _Parity_Check_odd_1
;   _Parity_Check_even_1
;4 compiler assigned registers:
;   r0x1013
;   STK00
;   r0x1014
;   r0x1015
;; Starting PostCode block
;	::->op : LABEL
;	::->op : FUNCTION
_UartPutchar	;Function start
; 2 exit points
;	::->op : RECEIVE
;	.line	119; "../UART.c"	void UartPutchar(unsigned char Send_Dat,unsigned char mode)
	BANKSEL	r0x1013
	MOV	r0x1013, R0
;	::->op : RECEIVE
	BANKSEL	STK00
	MOVZ	R0, STK00
	BANKSEL	r0x1014
	MOV	r0x1014, R0
;	::->op : EQ_OP
;	.line	121; "../UART.c"	if(mode ==1)
	BANKSEL	r0x1014
	MOVZ	R0, r0x1014
	XOR	R0,# 0x01
	JB	PSW, 2
	JMP	_00050_DS_
;	::->op : SEND
;	::->op : CALL
;	.line	122; "../UART.c"	TX9D1 =Parity_Check_odd_1(Send_Dat);
	BANKSEL	r0x1013
	MOVZ	R0, r0x1013
	PAGESEL	_Parity_Check_odd_1
	CALL	_Parity_Check_odd_1
	PAGESEL	$
	BANKSEL	r0x1015
	MOV	r0x1015, R0
;	::->op :*  =
	BANKSEL	r0x1015
	RRCR	r0x1015
	JNB	PSW, 0
	JMP	_00095_DS_
	BANKSEL	_TSCTL1_bits
	CLR	_TSCTL1_bits, 0
_00095_DS_
	JB	PSW, 0
	JMP	_00096_DS_
	BANKSEL	_TSCTL1_bits
	SET	_TSCTL1_bits, 0
;	::->op : GOTO
_00096_DS_
	JMP	_00098_DS_
;	::->op : LABEL
;	::->op : EQ_OP
_00050_DS_
;	.line	123; "../UART.c"	else if(mode ==2)
	BANKSEL	r0x1014
	MOVZ	R0, r0x1014
	XOR	R0,# 0x02
	JB	PSW, 2
	JMP	_00098_DS_
;	::->op : SEND
;	::->op : CALL
;	.line	124; "../UART.c"	TX9D1 =Parity_Check_even_1(Send_Dat);
	BANKSEL	r0x1013
	MOVZ	R0, r0x1013
	PAGESEL	_Parity_Check_even_1
	CALL	_Parity_Check_even_1
	PAGESEL	$
	BANKSEL	r0x1014
	MOV	r0x1014, R0
;	::->op :*  =
	BANKSEL	r0x1014
	RRCR	r0x1014
	JNB	PSW, 0
	JMP	_00097_DS_
	BANKSEL	_TSCTL1_bits
	CLR	_TSCTL1_bits, 0
_00097_DS_
	JB	PSW, 0
	JMP	_00098_DS_
	BANKSEL	_TSCTL1_bits
	SET	_TSCTL1_bits, 0
;	::->op : LABEL
;	::->op : =
_00098_DS_
;	.line	125; "../UART.c"	TXSDR1=Send_Dat;//原值返回
	BANKSEL	r0x1013
	MOVZ	R0, r0x1013
	BANKSEL	_TXSDR1
	MOV	_TXSDR1, R0
;	::->op : LABEL
;	::->op : GET_VALUE_AT_ADDRESS
_00052_DS_
;	.line	126; "../UART.c"	while(TXSRS1==0);
	BANKSEL	_TSCTL1_bits
	JB	_TSCTL1_bits, 1
	JMP	_00052_DS_
;	::->op : LABEL
;	::->op : ENDFUNCTION
	CRET	
; exit point of _UartPutchar



func._Parity_Check_odd_1	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Parity_Check_odd_1	;Function start
; 2 exit points
;has an exit
;2 compiler assigned registers:
;   r0x1011
;   r0x1012
;; Starting PostCode block
;	::->op : LABEL
;	::->op : FUNCTION
_Parity_Check_odd_1	;Function start
; 2 exit points
;	::->op : RECEIVE
;	.line	103; "../UART.c"	unsigned char Parity_Check_odd_1(unsigned char x)
	BANKSEL	r0x1011
	MOV	r0x1011, R0
;	::->op : =
;	.line	105; "../UART.c"	unsigned char  val=0;
	BANKSEL	r0x1012
	CLR	r0x1012
;	::->op : LABEL
;	::->op : IFX
_00040_DS_
;	.line	106; "../UART.c"	while(x)
	MOV	R0,# 0x00
	BANKSEL	r0x1011
	ORL	R0, r0x1011
	JNB	PSW, 2
	JMP	_00042_DS_
;	::->op : ^
;	.line	108; "../UART.c"	val^=x;//val 和x进行异或运算
	BANKSEL	r0x1011
	MOVZ	R0, r0x1011
	BANKSEL	r0x1012
	XOR	r0x1012, R0
;	::->op : RIGHT_OP
;	.line	109; "../UART.c"	x>>=1;//x右移一位
	CLR	PSW, 0
	BANKSEL	r0x1011
	RRC	r0x1011
;	::->op : GOTO
	JMP	_00040_DS_
;	::->op : LABEL
;	::->op : BITWISEAND
_00042_DS_
;	.line	111; "../UART.c"	return !(val&0x1) ;//取末位运算. val的二进制形式最后一位位1则返回1，为0则返回0.
	MOV	R0,# 0x01
	BANKSEL	r0x1012
	AND	r0x1012, R0
;	::->op : !
	BANKSEL	r0x1012
	MOVZ	R0, r0x1012
	MOV	R0,# 0x00
	JNB	PSW, 2
	MOV	R0,# 0x01
	BANKSEL	r0x1011
	MOV	r0x1011, R0
;	::->op : RETURN
	BANKSEL	r0x1011
	MOVZ	R0, r0x1011
;	::->op : LABEL
;	::->op : ENDFUNCTION
	CRET	
; exit point of _Parity_Check_odd_1



func._Parity_Check_even_1	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Parity_Check_even_1	;Function start
; 2 exit points
;has an exit
;2 compiler assigned registers:
;   r0x1011
;   r0x1012
;; Starting PostCode block
;	::->op : LABEL
;	::->op : FUNCTION
_Parity_Check_even_1	;Function start
; 2 exit points
;	::->op : RECEIVE
;	.line	88; "../UART.c"	unsigned char Parity_Check_even_1(unsigned char x)
	BANKSEL	r0x1011
	MOV	r0x1011, R0
;	::->op : =
;	.line	90; "../UART.c"	unsigned char  val=0;
	BANKSEL	r0x1012
	CLR	r0x1012
;	::->op : LABEL
;	::->op : IFX
_00033_DS_
;	.line	91; "../UART.c"	while(x)
	MOV	R0,# 0x00
	BANKSEL	r0x1011
	ORL	R0, r0x1011
	JNB	PSW, 2
	JMP	_00035_DS_
;	::->op : ^
;	.line	93; "../UART.c"	val^=x;//val 和x进行异或运算
	BANKSEL	r0x1011
	MOVZ	R0, r0x1011
	BANKSEL	r0x1012
	XOR	r0x1012, R0
;	::->op : RIGHT_OP
;	.line	94; "../UART.c"	x>>=1;//x右移一位
	CLR	PSW, 0
	BANKSEL	r0x1011
	RRC	r0x1011
;	::->op : GOTO
	JMP	_00033_DS_
;	::->op : LABEL
;	::->op : BITWISEAND
_00035_DS_
;	.line	96; "../UART.c"	return (val&0x1) ;//取末位运算. val的二进制形式最后一位位1则返回1，为0则返回0.
	MOV	R0,# 0x01
	BANKSEL	r0x1012
	AND	r0x1012, R0
;	::->op : RETURN
	BANKSEL	r0x1012
	MOVZ	R0, r0x1012
;	::->op : LABEL
;	::->op : ENDFUNCTION
	CRET	
; exit point of _Parity_Check_even_1



func._Rec_Byte	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Rec_Byte	;Function start
; 2 exit points
;has an exit
;functions called:
;   _Parity_Check_odd
;   _Parity_Check_even
;   _Parity_Check_odd
;   _Parity_Check_even
;4 compiler assigned registers:
;   r0x1018
;   r0x1019
;   r0x101A
;   r0x101B
;; Starting PostCode block
;	::->op : LABEL
;	::->op : FUNCTION
_Rec_Byte	;Function start
; 2 exit points
;	::->op : RECEIVE
;	.line	67; "../UART.c"	unsigned char  Rec_Byte(unsigned char mode)
	BANKSEL	r0x1018
	MOV	r0x1018, R0
;	::->op : =
;	.line	69; "../UART.c"	unsigned char Temp,D9, check=0;
	BANKSEL	r0x1019
	CLR	r0x1019
;	::->op : GET_VALUE_AT_ADDRESS
;	.line	71; "../UART.c"	D9=RX9D1;
	BANKSEL	r0x101A
	CLR	r0x101A
	BANKSEL	_RSCTL1_bits
	JB	_RSCTL1_bits, 0
	JMP	_00099_DS_
	BANKSEL	r0x101A
	INC	r0x101A
;	::->op : =
;	::->op : =
_00099_DS_
;	.line	72; "../UART.c"	Temp=RXSDR1;
	BANKSEL	_RXSDR1
	MOVZ	R0, _RXSDR1
	BANKSEL	r0x101B
	MOV	r0x101B, R0
;	::->op : EQ_OP
;	.line	73; "../UART.c"	if(mode ==1)
	BANKSEL	r0x1018
	MOVZ	R0, r0x1018
	XOR	R0,# 0x01
	JB	PSW, 2
	JMP	_00023_DS_
;	::->op : SEND
;	::->op : CALL
;	.line	74; "../UART.c"	check =Parity_Check_odd(Temp);
	BANKSEL	r0x101B
	MOVZ	R0, r0x101B
	PAGESEL	_Parity_Check_odd
	CALL	_Parity_Check_odd
	PAGESEL	$
	BANKSEL	r0x1019
	MOV	r0x1019, R0
;	::->op : GOTO
	JMP	_00024_DS_
;	::->op : LABEL
;	::->op : EQ_OP
_00023_DS_
;	.line	75; "../UART.c"	else if(mode ==2)
	BANKSEL	r0x1018
	MOVZ	R0, r0x1018
	XOR	R0,# 0x02
	JB	PSW, 2
	JMP	_00024_DS_
;	::->op : SEND
;	::->op : CALL
;	.line	76; "../UART.c"	check =Parity_Check_even(Temp);
	BANKSEL	r0x101B
	MOVZ	R0, r0x101B
	PAGESEL	_Parity_Check_even
	CALL	_Parity_Check_even
	PAGESEL	$
	BANKSEL	r0x1019
	MOV	r0x1019, R0
;	::->op : LABEL
;	::->op : EQ_OP
_00024_DS_
;	.line	77; "../UART.c"	if(check ==D9)
	BANKSEL	r0x101A
	MOVZ	R0, r0x101A
	BANKSEL	r0x1019
	XOR	R0, r0x1019
	JB	PSW, 2
	JMP	_00026_DS_
;	::->op : RETURN
;	.line	78; "../UART.c"	return Temp;
	BANKSEL	r0x101B
	MOVZ	R0, r0x101B
	JMP	_00028_DS_
;	::->op : LABEL
;	::->op : RETURN
_00026_DS_
;	.line	80; "../UART.c"	return 0;
	MOV	R0,# 0x00
;	::->op : LABEL
;	::->op : ENDFUNCTION
_00028_DS_
	CRET	
; exit point of _Rec_Byte



func._Parity_Check_odd	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Parity_Check_odd	;Function start
; 2 exit points
;has an exit
;2 compiler assigned registers:
;   r0x1016
;   r0x1017
;; Starting PostCode block
;	::->op : LABEL
;	::->op : FUNCTION
_Parity_Check_odd	;Function start
; 2 exit points
;	::->op : RECEIVE
;	.line	52; "../UART.c"	unsigned char Parity_Check_odd(unsigned char x)
	BANKSEL	r0x1016
	MOV	r0x1016, R0
;	::->op : =
;	.line	54; "../UART.c"	unsigned char  val=0;
	BANKSEL	r0x1017
	CLR	r0x1017
;	::->op : LABEL
;	::->op : IFX
_00013_DS_
;	.line	55; "../UART.c"	while(x)
	MOV	R0,# 0x00
	BANKSEL	r0x1016
	ORL	R0, r0x1016
	JNB	PSW, 2
	JMP	_00015_DS_
;	::->op : ^
;	.line	57; "../UART.c"	val^=x;//val 和x进行异或运算
	BANKSEL	r0x1016
	MOVZ	R0, r0x1016
	BANKSEL	r0x1017
	XOR	r0x1017, R0
;	::->op : RIGHT_OP
;	.line	58; "../UART.c"	x>>=1;//x右移一位
	CLR	PSW, 0
	BANKSEL	r0x1016
	RRC	r0x1016
;	::->op : GOTO
	JMP	_00013_DS_
;	::->op : LABEL
;	::->op : BITWISEAND
_00015_DS_
;	.line	60; "../UART.c"	return !(val&0x1) ;//取末位运算. val的二进制形式最后一位位1则返回1，为0则返回0.
	MOV	R0,# 0x01
	BANKSEL	r0x1017
	AND	r0x1017, R0
;	::->op : !
	BANKSEL	r0x1017
	MOVZ	R0, r0x1017
	MOV	R0,# 0x00
	JNB	PSW, 2
	MOV	R0,# 0x01
	BANKSEL	r0x1016
	MOV	r0x1016, R0
;	::->op : RETURN
	BANKSEL	r0x1016
	MOVZ	R0, r0x1016
;	::->op : LABEL
;	::->op : ENDFUNCTION
	CRET	
; exit point of _Parity_Check_odd



func._Parity_Check_even	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Parity_Check_even	;Function start
; 2 exit points
;has an exit
;2 compiler assigned registers:
;   r0x1016
;   r0x1017
;; Starting PostCode block
;	::->op : LABEL
;	::->op : FUNCTION
_Parity_Check_even	;Function start
; 2 exit points
;	::->op : RECEIVE
;	.line	36; "../UART.c"	unsigned char Parity_Check_even(unsigned char x)
	BANKSEL	r0x1016
	MOV	r0x1016, R0
;	::->op : =
;	.line	38; "../UART.c"	unsigned char  val=0;
	BANKSEL	r0x1017
	CLR	r0x1017
;	::->op : LABEL
;	::->op : IFX
_00006_DS_
;	.line	39; "../UART.c"	while(x)
	MOV	R0,# 0x00
	BANKSEL	r0x1016
	ORL	R0, r0x1016
	JNB	PSW, 2
	JMP	_00008_DS_
;	::->op : ^
;	.line	41; "../UART.c"	val^=x;//val 和x进行异或运算
	BANKSEL	r0x1016
	MOVZ	R0, r0x1016
	BANKSEL	r0x1017
	XOR	r0x1017, R0
;	::->op : RIGHT_OP
;	.line	42; "../UART.c"	x>>=1;//x右移一位
	CLR	PSW, 0
	BANKSEL	r0x1016
	RRC	r0x1016
;	::->op : GOTO
	JMP	_00006_DS_
;	::->op : LABEL
;	::->op : BITWISEAND
_00008_DS_
;	.line	44; "../UART.c"	return (val&0x1) ;//取末位运算. val的二进制形式最后一位位1则返回1，为0则返回0.
	MOV	R0,# 0x01
	BANKSEL	r0x1017
	AND	r0x1017, R0
;	::->op : RETURN
	BANKSEL	r0x1017
	MOVZ	R0, r0x1017
;	::->op : LABEL
;	::->op : ENDFUNCTION
	CRET	
; exit point of _Parity_Check_even



func._Init_uart	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _Init_uart	;Function start
; 2 exit points
;has an exit
;1 compiler assigned register :
;   r0x101C
;; Starting PostCode block
;	::->op : LABEL
;	::->op : FUNCTION
_Init_uart	;Function start
; 2 exit points
;	::->op : RECEIVE
;	.line	17; "../UART.c"	void Init_uart(unsigned char mode)
	BANKSEL	r0x101C
	MOV	r0x101C, R0
;	::->op : =
;	.line	19; "../UART.c"	RSCTL1 =0x90;//使能串口模块、使能接收器
	MOV	R0,# 0x90
	BANKSEL	_RSCTL1
	MOV	_RSCTL1, R0
;	::->op : =
;	.line	20; "../UART.c"	BRCTL1 =0x40;//接收器空闲
	MOV	R0,# 0x40
	BANKSEL	_BRCTL1
	MOV	_BRCTL1, R0
;	::->op : =
;	.line	21; "../UART.c"	TSCTL1=0x22;//使能发送功能、移位寄存器空
	MOV	R0,# 0x22
	BANKSEL	_TSCTL1
	MOV	_TSCTL1, R0
;	::->op : =
;	.line	22; "../UART.c"	EUBRGL1= 0x32;//波特率寄存器设置为50，当前波特率是9600，波特率为Fosc/【m*（EUBRGH：EUBRGL+1）】，m的设置方法参考手册
	MOV	R0,# 0x32
	BANKSEL	_EUBRGL1
	MOV	_EUBRGL1, R0
;	::->op : =
;	.line	23; "../UART.c"	EUBRGH1 =0;
	BANKSEL	_EUBRGH1
	CLR	_EUBRGH1
;	::->op : IFX
;	.line	24; "../UART.c"	if(mode)
	MOV	R0,# 0x00
	BANKSEL	r0x101C
	ORL	R0, r0x101C
	JNB	PSW, 2
	JMP	_00003_DS_
;	::->op :*  =
;	.line	26; "../UART.c"	T1X9 =1;
	BANKSEL	_TSCTL1_bits
	SET	_TSCTL1_bits, 6
;	::->op :*  =
;	.line	27; "../UART.c"	R1X9 =1;//使能9位接收
	BANKSEL	_RSCTL1_bits
	SET	_RSCTL1_bits, 6
;	::->op : LABEL
;	::->op : ENDFUNCTION
_00003_DS_
	CRET	
; exit point of _Init_uart


;	code size estimation:
;	  238+  119 =   357 instructions (  952 byte)


	.end
