Chapter 9 Writing Machine Language Instructions and Directive Statements

Usage Example

The following gives an example of funcinfo usage.

 

global

_0func

_TEXT

section

CODE, PUBLIC, 1

 

:

 

 

call

_0func

 

:

 

 

global

_0func, _func

_TEXT

section

CODE, PUBLIC, 1

_func

movm

[D2], (SP)

 

 

add

-4, SP

_0func

funcinfo

_func, 8, [D2]

 

:

 

 

:

 

 

ret

 

NOTE:

The ret and retf instructions free the stack frame and restore registers from the

 

 

stack.

 

 

The assembler bases this code on the information provided by the funcinfo

 

 

directive. For this reason, the ret and retf instructions cannot precede the

 

 

funcinfo directive.

 

 

 

178 Writing Directive Statements

Page 190
Image 190
Panasonic MN1030 user manual Call 0func Global 0func, func, Func Movm D2, SP Add 0func Funcinfo Func, 8, D2 Ret, Stack