Intel i86W Manual page 152

Table of Contents

Advertisement

31
INTEGER
ZERO
RETURN ADDRESS
STACK POINTER
FRAME POINTER
LOCALS
PARAMETERS
TEMPORARIES
-'-
ADDRESS TEMP.
o
PROGRAMMING MODEL
rO
rl
r2
r3
r4
r5
r6
r7
r8
r9
rl0
rll
r12
r13
r14
r15
r16
r17
r18
r19
r20
r21
r22
r23
r24
r25
r26
r27
r28
r29
r30
r31
63
FLOATING-POINT
ZERO
!
LOCALS
PARAA ETERS
TEMPORARIES
Figure 8-1. Register Allocation
8.1.1 Integer Registers
o
to
f2
f4
f6
f8
flO
f12
f14
f16
f18
f20
f22
f24
f26
f28
130
240329i
Up to 12 parameters can be passed in the integer registers. The first (leftmost) param-
eter is passed in
r16
(if it is an integer), the rest in successively higher-numbered regis-
ters.
If
fewer parameters are required, the remaining registers can be used for temporary
variables.
If
more than 12 parameters are required, the overflow can be passed in mem-
ory on the stack.
Register
r16
is both a parameter register and a return value register.
If
a subroutine has
an integral or pointer return value, it loads the return value into
r16
before returning
control to the caller.
Register
r1
is the required return-address register, because the
call
and
calli
instructions
use it to save the return address. Subroutines are therefore required to use the value in
r1
to return to the caller.
If
a subroutine saves
r1,
it may then use it as a temporary until
it returns.
8-2

Advertisement

Table of Contents
loading

Table of Contents