324_Book

# a 0 unsigned overow zero negative signed overow the

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: he code is as follows: 1 2 3 movl 8(%ebp),%edi movl 12(%ebp),%ebx movl 16(%ebp),%esi 3.5. ARITHMETIC AND LOGICAL OPERATIONS Instruction leal Ë, incl decl negl notl addl Ë, subl Ë, imull Ë , xorl Ë, orl Ë, andl Ë, sall , shll , sarl , shrl , Effect Description Load Effective Address Increment Decrement Negate Complement Add Subtract Multiply Exclusive-Or Or And Left Shift Left Shift (same as sall) Arithmetic Right Shift Logical Right Shift 105 &amp;Ë +1 -1 ˜ +Ë -Ë *Ë ˆË |Ë &amp;Ë &lt;&lt; &lt;&lt; &gt;&gt; &gt;&gt; Figure 3.6: Integer Arithmetic Operations. The Load Effective Address leal is commonly used to perform simple arithmetic. The remaining ones are more standard unary or binary operations. Note the nonintuitive ordering of the operands with GAS. 4 5 6 7 8 9 movl movl movl movl movl movl (%edi),%eax (%ebx),%edx (%esi),%ecx %eax,(%ebx) %edx,(%esi) %ecx,(%edi) Parameters xp, yp, and zp are stored at memory locations with offsets 8, 12, and 16, respectively, relative to th...
View Full Document

## This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online