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

📄 bsecrt0.s

📁 ppc860的ucos part
💻 S
字号:
#
# bsecrt0.s
#
# PowerPC C Runtime Initialization code for embedded Diab environment
# Adapted from Diab PowerPC crt0.s code
#
# Functions:
#	None
#
# Author: Harry E. Barnett 11/11/99
# harryb@hbbse.com http://www.hbbse.com
#
# Version V1.00
#
#####################################################################


	.list
	.file		"bsecrt0.s"
	.title		"MPC823 C Runtime Initialzation code (Diab)"

	.global		_start

	.text
	.align		2
#	.org		0x4000

_start:
	addis		r11,r0,__SP_INIT@ha	# Initialize stack pointer r1 to
	addi		r1,r11,__SP_INIT@l	# value in linker command file.
	addis		r13,r0,_SDA_BASE_@ha	# Initialize r13 to sdata base
	addi		r13,r13,_SDA_BASE_@l	# (provided by linker).
	addis		r2,r0,_SDA2_BASE_@ha	# Initialize r2 to sdata2 base
	addi		r2,r2,_SDA2_BASE_@l	# (provided by linker).
	addi		r0,r0,0			# Clear r0.
	stwu		r0,-64(r1)		# Terminate stack.

#
# Insert other initialization code here.
#

	bl		__init_main	# Finish initialization; call main().
	b		exit		# Never returns.
	bl		main		# Dummy to pull in main() as soon as
					# possible.
    
#------------------------------------------------------------- .init section --
	.section	.init$00,4,C
	.globl		__init
__init:					# Entry to __init, called by
	mfspr		r0,8		# __init_main called above.
	stwu		r1,-64(r1)
	stw		r0,68(r1)

	# Linker places .init sections from other modules, containing	    
	# calls to initialize global objects, here.			    

	.section	.init$99,4,C
	lwz		r0,68(r1)	# Return from __init.
	addi		r1,r1,64
	mtspr		8,r0
	blr

#------------------------------------------------------------- .fini section --
	.section	.fini$00,4,C
	.globl		__fini
__fini:					# Entry to __fini, called by exit().
	mfspr		r0,8
	stwu		r1,-64(r1)
	stw		r0,68(r1)

	# Linker places .fini sections from other modules, containing	    
	# calls to destroy global objects, here.			    

	.section	.fini$99,4,C
	lwz		r0,68(r1)	# Return from __fini.
	addi		r1,r1,64
	mtspr		8,r0
	blr

⌨️ 快捷键说明

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