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

.PROC and .PROCEND Directives

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The .PROC and .PROCEND directives bracket the instructions within a procedure.

Syntax

.PROC

Lines of Code

.PROCEND

Discussion

The .PROC directive signifies that the next instruction is the first instruction of a procedure. The .PROCEND directive signifies that the previous instruction was the last instruction of the procedure. Switching spaces or subspaces within a procedure is not permitted.

Every procedure must contain a .CALLINFO directive and normally contains an .ENTER and .LEAVE pseudo-operation. The only exception to the latter rule occurs in procedures that are either compiler-generated or created by programmers who are writing their own entry and exit code sequences. In this case, you must use the .ENTRY and .EXIT compiler directives.

NOTE: Because the .ENTER and .LEAVE pseudo-operations guarantee that the stack unwind process works correctly, you should consistently use these directives rather than writing your own entry and exit code sequences.

Example

This template shows a procedure that follows the procedure-calling convention.

     .CODE
test
.PROC
.CALLINFO
.ENTER
COMCLR,= %arg0,%arg1,%ret0
LDI 1,%ret0
.LEAVE
.PROCEND
.EXPORT test
© 1998 Hewlett-Packard Development Company, L.P.