Figure 312 c and assembly code for do while version

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: ute t4 Add t2 to t1 Add t3 to t1 Add t4 to t1 Add t5 to t1 Add t6 to t1 Convert sum from char to int Based on this assembly code, fill in the missing parts (the comparisons and the casts) in the C code. 114 Instruction jmp Label jmp *Operand je Label jne Label js Label jns Label jg Label jge Label jl Label jle Label ja Label jae Label jb Label jbe Label CHAPTER 3. MACHINE-LEVEL REPRESENTATION OF C PROGRAMS Synonym Jump Condition 1 1 ZF ˜ZF SF ˜SF ˜´SF ˆ OFµ & ˜ZF ˜´SF ˆ OFµ SF ˆ OF ´SF ˆ OFµ | ZF ˜CF & ˜ZF ˜CF CF CF & ˜ZF Description Direct Jump Indirect Jump Equal / Zero Not Equal / Not Zero Negative Nonnegative Greater (Signed >) Greater or Equal (Signed >=) Less (Signed <) Less or Equal (Signed <=) Above (Unsigned >) Above or Equal (Unsigned >=) Below (Unsigned <) Below or Equal (Unsigned <=) jz jnz jnle jnl jnge jng jnbe jnb jnae jna Figure 3.10: The jump Instructions. These instructions jump to a labeled destination when the jump condition holds. Some instructions have “synonyms,” alternate names for the same machine instruction. 3.6.3 Jump Instructions and their Encodings Under normal execution, i...
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