;--------------------------------------------------------
; File Created by ChiponCC : aolisn inc.
; Version 3.0.4#6752 (Nov 19 2015 16:48:50) (MSVC)
; This file was generated Wed Jun 08 18:44:50 2016
;--------------------------------------------------------
; chipon port for the 16-bit core
;--------------------------------------------------------
;	.file	"../main.c"
	.list	p=KF8F4156
	.radix dec
	.include "KF8F4156.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	_VDACS_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	_P5ASCTL_bits
	.extern	_PSTRCTL_bits
	.extern	_PUR1_bits
	.extern	_PUR2_bits
	.extern	_INTEDGCTL_bits
	.extern	_VBIASCTL_bits
	.extern	_VBIAS1EN_bits
	.extern	_VBIAS2EN_bits
	.extern	_PWM5OC_bits
	.extern	_T2CTL1_bits
	.extern	_VDAC_bits
	.extern	_PWM5CTL2_bits
	.extern	_PWMPC_bits
	.extern	_RSCTL_bits
	.extern	_BRCTL_bits
	.extern	_TSCTL_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	_C1FILTCTL_bits
	.extern	_C1FILTPRE_bits
	.extern	_LEDOMS1_bits
	.extern	_LEDODS0_bits
	.extern	_LEDOMS0_bits
	.extern	_LEDODS1_bits
	.extern	_LEDLUM_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	_VDACS
	.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	_T2CCRH
	.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	_T2CCRL
	.extern	_PWM5L0
	.extern	_PWM5L1
	.extern	_PWM5CTL0
	.extern	_ADCINTCTL
	.extern	_ADCDATA2H
	.extern	_ADCDATA2L
	.extern	_PWM5CTL1
	.extern	_P5ASCTL
	.extern	_PSTRCTL
	.extern	_ADCDATA3H
	.extern	_PUR1
	.extern	_PUR2
	.extern	_INTEDGCTL
	.extern	_ADCDATA3L
	.extern	_VBIASCTL
	.extern	_VBIAS1EN
	.extern	_VBIAS2EN
	.extern	_PWM5OC
	.extern	_T2CTL1
	.extern	_VDAC
	.extern	_PWM5CTL2
	.extern	_PWMPC
	.extern	_RSCTL
	.extern	_TXSDR
	.extern	_RXSDR
	.extern	_BRCTL
	.extern	_TSCTL
	.extern	_EUBRGL
	.extern	_EUBRGH
	.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	_LEDCTL
	.extern	_LEDPRE
	.extern	_LEDDATA0
	.extern	_LEDDATA1
	.extern	_LEDDATA2
	.extern	_LEDDATA3
	.extern	_LEDDATA4
	.extern	_LEDDATA5
	.extern	_LEDDATA6
	.extern	_LEDDATA7
	.extern	_C1FILTCTL
	.extern	_C1FILTPRE
	.extern	_LEDOMS1
	.extern	_LEDODS0
	.extern	_LEDOMS0
	.extern	_LEDODS1
	.extern	_VRECAL2
	.extern	_VRECAL3
	.extern	_LEDLUM
	.extern	_PWM5FC
	.extern	_T4L
	.extern	_T4H
	.extern	_T4REL
	.extern	_T4REH
	.extern	_T4CTL
	.extern	_RC32KCAL
	.extern	_startup
	.extern	__sdcc_gsinit_startup
;--------------------------------------------------------
; global declarations
;--------------------------------------------------------
	.global	_FLASH_WRITE_ONE
	.global	_FLASH_WRITE_FUN
	.global	_FLASH_READ_FUN
	.global	_FLASH_READ_ONE
	.global	_init_mcu
	.global	_main
	.global	_FLASH_BUFFER
	.global	_FLASH_READ_BUF

	.global I0R1
	.global I0PSW
	.global I0PCH
	.global I1R1
	.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 0x0080
I0R1		.res 1
I0PSW		.res 1
I0PCH		.res 1
I1R1		.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
;--------------------------------------------------------
UD_main_0	.udata
_FLASH_BUFFER	.res	64

UD_main_1	.udata
_FLASH_READ_BUF	.res	2

;--------------------------------------------------------
; absolute symbol definitions
;--------------------------------------------------------
;--------------------------------------------------------
; compiler-defined variables
;--------------------------------------------------------
UDL_main_0	.udata
r0x1053	.res	1
UDL_main_1	.udata
r0x1054	.res	1
UDL_main_2	.udata
r0x1055	.res	1
UDL_main_3	.udata
r0x1056	.res	1
UDL_main_4	.udata
r0x1050	.res	1
UDL_main_5	.udata
r0x1051	.res	1
UDL_main_6	.udata
r0x1043	.res	1
UDL_main_7	.udata
r0x1042	.res	1
UDL_main_8	.udata
r0x1044	.res	1
UDL_main_9	.udata
r0x1048	.res	1
UDL_main_10	.udata
r0x1047	.res	1
UDL_main_11	.udata
r0x104A	.res	1
UDL_main_12	.udata
r0x1049	.res	1
UDL_main_13	.udata
r0x104B	.res	1
UDL_main_14	.udata
r0x104C	.res	1
UDL_main_15	.udata
r0x104D	.res	1
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------
;--------------------------------------------------------
; 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


func._main	.code
;***
;  PostBlock Stats: dbName = M
;***
;entry:  _main	;Function start
; 2 exit points
;has an exit
;functions called:
;   _init_mcu
;   _FLASH_WRITE_FUN
;   _FLASH_WRITE_FUN
;   _FLASH_READ_ONE
;   _FLASH_WRITE_FUN
;   _FLASH_WRITE_FUN
;   _FLASH_WRITE_ONE
;   _init_mcu
;   _FLASH_WRITE_FUN
;   _FLASH_WRITE_FUN
;   _FLASH_READ_ONE
;   _FLASH_WRITE_FUN
;   _FLASH_WRITE_FUN
;   _FLASH_WRITE_ONE
;7 compiler assigned registers:
;   r0x1053
;   r0x1054
;   r0x1055
;   r0x1056
;   STK01
;   STK00
;   STK02
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_main	;Function start
; 2 exit points
;	op : CALL
;	.line	54; "../main.c"	init_mcu();
	PAGESEL	_init_mcu
	CALL	_init_mcu
	PAGESEL	$
;	op : =
;	.line	56; "../main.c"	for (i = 0; i < FLASH_BUFFER_MAX; i++)
	BANKSEL	r0x1053
	CLR	r0x1053
	BANKSEL	r0x1054
	CLR	r0x1054
;	op : =
	BANKSEL	r0x1055
	CLR	r0x1055
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x20=32), size=1
_00008_DS_
	MOV	R0,# 0x20
	BANKSEL	r0x1055
	SUB	R0, r0x1055
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00011_DS_
;	op : LEFT_OP
;	.line	58; "../main.c"	FLASH_BUFFER[i] = temp;
	CLR	PSW, 0
	BANKSEL	r0x1055
	RLCR	r0x1055
	BANKSEL	r0x1056
	MOV	r0x1056, R0
;	op : +
	MOV	R0,# (_FLASH_BUFFER + 0)
	BANKSEL	r0x1056
	ADD	r0x1056, R0
;	op : =
	BANKSEL	r0x1053
	MOVZ	R0, r0x1053
	BANKSEL	r0x1056
	MOV	R1, r0x1056
	BANKSEL	_FLASH_BUFFER
	ST	[R1], R0
	INC	R1
	BANKSEL	r0x1054
	MOVZ	R0, r0x1054
	BANKSEL	_FLASH_BUFFER
	ST	[R1], R0
;	op : +
;	.line	59; "../main.c"	temp += 0x1111;
	MOV	R0,# 0x11
	BANKSEL	r0x1053
	ADD	r0x1053, R0
	MOV	R0,# 0x11
	JNB	PSW, 0
	MOV	R0,# 0x12
	BANKSEL	r0x1054
	ADD	r0x1054, R0
;	op : +
;	.line	56; "../main.c"	for (i = 0; i < FLASH_BUFFER_MAX; i++)
	BANKSEL	r0x1055
	INC	r0x1055
;	op : GOTO
	JMP	_00008_DS_
;	op : LABEL
;	op : SEND
;	op : SEND
;	op : CALL
_00011_DS_
;	.line	63; "../main.c"	FLASH_WRITE_FUN(0x1E60,FLASH_BUFFER_MAX);
	MOV	R0,# 0x20
	BANKSEL	STK01
	MOV	STK01, R0
	MOV	R0,# 0x60
	MOV	STK00, R0
	MOV	R0,# 0x1e
	PAGESEL	_FLASH_WRITE_FUN
	CALL	_FLASH_WRITE_FUN
	PAGESEL	$
;	op : SEND
;	op : SEND
;	op : CALL
;	.line	64; "../main.c"	FLASH_WRITE_FUN(0x1E80,FLASH_BUFFER_MAX);
	MOV	R0,# 0x20
	BANKSEL	STK01
	MOV	STK01, R0
	MOV	R0,# 0x80
	MOV	STK00, R0
	MOV	R0,# 0x1e
	PAGESEL	_FLASH_WRITE_FUN
	CALL	_FLASH_WRITE_FUN
	PAGESEL	$
;	op : SEND
;	op : CALL
;	.line	69; "../main.c"	temp=FLASH_READ_ONE(0x1E71);
	MOV	R0,# 0x71
	BANKSEL	STK00
	MOV	STK00, R0
	MOV	R0,# 0x1e
	PAGESEL	_FLASH_READ_ONE
	CALL	_FLASH_READ_ONE
	PAGESEL	$
	BANKSEL	r0x1054
	MOV	r0x1054, R0
	BANKSEL	STK00
	MOVZ	R0, STK00
	BANKSEL	r0x1053
	MOV	r0x1053, R0
;	op : =
;	.line	71; "../main.c"	for (i = 0; i < 16; i++)
	BANKSEL	r0x1055
	CLR	r0x1055
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x10=16), size=1
_00012_DS_
	MOV	R0,# 0x10
	BANKSEL	r0x1055
	SUB	R0, r0x1055
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00015_DS_
;	op : LEFT_OP
;	.line	73; "../main.c"	FLASH_BUFFER[i] = 0x0000;
	CLR	PSW, 0
	BANKSEL	r0x1055
	RLCR	r0x1055
	BANKSEL	r0x1056
	MOV	r0x1056, R0
;	op : +
	MOV	R0,# (_FLASH_BUFFER + 0)
	BANKSEL	r0x1056
	ADD	r0x1056, R0
;	op : =
	MOV	R0,# 0x00
	BANKSEL	r0x1056
	MOV	R1, r0x1056
	BANKSEL	_FLASH_BUFFER
	ST	[R1], R0
	INC	R1
	MOV	R0,# 0x00
	BANKSEL	_FLASH_BUFFER
	ST	[R1], R0
;	op : +
;	.line	71; "../main.c"	for (i = 0; i < 16; i++)
	BANKSEL	r0x1055
	INC	r0x1055
;	op : GOTO
	JMP	_00012_DS_
;	op : LABEL
;	op : SEND
;	op : SEND
;	op : CALL
_00015_DS_
;	.line	76; "../main.c"	FLASH_WRITE_FUN(0x1EA0,16);
	MOV	R0,# 0x10
	BANKSEL	STK01
	MOV	STK01, R0
	MOV	R0,# 0xa0
	MOV	STK00, R0
	MOV	R0,# 0x1e
	PAGESEL	_FLASH_WRITE_FUN
	CALL	_FLASH_WRITE_FUN
	PAGESEL	$
;	op : =
;d:\svn\workspace\compiler\chipon16target\gen.c:8828: size=0/2, offset=0, AOP_TYPE(res)=7
;	.line	78; "../main.c"	FLASH_BUFFER[5]=temp;
	BANKSEL	r0x1053
	MOVZ	R0, r0x1053
	BANKSEL	_FLASH_BUFFER
	MOV	 (_FLASH_BUFFER + 10), R0
;d:\svn\workspace\compiler\chipon16target\gen.c:8828: size=1/2, offset=1, AOP_TYPE(res)=7
	BANKSEL	r0x1054
	MOVZ	R0, r0x1054
	BANKSEL	_FLASH_BUFFER
	MOV	 (_FLASH_BUFFER + 11), R0
;	op : =
;d:\svn\workspace\compiler\chipon16target\gen.c:8828: size=0/2, offset=0, AOP_TYPE(res)=7
;	.line	79; "../main.c"	FLASH_BUFFER[6]=0xFF33; //验证 用 0x1FB6
	MOV	R0,# 0x33
	BANKSEL	_FLASH_BUFFER
	MOV	 (_FLASH_BUFFER + 12), R0
;d:\svn\workspace\compiler\chipon16target\gen.c:8828: size=1/2, offset=1, AOP_TYPE(res)=7
	MOV	R0,# 0xff
	BANKSEL	_FLASH_BUFFER
	MOV	 (_FLASH_BUFFER + 13), R0
;	op : SEND
;	op : SEND
;	op : CALL
;	.line	81; "../main.c"	FLASH_WRITE_FUN(0x1EB0,16);
	MOV	R0,# 0x10
	BANKSEL	STK01
	MOV	STK01, R0
	MOV	R0,# 0xb0
	MOV	STK00, R0
	MOV	R0,# 0x1e
	PAGESEL	_FLASH_WRITE_FUN
	CALL	_FLASH_WRITE_FUN
	PAGESEL	$
;	op : SEND
;	op : SEND
;	op : CALL
;	.line	86; "../main.c"	FLASH_WRITE_ONE(0x1E69,0x55AA);
	MOV	R0,# 0xaa
	BANKSEL	STK02
	MOV	STK02, R0
	MOV	R0,# 0x55
	MOV	STK01, R0
	MOV	R0,# 0x69
	MOV	STK00, R0
	MOV	R0,# 0x1e
	PAGESEL	_FLASH_WRITE_ONE
	CALL	_FLASH_WRITE_ONE
	PAGESEL	$
;	op : LABEL
;	op : +
_00006_DS_
;	.line	97; "../main.c"	temp++;
	BANKSEL	r0x1053
	INC	r0x1053
	JB	PSW, 2
	JMP	_00051_DS_
	BANKSEL	r0x1054
	INC	r0x1054
;	op : >
;swapping arguments (AOP_TYPEs 1/2)
;unsigned compare: left >= lit(0x7531=30001), size=2
_00051_DS_
;	.line	98; "../main.c"	if(temp>30000)
	MOV	R0,# 0x75
	BANKSEL	r0x1054
	SUB	R0, r0x1054
;comparing bytes at offset 1
	JB	PSW, 2
	JMP	_00028_DS_
	MOV	R0,# 0x31
	BANKSEL	r0x1053
	SUB	R0, r0x1053
_00028_DS_
	JB	PSW, 0
	JMP	_00006_DS_
;	op : =
;	.line	100; "../main.c"	temp=0;
	BANKSEL	r0x1053
	CLR	r0x1053
	BANKSEL	r0x1054
	CLR	r0x1054
;	op : GET_VALUE_AT_ADDRESS
;	op : !
;	op : =
;	.line	101; "../main.c"	LED = !LED;
	BANKSEL	_P1LR_bits
	JB	_P1LR_bits, 2
	JMP	_00029_DS_
	BANKSEL	_P1LR_bits
	CLR	_P1LR_bits, 2
	JMP	_00030_DS_
_00029_DS_
	BANKSEL	_P1LR_bits
	SET	_P1LR_bits, 2
;	op : GOTO
_00030_DS_
	JMP	_00006_DS_
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _main



func._FLASH_WRITE_ONE	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _FLASH_WRITE_ONE	;Function start
; 2 exit points
;has an exit
;functions called:
;   _FLASH_READ_FUN
;   _FLASH_WRITE_FUN
;   _FLASH_READ_FUN
;   _FLASH_WRITE_FUN
;11 compiler assigned registers:
;   r0x1047
;   STK00
;   r0x1048
;   STK01
;   r0x1049
;   STK02
;   r0x104A
;   r0x104B
;   r0x104C
;   r0x104D
;   r0x104E
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_FLASH_WRITE_ONE	;Function start
; 2 exit points
;	op : RECEIVE
	BANKSEL	r0x104C
	MOV	r0x104C, R0
;	.line	488; "../main.c"	void FLASH_WRITE_ONE(unsigned int address,unsigned int value)
	BANKSEL	r0x1047
	MOV	r0x1047, R0
	BANKSEL	STK00
	MOVZ	R0, STK00
	BANKSEL	r0x1048
	MOV	r0x1048, R0
;	op : RECEIVE
	BANKSEL	STK01
	MOVZ	R0, STK01
	BANKSEL	r0x1049
	MOV	r0x1049, R0
	BANKSEL	STK02
	MOVZ	R0, STK02
	BANKSEL	r0x104A
	MOV	r0x104A, R0
;	op : BITWISEAND
;	.line	491; "../main.c"	FLASH_READ_FUN(address&0xFFE0,FLASH_BUFFER_MAX);
	MOV	R0,# 0xe0
	BANKSEL	r0x1048
	AND	R0, r0x1048
	BANKSEL	r0x104B
	MOV	r0x104B, R0
;;106	MOVZ	R0, r0x1047
;	op : SEND
;	op : SEND
;	op : CALL
	MOV	R0,# 0x20
	BANKSEL	STK01
	MOV	STK01, R0
	BANKSEL	r0x104B
	MOVZ	R0, r0x104B
	BANKSEL	STK00
	MOV	STK00, R0
	BANKSEL	r0x104C
	MOVZ	R0, r0x104C
	PAGESEL	_FLASH_READ_FUN
	CALL	_FLASH_READ_FUN
	PAGESEL	$
;	op : BITWISEAND
;	.line	493; "../main.c"	FLASH_BUFFER[address&0x1F] = value;
	MOV	R0,# 0x1f
	BANKSEL	r0x1048
	AND	R0, r0x1048
	BANKSEL	r0x104B
	MOV	r0x104B, R0
	BANKSEL	r0x104C
	CLR	r0x104C
;	op : LEFT_OP
	CLR	PSW, 0
	BANKSEL	r0x104B
	RLCR	r0x104B
	BANKSEL	r0x104D
	MOV	r0x104D, R0
	BANKSEL	r0x104C
	RLCR	r0x104C
;;1	MOV	r0x104E, R0
;	op : +
	BANKSEL	r0x104D
	MOV	R0, r0x104D
	ADD	R0,# (_FLASH_BUFFER + 0)
	BANKSEL	r0x104B
	MOV	r0x104B, R0
;	op : =
	BANKSEL	r0x104A
	MOVZ	R0, r0x104A
	BANKSEL	r0x104B
	MOV	R1, r0x104B
	BANKSEL	_FLASH_BUFFER
	ST	[R1], R0
	INC	R1
	BANKSEL	r0x1049
	MOVZ	R0, r0x1049
	BANKSEL	_FLASH_BUFFER
	ST	[R1], R0
;	op : BITWISEAND
;	.line	495; "../main.c"	FLASH_WRITE_FUN(address&0xFFE0,FLASH_BUFFER_MAX);
	MOV	R0,# 0xe0
	BANKSEL	r0x1048
	AND	r0x1048, R0
;	op : SEND
;	op : SEND
;	op : CALL
	MOV	R0,# 0x20
	BANKSEL	STK01
	MOV	STK01, R0
	BANKSEL	r0x1048
	MOVZ	R0, r0x1048
	BANKSEL	STK00
	MOV	STK00, R0
	BANKSEL	r0x1047
	MOVZ	R0, r0x1047
	PAGESEL	_FLASH_WRITE_FUN
	CALL	_FLASH_WRITE_FUN
	PAGESEL	$
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _FLASH_WRITE_ONE



func._FLASH_WRITE_FUN	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _FLASH_WRITE_FUN	;Function start
; 2 exit points
;has an exit
;7 compiler assigned registers:
;   r0x1042
;   STK00
;   r0x1043
;   STK01
;   r0x1044
;   r0x1045
;   r0x1046
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_FLASH_WRITE_FUN	;Function start
; 2 exit points
;	op : RECEIVE
;	.line	334; "../main.c"	void FLASH_WRITE_FUN(unsigned int address,unsigned char length)
	BANKSEL	r0x1042
	MOV	r0x1042, R0
	BANKSEL	STK00
	MOVZ	R0, STK00
	BANKSEL	r0x1043
	MOV	r0x1043, R0
;	op : RECEIVE
	BANKSEL	STK01
	MOVZ	R0, STK01
	BANKSEL	r0x1044
	MOV	r0x1044, R0
;	op : RIGHT_OP
;;105	MOVZ	R0, r0x1042
;;103	MOV	r0x1045, R0
;;1	CLR	r0x1046
;	op : CAST
;;104	MOVZ	R0, r0x1045
;	.line	338; "../main.c"	NVMADDRH=(unsigned char) (address>>8);
	BANKSEL	r0x1042
	MOVZ	R0, r0x1042
	BANKSEL	_NVMADDRH
	MOV	_NVMADDRH, R0
;	op : CAST
;	.line	339; "../main.c"	NVMADDRL=address;
	BANKSEL	r0x1043
	MOVZ	R0, r0x1043
	BANKSEL	_NVMADDRL
	MOV	_NVMADDRL, R0
;	op : INLINEASM
	;
	BANKSEL _INTCTL
	MOV R1,_INTCTL
	;
	CLR _INTCTL,_PUIE
	CLR _INTCTL,_AIE
	JNB _INTCTL,_AIE
	JMP $-2
	;
	MOV R0,#0x30
	MOV R2,_OSCCTL
	MOV _OSCCTL,R0
	;
	MOV R3,#_FLASH_BUFFER
	
;	op : =
;	.line	358; "../main.c"	while(length--)		// 仅使用R0，不改变R1
	BANKSEL	r0x1044
	MOVZ	R0, r0x1044
	BANKSEL	r0x1043
	MOV	r0x1043, R0
;	op : LABEL
;	op : =
_00041_DS_
	BANKSEL	r0x1043
	MOVZ	R0, r0x1043
	BANKSEL	r0x1042
	MOV	r0x1042, R0
;	op : -
	BANKSEL	r0x1043
	DEC	r0x1043
;	op : IFX
	MOV	R0,# 0x00
	BANKSEL	r0x1042
	ORL	R0, r0x1042
	JNB	PSW, 2
	JMP	_00043_DS_
;	op : INLINEASM
	;
	BANKSEL _FLASH_BUFFER
	LD R6,[R3]
	INC R3
	LD R7,[R3]
	INC R3
	BANKSEL _NVMDATAH
	MOV _NVMDATAH,R7
	MOV _NVMDATAL,R6
	;
	MOV R5 ,#0x84
	MOV _NVMCTL0,R5
	MOV R5,#0x69
	MOV _NVMCTL1,R5
	MOV R5,#0x96
	MOV _NVMCTL1,R5
	SET _NVMCTL0 , 1 ;
	NOPZ
	NOPZ
	NOPZ
	NOPZ
	NOPZ
	NOPZ ;
	NOPZ
	NOPZ
	NOPZ
	NOPZ
	MOV R5,#0X80
	MOV _NVMCTL0,R5
	;
	BANKSEL _NVMADDRL
	INC _NVMADDRL
	
;	op : GOTO
	JMP	_00041_DS_
;	op : LABEL
;	op : INLINEASM
_00043_DS_
	;
	BANKSEL _OSCCTL
	MOV _OSCCTL,R2
	AND R1,#0xC0 ;
	ORL _INTCTL,R1
	
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _FLASH_WRITE_FUN



func._FLASH_READ_FUN	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _FLASH_READ_FUN	;Function start
; 2 exit points
;has an exit
;7 compiler assigned registers:
;   r0x1042
;   STK00
;   r0x1043
;   STK01
;   r0x1044
;   r0x1045
;   r0x1046
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_FLASH_READ_FUN	;Function start
; 2 exit points
;	op : RECEIVE
;	.line	204; "../main.c"	void FLASH_READ_FUN(unsigned int address,unsigned char length)
	BANKSEL	r0x1042
	MOV	r0x1042, R0
	BANKSEL	STK00
	MOVZ	R0, STK00
	BANKSEL	r0x1043
	MOV	r0x1043, R0
;	op : RECEIVE
	BANKSEL	STK01
	MOVZ	R0, STK01
	BANKSEL	r0x1044
	MOV	r0x1044, R0
;	op : RIGHT_OP
;;102	MOVZ	R0, r0x1042
;;100	MOV	r0x1045, R0
;;1	CLR	r0x1046
;	op : CAST
;;101	MOVZ	R0, r0x1045
;	.line	208; "../main.c"	NVMADDRH=(unsigned char) (address>>8);
	BANKSEL	r0x1042
	MOVZ	R0, r0x1042
	BANKSEL	_NVMADDRH
	MOV	_NVMADDRH, R0
;	op : CAST
;	.line	209; "../main.c"	NVMADDRL=address;
	BANKSEL	r0x1043
	MOVZ	R0, r0x1043
	BANKSEL	_NVMADDRL
	MOV	_NVMADDRL, R0
;	op : INLINEASM
	;
	BANKSEL _INTCTL
	MOV R1,_INTCTL
	;
	CLR _INTCTL,_AIE
	JNB _INTCTL,_AIE
	JMP $-2
	;
	MOV R0,#0x30
	MOV R2,_OSCCTL
	MOV _OSCCTL,R0
	;
	MOV R3,#_FLASH_BUFFER
	
;	op : =
;	.line	227; "../main.c"	while(length--)	// 仅使用R0，不改变R1
	BANKSEL	r0x1044
	MOVZ	R0, r0x1044
	BANKSEL	r0x1043
	MOV	r0x1043, R0
;	op : LABEL
;	op : =
_00033_DS_
	BANKSEL	r0x1043
	MOVZ	R0, r0x1043
	BANKSEL	r0x1042
	MOV	r0x1042, R0
;	op : -
	BANKSEL	r0x1043
	DEC	r0x1043
;	op : IFX
	MOV	R0,# 0x00
	BANKSEL	r0x1042
	ORL	R0, r0x1042
	JNB	PSW, 2
	JMP	_00035_DS_
;	op : INLINEASM
	;
	BANKSEL _NVMCTL0
	MOV R5,#0x81
	MOV _NVMCTL0,R5
	NOPZ
	NOPZ
	NOPZ ;
	NOPZ
	;
	BANKSEL _NVMDATAL
	MOV R6,_NVMDATAL
	MOV R7,_NVMDATAH
	BANKSEL _FLASH_BUFFER
	ST [R3],R6
	INC R3
	ST [R3],R7
	INC R3
	;
	BANKSEL _NVMADDRL
	INC _NVMADDRL
	JNB _PSW,_Z
	INC _NVMADDRH
	
;	op : GOTO
	JMP	_00033_DS_
;	op : LABEL
;	op : INLINEASM
_00035_DS_
	;
	BANKSEL _OSCCTL
	MOV _OSCCTL,R2
	AND R1,#0xC0 ;
	ORL _INTCTL,R1
	
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _FLASH_READ_FUN



func._FLASH_READ_ONE	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _FLASH_READ_ONE	;Function start
; 2 exit points
;has an exit
;5 compiler assigned registers:
;   r0x104F
;   STK00
;   r0x1050
;   r0x1051
;   r0x1052
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_FLASH_READ_ONE	;Function start
; 2 exit points
;	op : RECEIVE
	BANKSEL	r0x1051
	MOV	r0x1051, R0
;;1	MOV	r0x104F, R0
;	.line	112; "../main.c"	unsigned int FLASH_READ_ONE(unsigned int address)
	BANKSEL	STK00
	MOVZ	R0, STK00
	BANKSEL	r0x1050
	MOV	r0x1050, R0
;	op : RIGHT_OP
;;99	MOVZ	R0, r0x104F
;;1	CLR	r0x1052
;	op : CAST
;	.line	118; "../main.c"	NVMADDRH=(unsigned char)(address>>8);
	BANKSEL	r0x1051
	MOVZ	R0, r0x1051
	BANKSEL	_NVMADDRH
	MOV	_NVMADDRH, R0
;	op : CAST
;	.line	119; "../main.c"	NVMADDRL=(unsigned char)address;
	BANKSEL	r0x1050
	MOVZ	R0, r0x1050
	BANKSEL	_NVMADDRL
	MOV	_NVMADDRL, R0
;	op : INLINEASM
	;
	BANKSEL _INTCTL
	MOV R1,_INTCTL
	;
	CLR _INTCTL,_AIE
	JNB _INTCTL,_AIE
	JMP $-2
	;
	MOV R0,#0x30
	MOV R2,_OSCCTL
	MOV _OSCCTL,R0
	;
	BANKSEL _NVMCTL0
	MOV R5,#0x81
	MOV _NVMCTL0,R5
	NOPZ
	NOPZ
	NOPZ
	NOPZ
	;
	MOV _OSCCTL,R2
	AND R1,#0xC0 ;
	ORL INTCTL,R1
	;
	BANKSEL _NVMDATAL
	MOV R6,_NVMDATAL
	MOV R7,_NVMDATAH
	BANKSEL _FLASH_READ_BUF
	MOV (_FLASH_READ_BUF),R6
	MOV (_FLASH_READ_BUF+1),R7
	
;	op : RETURN
;	.line	152; "../main.c"	return 	FLASH_READ_BUF;
	BANKSEL	_FLASH_READ_BUF
	MOVZ	R0, _FLASH_READ_BUF
	BANKSEL	STK00
	MOV	STK00, R0
	BANKSEL	_FLASH_READ_BUF
	MOVZ	R0, (_FLASH_READ_BUF + 1)
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _FLASH_READ_ONE



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	40; "../main.c"	OSCCTL = 0x60;                           //设置为8M
	MOV	R0,# 0x60
	BANKSEL	_OSCCTL
	MOV	_OSCCTL, R0
;	op : =
;	.line	42; "../main.c"	TR0 = 0x04;				                 //设置P0端口 	1100 1111
	MOV	R0,# 0x04
	BANKSEL	_TR0
	MOV	_TR0, R0
;	op : =
;	.line	43; "../main.c"	TR1 = 0x00;				                 //设置P1端口	0000 0000
	BANKSEL	_TR1
	CLR	_TR1
;	op : =
;	.line	44; "../main.c"	TR2 = 0x00;				                 //设置P2端口	0011 1111
	BANKSEL	_TR2
	CLR	_TR2
;	op : =
;	.line	45; "../main.c"	P0 = 0x00;
	BANKSEL	_P0
	CLR	_P0
;	op : =
;	.line	46; "../main.c"	P1 = 0x80;			//P1.6 P1.7 指示运行结束灯
	MOV	R0,# 0x80
	BANKSEL	_P1
	MOV	_P1, R0
;	op : =
;	.line	47; "../main.c"	P2 = 0xF0;
	MOV	R0,# 0xf0
	BANKSEL	_P2
	MOV	_P2, R0
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _init_mcu


;	code size estimation:
;	  237+  127 =   364 instructions (  982 byte)


	.end
