1 / 13

Chapter 6:

Chapter 6:. 22342 – Computer Organization & Assembly Language. Conditional Processing. Boolean Instructions. AND AND reg , reg AND reg , mem AND reg , imm AND mem , reg AND mem , imm  Sign, Zero Flags OR XOR NOT. Boolean Instructions.

denver
Download Presentation

Chapter 6:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 6: 22342 – Computer Organization & Assembly Language Conditional Processing

  2. Boolean Instructions • AND • AND reg, reg • AND reg, mem • AND reg, imm • AND mem, reg • AND mem, imm  Sign, Zero Flags • OR • XOR • NOT

  3. Boolean Instructions Example: ASCII Case: A = 0100 0001 a = 0110 0001 Sentence = “I aM A sTudeNT”

  4. Boolean Instructions • TEST (Similar to AND) • TEST reg, reg • TEST reg, mem • TEST reg, imm • TEST mem, reg • TEST mem, imm  Sign, Zero Flags

  5. Compare Instruction • CMP (Similar to SUB) • CMP reg, reg • CMP reg, mem • CMP reg, imm • CMP mem, reg • CMP mem, imm  Carry, Overflow, Sign, Zero Flags

  6. Jump on Condition Instructions • Jcondition Label • Zero • Carry • Overflow • Sign • CX = 0

  7. Jump on Compare Result • Unsigned Comparison (CMP X, Y) • X > Y • X ≥ Y • X = Y • X < Y • X ≤ Y

  8. Jump on Compare Result • Signed Comparison (CMP X, Y) • X > Y • X ≥ Y • X = Y • X < Y • X ≤ Y

  9. Jump on Compare Result Example: Z = MAX ( X, Y )

  10. Jump on Compare Result Example: D = MIN ( A, B, C )

  11. Jump on Compare Result Example: Find the first nonzero element in an array

  12. LOOP on Condition (Repeat While) • LOOPZ (LOOPE) • Decrement the Counter • If Counter > 0 and ZF = 1 jump to label • LOOPNZ (LOOPNE)

  13. Chapter 6

More Related