For some of the underlying machine instructions there

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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 first 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 first 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

Ask a homework question - tutors are online