324_Book

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: , b, and t are of type int. Then the condition codes would be set according to the following C expressions: CF: ZF: SF: OF: (unsigned t) < (unsigned a) (t == 0) (t < 0) (a < 0 == b < 0) && (t < 0 != a < 0) Unsigned overflow Zero Negative Signed overflow The leal instruction does not alter any condition codes, since it is intended to be used in address computations. Otherwise, all of the instructions listed in Figure 3.6 cause the condition codes to be set. For the logical operations, such as xorl, the carry and overflow flags are set to 0. For the shift operations, the carry flag is set to the last bit shifted out, while the overflow flag is set to 0. In addition to the operations of Figure 3.6, two operations (having 8, 16, and 32-bit forms) set conditions codes without altering any other registers: Instruction cmpb ˾ , ˽ testb ˾ , ˽ cmpw ˾ , ˽ testw ˾ , ˽ cmpl ˾ , ˽ testl ˾ , ˽ Based on ˽ - ˾ ˽ & ˾ ˽ - ˾ ˽ & ˾ ˽ - ˾ ˽ & ˾ Desc...
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