⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 v3k_fram_use_example_sdcc.asm

📁 这是ramtron公司的铁电单片机的开发程序
💻 ASM
📖 第 1 页 / 共 2 页
字号:
	.area PSEG    (PAG,XDATA)
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
	.area XSEG    (XDATA)
G$frambase$0$0 == 0x8000
_frambase	=	0x8000
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG   (XDATA)
	.area CSEG    (CODE)
	.area GSINIT0 (CODE)
	.area GSINIT1 (CODE)
	.area GSINIT2 (CODE)
	.area GSINIT3 (CODE)
	.area GSINIT4 (CODE)
	.area GSINIT5 (CODE)
;--------------------------------------------------------
; interrupt vector 
;--------------------------------------------------------
	.area CSEG    (CODE)
__interrupt_vect:
	ljmp	__sdcc_gsinit_startup
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area CSEG    (CODE)
	.area GSINIT  (CODE)
	.area GSFINAL (CODE)
	.area GSINIT  (CODE)
	.globl __sdcc_gsinit_startup
	.globl __sdcc_program_startup
	.globl __start__stack
	.globl __mcs51_genXINIT
	.globl __mcs51_genXRAMCLEAR
	.globl __mcs51_genRAMCLEAR
	G$main$0$0 ==.
	C$V3K_FRAM_Use_Example_SDCC.c$27$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:27: xdata unsigned char * data framptr = &frambase ;		//Init a pointer in IRAM pointing to the frambase var.
;     genAddrOf
	mov	_framptr,#_frambase
	mov	(_framptr + 1),#(_frambase >> 8)
	.area GSFINAL (CODE)
	ljmp	__sdcc_program_startup
;--------------------------------------------------------
; Home
;--------------------------------------------------------
	.area HOME    (CODE)
	.area CSEG    (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area CSEG    (CODE)
__sdcc_program_startup:
	lcall	_main
;	return from main will lock up
	sjmp .
;------------------------------------------------------------
;Allocation info for local variables in function 'main'
;------------------------------------------------------------
;cptr                      Allocated with name '_main_cptr_1_1'
;framread                  Allocated with name '_main_framread_1_1'
;------------------------------------------------------------
	G$main$0$0 ==.
	C$V3K_FRAM_Use_Example_SDCC.c$33$0$0 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:33: void main (void){
;	-----------------------------------------
;	 function main
;	-----------------------------------------
_main:
	ar2 = 0x02
	ar3 = 0x03
	ar4 = 0x04
	ar5 = 0x05
	ar6 = 0x06
	ar7 = 0x07
	ar0 = 0x00
	ar1 = 0x01
	C$V3K_FRAM_Use_Example_SDCC.c$34$1$0 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:34: volatile idata int  cptr= 0x00;					   //general purpose counter
;     genAssign
	mov	r0,#_main_cptr_1_1
	clr	a
	mov	@r0,a
	inc	r0
	mov	@r0,a
	C$V3K_FRAM_Use_Example_SDCC.c$35$1$0 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:35: volatile idata char framread = 0x00;
;     genAssign
	mov	r0,#_main_framread_1_1
	mov	@r0,#0x00
	C$V3K_FRAM_Use_Example_SDCC.c$37$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:37: DEVMEMCFG  |= 0xC0;					     //Activate the FRAM
;     genOr
	orl	_DEVMEMCFG,#0xC0
	C$V3K_FRAM_Use_Example_SDCC.c$40$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:40: FRAMCFG1 = 0x01;						//Set FRAMWEL = 1 Enable Write  (FRAMOP = 00)
;     genAssign
	mov	_FRAMCFG1,#0x01
	C$V3K_FRAM_Use_Example_SDCC.c$41$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:41: while(!(FRAMCFG1&0x80));					//Wait FREADIDLE == 1  (FRAM IDLE)
00101$:
;     genAnd
	mov	a,_FRAMCFG1
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	acc.7,00101$
00170$:
	C$V3K_FRAM_Use_Example_SDCC.c$43$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:43: FRAMCFG2 = 0x00;						//Configure FRAMCFG2 to remove FRAM content Protection 
;     genAssign
	mov	_FRAMCFG2,#0x00
	C$V3K_FRAM_Use_Example_SDCC.c$44$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:44: FRAMCFG1 = 0x07;						//Execute Transfert of FRAMCFG2 module to FRAM Module
;     genAssign
	mov	_FRAMCFG1,#0x07
	C$V3K_FRAM_Use_Example_SDCC.c$45$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:45: while(!(FRAMCFG1&0x80));					//Wait FREADIDLE == 1  (FRAM IDLE)
00104$:
;     genAnd
	mov	a,_FRAMCFG1
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	acc.7,00104$
00171$:
	C$V3K_FRAM_Use_Example_SDCC.c$47$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:47: FRAMCFG1 = 0x03;						//Disable the write operations 
;     genAssign
	mov	_FRAMCFG1,#0x03
	C$V3K_FRAM_Use_Example_SDCC.c$49$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:49: while(!(FRAMCFG1&0x80));					//Wait FREADIDLE == 1  (FRAM IDLE)
00107$:
;     genAnd
	mov	a,_FRAMCFG1
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	acc.7,00107$
00172$:
	C$V3K_FRAM_Use_Example_SDCC.c$53$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:53: for(cptr = 0; cptr < 0x2000; cptr++)
;     genAssign
	mov	r0,#_main_cptr_1_1
	clr	a
	mov	@r0,a
	inc	r0
	mov	@r0,a
00131$:
;     genCmpLt
	mov	r0,#_main_cptr_1_1
;     genCmp
	clr	c
	mov	a,@r0
	subb	a,#0x00
	inc	r0
	mov	a,@r0
	xrl	a,#0x80
	subb	a,#0xa0
;     genIfxJump
;	Peephole 108	removed ljmp by inverse jump logic
	jnc	00134$
00173$:
	C$V3K_FRAM_Use_Example_SDCC.c$54$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:54: *(framptr+cptr) = 0x55;
;     genPlus
	mov	r0,#_main_cptr_1_1
	mov	a,@r0
	add	a,_framptr
	mov	dpl,a
	inc	r0
	mov	a,@r0
	addc	a,(_framptr + 1)
	mov	dph,a
;     genPointerSet
;     genFarPointerSet
	mov	a,#0x55
	movx	@dptr,a
	C$V3K_FRAM_Use_Example_SDCC.c$53$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:53: for(cptr = 0; cptr < 0x2000; cptr++)
;     genPlus
	mov	r0,#_main_cptr_1_1
;     genPlusIncr
	mov	a,#0x01
	add	a,@r0
	mov	@r0,a
;	Peephole 181	changed mov to clr
	clr	a
	inc	r0
	addc	a,@r0
	mov	@r0,a
;	Peephole 112.b	changed ljmp to sjmp
	sjmp	00131$
00134$:
	C$V3K_FRAM_Use_Example_SDCC.c$58$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:58: framread = *(framptr + 0x0100);         //framread will contain 0x55
;     genPlus
;     genPlus shortcut
	mov	r2,_framptr
	mov	a,#0x01
	add	a,(_framptr + 1)
	mov	r3,a
;     genPointerGet
;     genFarPointerGet
	mov	dpl,r2
	mov	dph,r3
	movx	a,@dptr
	mov	r4,a
;     genAssign
	mov	r0,#_main_framread_1_1
	mov	@r0,ar4
	C$V3K_FRAM_Use_Example_SDCC.c$61$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:61: *(framptr + 0x0100) = 0x23;
;     genPointerSet
;     genFarPointerSet
	mov	dpl,r2
	mov	dph,r3
	mov	a,#0x23
	movx	@dptr,a
	C$V3K_FRAM_Use_Example_SDCC.c$64$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:64: framread = *(framptr + 0x0100);        //framread will contain 0x23
;     genPointerGet
;     genFarPointerGet
	mov	dpl,r2
	mov	dph,r3
	movx	a,@dptr
	mov	r2,a
;     genAssign
	mov	r0,#_main_framread_1_1
	mov	@r0,ar2
	C$V3K_FRAM_Use_Example_SDCC.c$65$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:65: framread = *(framptr + 0x0101);         //framread will contain 0x55
;     genPlus
	mov	a,#0x01
	add	a,_framptr
	mov	dpl,a
	mov	a,#0x01
	addc	a,(_framptr + 1)
	mov	dph,a
;     genPointerGet
;     genFarPointerGet
	movx	a,@dptr
	mov	r2,a
;     genAssign
	mov	r0,#_main_framread_1_1
	mov	@r0,ar2
	C$V3K_FRAM_Use_Example_SDCC.c$70$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:70: FRAMCFG1 = 0x01;						//Set FRAMWEL = 1 Enable Write  (FRAMOP = 00)
;     genAssign
	mov	_FRAMCFG1,#0x01
	C$V3K_FRAM_Use_Example_SDCC.c$71$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:71: while(!(FRAMCFG1&0x80));					//Wait FREADIDLE == 1  (FRAM IDLE)
00110$:
;     genAnd
	mov	a,_FRAMCFG1
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	acc.7,00110$
00174$:
	C$V3K_FRAM_Use_Example_SDCC.c$73$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:73: FRAMCFG2 = 0x0C;						//Configure FRAMCFG2 to protect the entire FRAM
;     genAssign
	mov	_FRAMCFG2,#0x0C
	C$V3K_FRAM_Use_Example_SDCC.c$75$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:75: FRAMCFG1 = 0x07;						//Execute Transfert of FRAMCFG2 module to FRAM Module
;     genAssign
	mov	_FRAMCFG1,#0x07
	C$V3K_FRAM_Use_Example_SDCC.c$76$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:76: while(!(FRAMCFG1&0x80));					//Wait FREADIDLE == 1  (FRAM IDLE)
00113$:
;     genAnd
	mov	a,_FRAMCFG1
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	acc.7,00113$
00175$:
	C$V3K_FRAM_Use_Example_SDCC.c$78$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:78: FRAMCFG1 = 0x03;						//Clear FRAMWEL (FRAMOP = 01)
;     genAssign
	mov	_FRAMCFG1,#0x03
	C$V3K_FRAM_Use_Example_SDCC.c$79$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:79: while(!(FRAMCFG1&0x80));					//Wait FREADIDLE == 1  (FRAM IDLE)
00116$:
;     genAnd
	mov	a,_FRAMCFG1
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	acc.7,00116$
00176$:
	C$V3K_FRAM_Use_Example_SDCC.c$85$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:85: for(cptr = 0; cptr < 0x2000; cptr++)
;     genAssign
	mov	r0,#_main_cptr_1_1
	clr	a
	mov	@r0,a
	inc	r0
	mov	@r0,a
00135$:
;     genCmpLt
	mov	r0,#_main_cptr_1_1
;     genCmp
	clr	c
	mov	a,@r0
	subb	a,#0x00
	inc	r0
	mov	a,@r0
	xrl	a,#0x80
	subb	a,#0xa0
;     genIfxJump
;	Peephole 108	removed ljmp by inverse jump logic
	jnc	00138$
00177$:
	C$V3K_FRAM_Use_Example_SDCC.c$86$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:86: *(framptr+cptr) = 0x00;		
;     genPlus
	mov	r0,#_main_cptr_1_1
	mov	a,@r0
	add	a,_framptr
	mov	dpl,a
	inc	r0
	mov	a,@r0
	addc	a,(_framptr + 1)
	mov	dph,a
;     genPointerSet
;     genFarPointerSet
;	Peephole 181	changed mov to clr
	clr	a
	movx	@dptr,a
	C$V3K_FRAM_Use_Example_SDCC.c$85$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:85: for(cptr = 0; cptr < 0x2000; cptr++)
;     genPlus
	mov	r0,#_main_cptr_1_1
;     genPlusIncr
	mov	a,#0x01
	add	a,@r0
	mov	@r0,a
;	Peephole 181	changed mov to clr
	clr	a
	inc	r0
	addc	a,@r0
	mov	@r0,a
;	Peephole 112.b	changed ljmp to sjmp
	sjmp	00135$
00138$:
	C$V3K_FRAM_Use_Example_SDCC.c$89$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:89: FRAMCFG1 = 0x01;						//Set FRAMWEL = 1 Enable Write  (FRAMOP = 00)
;     genAssign
	mov	_FRAMCFG1,#0x01
	C$V3K_FRAM_Use_Example_SDCC.c$90$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:90: while(!(FRAMCFG1&0x80));					//Wait FREADIDLE == 1  (FRAM IDLE)
00119$:
;     genAnd
	mov	a,_FRAMCFG1
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	acc.7,00119$
00178$:
	C$V3K_FRAM_Use_Example_SDCC.c$92$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:92: FRAMCFG2 = 0x00;						//Configure FRAMCFG2 to remove FRAM content Protection 
;     genAssign
	mov	_FRAMCFG2,#0x00
	C$V3K_FRAM_Use_Example_SDCC.c$93$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:93: FRAMCFG1 = 0x07;						//Execute Transfert of FRAMCFG2 module to FRAM Module
;     genAssign
	mov	_FRAMCFG1,#0x07
	C$V3K_FRAM_Use_Example_SDCC.c$94$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:94: while(!(FRAMCFG1&0x80));					//Wait FREADIDLE == 1  (FRAM IDLE)
00122$:
;     genAnd
	mov	a,_FRAMCFG1
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	acc.7,00122$
00179$:
	C$V3K_FRAM_Use_Example_SDCC.c$96$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:96: FRAMCFG1 = 0x03;						//Disable the write operations 
;     genAssign
	mov	_FRAMCFG1,#0x03
	C$V3K_FRAM_Use_Example_SDCC.c$98$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:98: while(!(FRAMCFG1&0x80));					//Wait FREADIDLE == 1  (FRAM IDLE)
00125$:
;     genAnd
	mov	a,_FRAMCFG1
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	acc.7,00125$
00180$:
	C$V3K_FRAM_Use_Example_SDCC.c$101$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:101: for(cptr = 0; cptr < 0x2000; cptr++)
;     genAssign
	mov	r0,#_main_cptr_1_1
	clr	a
	mov	@r0,a
	inc	r0
	mov	@r0,a
00139$:
;     genCmpLt
	mov	r0,#_main_cptr_1_1
;     genCmp
	clr	c
	mov	a,@r0
	subb	a,#0x00
	inc	r0
	mov	a,@r0
	xrl	a,#0x80
	subb	a,#0xa0
;     genIfxJump
;	Peephole 108	removed ljmp by inverse jump logic
	jnc	00129$
00181$:
	C$V3K_FRAM_Use_Example_SDCC.c$102$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:102: *(framptr+cptr) = 0x00;		
;     genPlus
	mov	r0,#_main_cptr_1_1
	mov	a,@r0
	add	a,_framptr
	mov	dpl,a
	inc	r0
	mov	a,@r0
	addc	a,(_framptr + 1)
	mov	dph,a
;     genPointerSet
;     genFarPointerSet
;	Peephole 181	changed mov to clr
	clr	a
	movx	@dptr,a
	C$V3K_FRAM_Use_Example_SDCC.c$101$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:101: for(cptr = 0; cptr < 0x2000; cptr++)
;     genPlus
	mov	r0,#_main_cptr_1_1
;     genPlusIncr
	mov	a,#0x01
	add	a,@r0
	mov	@r0,a
;	Peephole 181	changed mov to clr
	clr	a
	inc	r0
	addc	a,@r0
	mov	@r0,a
	C$V3K_FRAM_Use_Example_SDCC.c$105$1$1 ==.
;c:/APP_ENG/Released_Demo_Programs/V3k_demo_programs/V3K_FRAM_Demo_SDCC/V3K_FRAM_Use_Example_SDCC.c:105: while(1);
;	Peephole 112.b	changed ljmp to sjmp
	sjmp	00139$
00129$:
;	Peephole 112.b	changed ljmp to sjmp
	sjmp	00129$
00143$:
	C$V3K_FRAM_Use_Example_SDCC.c$117$1$1 ==.
	XG$main$0$0 ==.
	ret
	.area CSEG    (CODE)
	.area XINIT   (CODE)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -