Chapter7 Logical - Logic & Bit-Manipulation...

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

View Full Document Right Arrow Icon
Logic & Bit-Manipulation Instructions Chapter 7 Sections 7.4, 7.9, 7.12, 7.13
Background image of page 1

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

View Full DocumentRight Arrow Icon
Bit-manipulation instructions Logic operations on bytes and, or, complement, exclusive-or Manipulate individual bits of a byte set, clear, test
Background image of page 2
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.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Logic Instructions
Background image of page 4
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
Background image of page 5

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

View Full DocumentRight Arrow Icon
Example (cont) ORAA #$10 A 0 1 1 0 0 1 0 0 Immediate
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

Chapter7 Logical - Logic & Bit-Manipulation...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online