Assembler Directives and Pseudo-Operations

 

 

.CALLINFO Directive

 

 

it restores the RP value when it encounters a .LEAVE

 

 

pseudo-operation. Generally, any procedure that calls

 

 

other routines should save the RP value.

 

SAVE_SP

Specifies that the current routine saves the value of

 

 

Previous_SP in its frame marker at SP-4. Because

 

 

the Assembler does not automatically save the Stack

 

 

Pointer when it generates Entry/Exit code sequences,

 

 

you must explicitly save this value in your program

 

 

when using this key word. You can obtain the

 

 

Previous_SP value from the special register

 

 

%previous_sp.

 

 

Programming languages, such as HP Pascal/HP-UX,

 

 

typically use this value for up-level display pointers to

 

 

reference local variables.

 

SAVE_SR0

Indicates that this millicode procedure saves %sr0 in

 

 

its frame marker at (SP-16). This parameter is not

 

 

valid for PA-RISC 2.0W (64-bit mode).

 

Discussion

 

 

When a program uses the .CALLINFO directive, all entry and exit code

 

must follow the procedure calling convention described in the documents

 

under the topic PA-RISC Architecture at URL:

 

http://www.software.hp.com/STK/. If you use the .ENTER and .LEAVE

 

directives, the Assembler will automatically generate the necessary code.

 

The parameters in the .CALLINFO directive govern the generation of the

 

Entry/Exit code sequence (except for SAVE_SP). However, if you use the

 

.ENTRY and .EXIT directives, your code must provide the necessary

 

Entry/Exit code sequences.

 

A stack frame consists of a pointer to the top of the frame, a frame

 

marker, a fixed argument list, and a variable argument list. The

 

following example, Stack Frames, illustrates these areas as an inverted

 

stack for PA-RISC 1.x and 2.0.

 

For PA-RISC 2.0W, 64-bit mode, the stack frame is different. Refer to the

NOTE

 

documents under the topic PA-RISC Architecture at URL:

 

http://www.software.hp.com/STK/.

 

 

 

Chapter 4

71