AMD amd64 architecture User Manual

Page of 336
30
General-Purpose Programming
AMD64 Technology
24592—Rev. 3.15—November 2009
66 01C3 ADD BX,AX ;66 is 16-bit size override
Result:RBX = 0002_0002_0123_5502
(bits 63:16 are preserved)
Example 4: 8-bit Add:
Before:RAX = 0002_0001_8000_2201
RBX = 0002_0002_0123_3301
00C3 ADD BL,AL ;8-bit add
Result:RBX = 0002_0002_0123_3302
(bits 63:08 are preserved)
GPR High 32 Bits Across Mode Switches.
The processor does not preserve the upper 32 bits of the
64-bit GPRs across switches from 64-bit mode to compatibility or legacy modes. When using 32-bit
operands in compatibility or legacy mode, the high 32 bits of GPRs are undefined. Software must not
rely on these undefined bits, because they can change from one implementation to the next or even on
a cycle-to-cycle basis within a given implementation. The undefined bits are not a function of the data
left by any previously running process.
3.1.3 Implicit Uses of GPRs
Most instructions can use any of the GPRs for operands. However, as Figure 3-1 on page 31 shows,
some instructions use some GPRs implicitly. Details about implicit use of GPRs are described in
“General-Purpose Instruction Reference” in Volume 3.
Table 3-1 on page 31 shows implicit register uses only for application instructions. Certain system
instructions also make implicit use of registers. These system instructions are described in “SystemInstruction Reference” in Volume 3.