Program Structure

Registers and Register Mnemonics

Some additional predefined register mnemonics are provided in “Register Procedure Calling Conventions” on page 28 to match the standard procedure-calling convention. This is discussed briefly in “HP-UX Architecture Conventions” on page 39. You can find detailed information on both 32-bit and 64-bit calling conventions under the topic PA-RISC Architecture at URL: http://www.software.hp.com/STK/.

Table 2-7

Register Procedure Calling Conventions

 

 

 

 

 

 

 

Register

Synonyms

Description

 

 

 

 

 

 

 

%fr4

%farg0 %fret

Floating argument, return value

 

 

%fr5

%farg1

Second floating argument

 

 

%fr6

%farg2

Third floating argument

 

 

%fr7

%farg3

Fourth floating argument

 

 

%r2

%rp

Return link

 

 

%r19

%t4

Fourth temporary register

 

 

%r20

%t3

Third temporary register

 

 

%r21

%t2

Second temporary register

 

 

%r22

%t1

First temporary register

 

 

%r23

%arg3

Argument word 3

 

 

%r24

%arg2

Argument word 2

 

 

%r25

%arg1

Argument word 1

 

 

%r26

%arg0

Argument word 0

 

 

%r27

%dp

Data pointer

 

 

%r28

%ret0

Return value

 

 

%r29

%ret1 %sl

Return value, static link

 

 

%r30

%sp

Stack pointer

 

 

%r31

%mrp

Millicode return link

 

 

%sr1

%sret %sarg

Return value, argument

 

 

 

 

 

In addition, there is a special register mnemonic defined as %previous_sp, that allows access to the previous value of the stack pointer.

%previous_sp must be used in the position of a base register; it can be used only between .ENTER and .LEAVE pseudo-operations. %previous_sp is the same as %sp unless the current .PROC has a large

28

Chapter 2

Page 28
Image 28
HP UX Developer Tools manual Register Procedure Calling Conventions, Register Synonyms Description