![Xilinx Virtex-II Pro PPC405 Скачать руководство пользователя страница 64](http://html1.mh-extra.com/html/xilinx/virtex-ii-pro-ppc405/virtex-ii-pro-ppc405_user-manual_3410279064.webp)
372
March 2002 Release
1-800-255-7778
Virtex-II Pro™ Platform FPGA Documentation
Chapter 3:
User Programming Model
R
-
B
returns to
A
—use the
bclr
instruction with the link-register option disabled
(LK=0). The return address is in, or can be restored to, the LR.
•
Indirect subroutine linkage, where
A
calls
Glue
,
Glue
calls
B
, and
B
returns to
A
rather
than to
Glue
.
Such a calling sequence is common in linkage code where the subroutine that the
programmer wants to call,
B
, is in a different module than the caller,
A
. The binder
inserts “glue” code to mediate the branch:
-
A
calls
Glue
—use a branch instruction that sets the LR with the link-register
option enabled (LK=1).
-
Glue
calls
B
—write the address of
B
in the CTR, and use the
bcctr
instruction with
the link-register option disabled (LK=0).
-
B
returns to
A
—use the
bclr
instruction with the link-register option disabled
(LK=0). The return address is in, or can be restored to, the LR.
Branch-Target Address Calculation
Branch instructions compute the effective address (EA) of the next instruction using the
following addressing modes:
•
Branch to relative (conditional and unconditional).
•
Branch to absolute (conditional and unconditional).
•
Branch to link register (conditional only).
•
Branch to count register (conditional only).
Instruction addresses are always assumed to be word aligned. PowerPC processors ignore
the two low-order bits of the generated branch-target address.
Branch to Relative
Instructions that use
branch-to-relative
addressing generate the next-instruction address by
right-extending 0b00 to the immediate-displacement operand (LI), and then sign-
extending the result. That result is added to the current-instruction address to produce the
next-instruction address. Branches using this addressing mode must have the absolute-
addressing option disabled by clearing the AA instruction field (bit 30) to 0. The link-
register update option is enabled by setting the LK instruction field (bit 31) to 1. This
option causes the effective address of the instruction following the branch instruction to be
loaded into the LR.
shows how the branch-target address is generated when using the branch-to-
relative addressing mode.
Содержание Virtex-II Pro PPC405
Страница 1: ...R Volume 2 a PPC405 User Manual Virtex II Pro Platform FPGA Developer s Kit March 2002 Release...
Страница 14: ...322 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation Preface R...
Страница 252: ...560 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation R...
Страница 260: ...568 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation R...
Страница 562: ...870 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation R...