Assembler Directives and
.ENTRY and .EXIT Directives
.ENTRY and .EXIT Directives
.ENTRY and .EXIT are compiler generated directives that mark the entry point and return point of the current procedure.
Syntax
.ENTRY
Lines of Code
.EXIT
Discussion
The .ENTRY directive signifies that the next instruction is the beginning of an entry point for the current procedure. The .EXIT directive signifies that the next instruction initiates a return from the current procedure.
These directives must be used when .ENTER and .LEAVE are not present. .ENTRY and .EXIT are optional if the unwind region does not have a corresponding entry or exit. See the documents under the topic
Example
This example shows a sequence of
.PROC |
|
|
.CALLINFO | CALLER |
|
.ENTRY |
| ; proc entry code follows |
STW | ; stack the return pointer | |
LDO | 48(%sp),%sp | ; set up user stack pointer |
ADDIL | ; point to printf data | |
.CALL |
| ; set up for printf call |
BL | printf,2 | ; call printf thru RP |
LDO | ||
printf L$exit1 |
| ; hide from linker |
LDW | ; get callee RP | |
BV | 0(%r2) | ; exit thru RP |
.EXIT |
| ; end of exit sequence |
LDO | ; delete stack frame | |
.PROCEND |
|
|
Chapter 4 | 83 |