HPlogo HP Assembler Reference Manual: HP 9000 Computers > Chapter 4 Assembler Directives and Pseudo-Operations

.ENTER and .LEAVE Pseudo-Operations

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The .ENTER and .LEAVE pseudo-operations mark a procedure's entry and exit points. They instruct the Assembler to generate procedure entry and exit code sequences based on the information provided in the .CALLINFO directive.

Syntax

.ENTER

Lines of code

.LEAVE

Discussion

The .ENTER pseudo-operation marks an entry point for the current procedure. Every procedure that follows the standard procedure-calling convention must contain one .ENTER pseudo-operation. The calling conventions are described in the documents under the topic PA-RISC Architecture at URL: http://www.software.hp.com/STK/. The .LEAVE pseudo-operation marks a procedure's exit point. Every procedure that follows the procedure-calling convention must contain one .LEAVE pseudo-operation. See “.ENTRY and .EXIT Directives ” for exceptions.

When the Assembler encounters an .ENTER pseudo-operation, it generates an entry code sequence according to the parameters in the .CALLINFO directive for that procedure. Similarly, when the Assembler encounters a .LEAVE pseudo-operation, it generates an exit code sequence according to the parameters in the .CALLINFO directive for that procedure.

Example

This example shows the placement of the .ENTER and .LEAVE pseudo-operations.

   .SPACE $TEXT$
.SUBSPA $CODE$
entrypt
.PROC
.CALLINFO
.ENTER
SH1ADD %arg0,%arg1,%ret0
.LEAVE
.PROCEND
.EXPORT entrypt,ENTRY
.END
© 1998 Hewlett-Packard Development Company, L.P.