7-1
7
CHAPTER 7
PROCEDURE CALLS
This chapter describes mechanisms for making procedure calls, which include branch-and-link
instructions, built-in call and return mechanism, call instructions (
call
,
callx
,
calls
), return
instruction (
ret
) and call actions caused by interrupts and faults.
The i960
®
processor architecture supports two methods for making procedure calls:
•
A RISC-style branch-and-link: a fast call best suited for calling procedures that do not call
other procedures.
•
An integrated call and return mechanism: a more versatile method for making procedure calls,
providing a highly efficient means for managing a large number of registers and the program stack.
On a branch-and-link (
bal
,
balx
), the processor branches and saves a return IP in a register. The
called procedure uses the same set of registers and the same stack as the calling procedure. On a
call (
call
,
callx
,
calls
) or when an interrupt or fault occurs, the processor also branches to a target
instruction and saves a return IP. Additionally, the processor saves the local registers and allocates
a new set of local registers and a new stack for the called procedure. The saved context is restored
when the return instruction (
ret
) executes.
In many RISC architectures, a branch-and-link instruction is used as the base instruction for coding
a procedure call. The user program then handles register and stack management for the call. Since
the i960 architecture provides a fully integrated call and return mechanism, coding calls with
branch-and-link are not necessary. Additionally, the integrated call is much faster than typical
RISC-coded calls.
The branch-and-link instruction in the i960 processor family, therefore, is used primarily for
calling leaf procedures. Leaf procedures call no other procedures; they reside at the “leaves” of the
call tree.
In the i960 architecture the integrated call and return mechanism is used in two ways:
•
explicit calls to procedures in a user’s program
•
implicit calls to interrupt and fault handlers
The remainder of this chapter explains the generalized call mechanism used for explicit and
implicit calls and call and return instructions.
Summary of Contents for i960 Jx
Page 1: ...Release Date December 1997 Order Number 272483 002 i960 Jx Microprocessor Developer s Manual ...
Page 24: ......
Page 25: ...1 INTRODUCTION ...
Page 26: ......
Page 35: ...2 DATA TYPES AND MEMORY ADDRESSING MODES ...
Page 36: ......
Page 46: ......
Page 47: ...3 PROGRAMMING ENVIRONMENT ...
Page 48: ......
Page 73: ...4 CACHE AND ON CHIP DATA RAM ...
Page 74: ......
Page 85: ...5 INSTRUCTION SET OVERVIEW ...
Page 86: ......
Page 111: ...6 INSTRUCTION SET REFERENCE ...
Page 112: ......
Page 233: ...7 PROCEDURE CALLS ...
Page 234: ......
Page 256: ......
Page 257: ...8 FAULTS ...
Page 258: ......
Page 291: ...9 TRACING AND DEBUGGING ...
Page 292: ......
Page 309: ...10 TIMERS ...
Page 310: ......
Page 324: ......
Page 325: ...11 INTERRUPTS ...
Page 326: ......
Page 369: ...12 INITIALIZATION AND SYSTEM REQUIREMENTS ...
Page 370: ......
Page 412: ......
Page 413: ...13 MEMORY CONFIGURATION ...
Page 414: ......
Page 429: ...14 EXTERNAL BUS ...
Page 430: ......
Page 468: ......
Page 469: ...15 TEST FEATURES ...
Page 470: ......
Page 493: ...A CONSIDERATIONS FOR WRITING PORTABLE CODE ...
Page 494: ......
Page 502: ......
Page 503: ...B OPCODES AND EXECUTION TIMES ...
Page 504: ......
Page 515: ...C MACHINE LEVEL INSTRUCTION FORMATS ...
Page 516: ......
Page 523: ...D REGISTER AND DATA STRUCTURES ...
Page 524: ......
Page 550: ......
Page 551: ...GLOSSARY ...
Page 552: ......
Page 561: ...INDEX ...
Page 562: ......
Page 578: ......