This preview shows page 1. Sign up to view the full content.
Unformatted text preview: y of the top stack element onto the stack. Figure 3.31 shows the instructions that store the top stack element either in memory or in another ﬂoatingpoint register. There are both “popping” versions that pop the top element off the stack, similar to the storep instruction for our hypothetical stack evaluator, as well as nonpopping versions that leave the source value on the top of the stack. As with the ﬂoating-point load instructions, different variants of the instruction generate different formats for the result and therefore store different numbers of bytes. The ﬁrst group of these store the result in memory. The address is speciﬁed using any of the memory operand formats listed in Figure 3.3. The second group copies the top stack element to some other ﬂoating-point register. Practice Problem 3.26:
Assume for the following code fragment that register %eax contains an integer variable x and that the top two stack elements correspond to variables a and b, respectively. Fill in the boxes to diagram the 180 CHAPTER 3. MACHINE-LEVEL REPRESENTATION OF C PROGRAMS
View Full Document
- Spring '10
- The American