This preview shows page 1. Sign up to view the full content.
Unformatted text preview: hat perform data movement. The generality of the operand notation allows a simple move instruction to perform what in many machines would require a number of instructions. Figure 3.4 lists the important data movement instructions. The most common is the movl instruction for moving double words. The source operand designates a value that is immediate, stored in a register, or stored in memory. The destination operand designates a location that is either a register or a memory address. IA32 imposes the restriction that a move instruction cannot have both operands refer to memory locations. Copying a value from one memory location to another requires two instructions—the ﬁrst to load the source value into a register, and the second to write this register value to the destination. The following are some examples of movl instructions showing the ﬁve possible combinations of source and destination types. Recall that the source operand comes ﬁrst and the destination second.
1 2 3 4 5 movl movl movl movl movl $0x4050,%eax %ebp,%esp (%edi,%ecx),%eax $-17,(%esp) %eax,-12(%ebp)...
View Full Document
- Spring '10
- The American