PROCEDURE CALLS
7-13
7
The argument list can be stored anywhere in memory; however, a convenient place to store an
argument list is in the stack for a calling procedure. Space for the argument list is created by incre-
menting the SP register value. When the argument list is stored in the current stack, the argument
list is automatically deallocated when no longer needed.
A procedure receives parameters from — and returns values to — other calling procedures. To do
this successfully and consistently, all procedures must agree on the use of the global registers.
Parameter registers pass values into a function. Up to 12 parameters can be passed by value using
the global registers. When the number of parameters exceeds 12, additional parameters are passed
using the calling procedure’s stack; a pointer to the argument list is passed in a pre-designated
register. Similarly, several registers are set aside for return arguments and a return argument block
pointer is defined to point to additional parameters. When the number of return arguments exceeds
the available number of return argument registers, the calling procedure passes a pointer to an
argument list on its stack where the remaining return values are placed.
Example 7-2
illustrates
parameter passing by value and by reference.
Local registers are automatically saved when a call is made. Because of the local register cache,
they are saved quickly and with no external bus traffic. The efficiency of the local register
mechanism plays an important role in two cases when calls are made:
1.
When a procedure is called which contains other calls, global parameter registers should be
moved to working local registers at the beginning of the procedure. In this way, parameter
registers are freed and nested calls are easily managed. The register move instruction
necessary to perform this action is very fast; the working parameters — now in local
registers — are saved efficiently when nested calls are made.
2.
When other procedures are nested within an interrupt or fault procedure, the procedure must
preserve all normally non-preserved parameter registers, such as the global registers. This is
necessary because the interrupt or fault occurs at any point in the user’s program and a return
from an interrupt or fault must restore the exact processor state. The interrupt or fault
procedure can move non-preserved global registers to local registers before the nested call.
Содержание i960 Jx
Страница 1: ...Release Date December 1997 Order Number 272483 002 i960 Jx Microprocessor Developer s Manual ...
Страница 24: ......
Страница 25: ...1 INTRODUCTION ...
Страница 26: ......
Страница 35: ...2 DATA TYPES AND MEMORY ADDRESSING MODES ...
Страница 36: ......
Страница 46: ......
Страница 47: ...3 PROGRAMMING ENVIRONMENT ...
Страница 48: ......
Страница 73: ...4 CACHE AND ON CHIP DATA RAM ...
Страница 74: ......
Страница 85: ...5 INSTRUCTION SET OVERVIEW ...
Страница 86: ......
Страница 111: ...6 INSTRUCTION SET REFERENCE ...
Страница 112: ......
Страница 195: ...INSTRUCTION SET REFERENCE 6 83 6 Opcode mov 5CCH REG movl 5DCH REG movt 5ECH REG movq 5FCH REG See Also LOAD STORE lda ...
Страница 233: ...7 PROCEDURE CALLS ...
Страница 234: ......
Страница 256: ......
Страница 257: ...8 FAULTS ...
Страница 258: ......
Страница 291: ...9 TRACING AND DEBUGGING ...
Страница 292: ......
Страница 309: ...10 TIMERS ...
Страница 310: ......
Страница 324: ......
Страница 325: ...11 INTERRUPTS ...
Страница 326: ......
Страница 369: ...12 INITIALIZATION AND SYSTEM REQUIREMENTS ...
Страница 370: ......
Страница 412: ......
Страница 413: ...13 MEMORY CONFIGURATION ...
Страница 414: ......
Страница 429: ...14 EXTERNAL BUS ...
Страница 430: ......
Страница 468: ......
Страница 469: ...15 TEST FEATURES ...
Страница 470: ......
Страница 493: ...A CONSIDERATIONS FOR WRITING PORTABLE CODE ...
Страница 494: ......
Страница 502: ......
Страница 503: ...B OPCODES AND EXECUTION TIMES ...
Страница 504: ......
Страница 515: ...C MACHINE LEVEL INSTRUCTION FORMATS ...
Страница 516: ......
Страница 523: ...D REGISTER AND DATA STRUCTURES ...
Страница 524: ......
Страница 550: ......
Страница 551: ...GLOSSARY ...
Страница 552: ......
Страница 561: ...INDEX ...
Страница 562: ......
Страница 578: ......