Chapter7 Logical

# Chapter7 Logical - Logic Bit-Manipulation Instructions...

This preview shows pages 1–7. Sign up to view the full content.

Logic & Bit-Manipulation Instructions Chapter 7 Sections 7.4, 7.9, 7.12, 7.13

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Bit-manipulation instructions Logic operations on bytes and, or, complement, exclusive-or Manipulate individual bits of a byte set, clear, test
Logic Instructions Bit-wise boolean logic operation between a register r (A,B, CCR) and a memory or immediate operand. Operations on bytes only Result saved in the register Four logic operations AND (AND r ), OR (ORA r ), XOR (EOR r ) “Complement” (COM r , COM mem) Flags N & Z set, 0 V, C undefined for AND,OR,XOR N, Z, V, C all set when CCR is involved.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Logic Instructions
Example If memory location \$0010 contains \$B3 and A contains \$64, what is the result of the following instructions: ANDA \$10, ANDA #\$10, ORAA \$10, ORAA #\$10, EORA \$10, COMA, COM \$10 Solution: ANDA \$10 A 0 1 1 0 0 1 0 0 (0010) 1 0 1 1 0 0 1 1 0 0 1 0 0 0 0 0 ANDA #\$10 A 0 1 1 0 0 1 0 0 Immediate \$10 0 0 0 1 0 0 0 0 addressing 0 0 0 0 0 0 0 0 ORAA \$10 A 0 1 1 0 0 1 0 0 (0010) 1 0 1 1 0 0 1 1 1 1 1 1 0 1 1 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Example (cont) ORAA #\$10 A 0 1 1 0 0 1 0 0 Immediate
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/23/2011 for the course ELEC 2220 taught by Professor Staff during the Summer '08 term at Auburn University.

### Page1 / 14

Chapter7 Logical - Logic Bit-Manipulation Instructions...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online