This preview shows page 1. Sign up to view the full content.
Unformatted text preview: gle operand serving as both source and destination. This operand can be either a register or a memory location. For example, the instruction incl (%esp) causes the element on the top of the stack to be incremented. This syntax is reminiscent of the C increment (++) and decrement operators (--). The third group consists of binary operations, where the second operand is used as both a source and a destination. This syntax is reminiscent of the C assignment operators such as +=. Observe, however, that the source operand is given ﬁrst and the destination second. This looks peculiar for noncommutative operations. For example, the instruction subl %eax,%edx decrements register %edx by the value in %eax. The ﬁrst operand can be either an immediate value, a register, or a memory location. The second can be either a register or a memory location. As with the movl instruction, however, the two operands cannot both be memory locations. Practice Problem 3.4:
Assume the following values are stored at the indicated memory addresses and registers: A...
View Full Document
- Spring '10
- The American