![Digital Equipment Alpha 21164PC Hardware Reference Manual Download Page 225](http://html.mh-extra.com/html/digital-equipment/alpha-21164pc/alpha-21164pc_hardware-reference-manual_2498508225.webp)
29 September 1997 – Subject To Change
Privileged Architecture Library Code
6–3
Invoking PALcode
•
The program has privileged access to all the computer hardware. Most of the
functions handled by PALcode are privileged and need control of the lowest lev-
els of the system.
•
Interrupts are disabled. If a long sequence of instructions need to be executed
atomically, interrupts cannot be allowed.
An important aspect of PALcode is that it uses normal Alpha instructions for most of
its operations; that is, the same instruction set that nonprivileged Alpha programmers
use. There are a few extra instructions that are only available in PALmode, and will
cause a dispatch to the OPCDEC PALcode entry point if attempted while not in
PALmode. The Alpha architecture allows some flexibility in what these special
PALmode instructions do. In the 21164PC the special PALmode-only instructions
perform the following functions:
•
Read or write internal processor registers (HW_MFPR, HW_ MTPR).
•
Perform memory load or store operations without invoking the normal memory-
management routines (HW_LD, HW_ST).
•
Return from an exception or interrupt (HW_REI) .
When executing in PALmode, there are certain restrictions for using the privileged
instructions because PALmode gives the programmer complete access to many of
the internal details of the 21164PC. Refer to Section 6.6 for information on these
special PALmode instructions.
Caution:
It is possible to cause unintended side effects by writing what appears to
be perfectly acceptable PALcode. As such, PALcode is not something
that many users will want to change.
6.3 Invoking PALcode
PALcode is invoked at specific entry points, under certain well-defined conditions.
These entry points provide access to a series of callable routines, with each routine
indexed as an offset from a base address. The base address of the PALcode is pro-
grammable (stored in the PAL_BASE IPR), and is normally set by the system reset
code. Refer to Section 6.4 for additional information on PALcode entry points.
PC<00> is used as the PALmode flag both to the hardware and to PALcode itself.
When the CPU enters a PALflow, the IDU sets PC<00>. This bit remains set as
instructions are executed in the PAL Istream. The IDU hardware ignores this and