OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [testsuite/] [gas/] [cfi/] [cfi-m68k.s] - Rev 156

Go to most recent revision | Compare with Previous | Blame | View Log

#; $ as -o test.o gas-cfi-test.s && gcc -nostdlib -o test test.o
 
	.text
 
#; func_locvars
#; - function with a space on the stack 
#;   allocated for local variables
 
	.type	func_locvars,@function
func_locvars:
	.cfi_startproc
 
	#; alocate space for local vars
	suba.w	#0x1234,%sp
	.cfi_adjust_cfa_offset	0x1234
 
	#; dummy body
	moveq.l	#1,%d0
 
	#; release space of local vars and return
	adda.w	#0x1234,%sp
	.cfi_adjust_cfa_offset	-0x1234
	rts
	.cfi_endproc
 
#; func_prologue
#; - functions that begins with standard
#;   prologue: "link %a6,#0"
 
	.type	func_prologue,@function
func_prologue:
	.cfi_startproc
 
	#; prologue, CFI is valid after 
	#; each instruction.
	link	%a6,#0
	.cfi_def_cfa_offset	8
	.cfi_offset		a6,-8
	.cfi_def_cfa_register	a6
 
	#; function body
	jbsr	func_locvars
	addq.l	#3, %d0
 
	#; epilogue with valid CFI
	#; (we're better than gcc :-)
	unlk	%a6
	.cfi_def_cfa_register	sp
	rts
	.cfi_endproc
 
#; main
#; - typical function
	.type	main,@function
main:
	.cfi_startproc
 
	#; only function body that doesn't
	#; touch the stack at all.
	jbsr	func_prologue
 
	#; return
	rts
	.cfi_endproc
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.