This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: poke function ....


>What will happen in stack whenever the function pokeb
>is being called?? Is the same like Intel where the frame pointer

when you call the function the return PC is pushed onto the stack.
if the function needs a stack frame, it must create one:

pokeb:
	link	%a6,#<sizeof-frame>
	move.l  8(%a6),%a0
	add.l   12(%a6),%a0
	move.b  19(%a6),(%a0)
	unlk	%a6
	rts

the argument offsets change by 4 to account for the saved frame pointer

of course, in this simple example, the function doesn't need
a stack frame...  gcc has an option (omit-frame-pointer) to
tell the compiler not to use frame pointers at all...

r