This preview shows page 1. Sign up to view the full content.
Unformatted text preview: e address in register %ebp. Write C code for decode1 that will have an effect equivalent to the assembly code above. You can test your answer by compiling your code with the -S switch. Your compiler may generate code that differs in the usage of registers or the ordering of memory references, but it should still be functionally equivalent. 3.5 Arithmetic and Logical Operations
Figure 3.6 lists some of the double-word integer operations, divided into four groups. Binary operations have two operands, while unary operations have one operand. These operands are speciﬁed using the same notation as described in Section 3.4. With the exception of leal, each of these instructions has a counterpart that operates on words (16 bits) and on bytes. The sufﬁx ‘l’ is replaced by ‘w’ for word operations and ‘b’ for the byte operations. For example, addl becomes addw or addb. 106 CHAPTER 3. MACHINE-LEVEL REPRESENTATION OF C PROGRAMS 3.5.1 Load Effective Address
The Load Effective Address l...
View Full Document