Summary

A stack provides temporary storage that supplements the general purpose registers, and its operation as a dynamic data structure assists in the implementation of algorithms that benefit from reversing the order of items. In many traditional architectures, the stack pointer participates directly during subroutine call and return instructions to help preserve a return address and other context information.

In the Itanium architecture, calls and returns per se do not alter the stack pointer; rather, they are implemented as forms of the branch instruction. Moreover, the Itanium architecture implements a register stack engine whose autonomous operation provides a second stack mechanism for the programmer. The most convenient way to preserve the return address and other context information across calls is to use stacked registers. If the number of such registers becomes inadequate, the register stack engine backs up some of the stacked registers to a backing store region in memory.

Program segmentation requires strict adherence to software conventions, as well as an appreciation of the effect of machine instructions. The conventions include register usage and methods of preservation, argument passing locations and methods, and certain unwinding information needed by an operating system in order to respond if a fault occurs at any calling level of the overall program.

A classic procedure operates without explicit knowledge of where it was called from or the state of variables in the caller. In the most general and fully supported form, calling and called routines share only the context information that they explicitly pass as arguments. Arguments are passed by value, reference, or descriptor, using Itanium stacked registers and memory stack space. Functions, the most common type of procedure, explicitly return a result to the caller.

Numerous support routines are typically supplied as part of a programming environment, such as access to the system-maintained date and time or capabilities like division and remainder operations that supplement the set of machine instructions.

We illustrated these concepts with an explicit implementation of Booth's algorithm for integer multiplication and then with RANDOM, a function that could be called from programs written in C or FORTRAN.



ItaniumR Architecture for Programmers. Understanding 64-Bit Processors and EPIC Principles
ItaniumR Architecture for Programmers. Understanding 64-Bit Processors and EPIC Principles
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net