SEMJUL08 - LECT10 - LOGICAL, ROTATE, BCD COMPLETED

SEMJUL08 - LECT10 - LOGICAL, ROTATE, BCD COMPLETED -...

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

View Full Document Right Arrow Icon
Logical, Shift, Rotate & BCD
Background image of page 1

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

View Full DocumentRight Arrow Icon
What we will learn in this session: Logical instructions. Shift & Rotate instructions. BCD operations. Bit operations.
Background image of page 2
Some Basics
Background image of page 3

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

View Full DocumentRight Arrow Icon
We have covered these addressing modes DRD D0 D7 ARD A0 A7 Dn and An ARI (An) ARI+PI (An)+ ARI+PD -(An) ARI+D D(An) ARI+I D(An,Dn/An.s) PC+D D(PC) PC+I D(PC,Dn/An.s) ALA $001001 ASA $FFAA IA CCR, SR, PC Effective Address: <ea> ID #($/%/@) Immediate data: <id>
Background image of page 4
BCD Representation One digit represented by 4-bits. Each digit represented by own binary sequence. BCD operations supported by M68k.
Background image of page 5

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

View Full DocumentRight Arrow Icon
BCD Representation Digit BCD Representation 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001
Background image of page 6
Example: BCD Representation Represent 564 in BCD. 5 6 4 0101 0110 0100 564 BCD = 010101100100
Background image of page 7

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

View Full DocumentRight Arrow Icon
Logical Group
Background image of page 8
Introduction Instructions that implement logic operations: AND OR EOR NOT
Background image of page 9

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

View Full DocumentRight Arrow Icon
AND (Logical AND) Performs logical AND operation. Dn An (An) (An)+ -(An) d(An) d(An,i) ASA ALA d(PC) d(PC,i) #n s - s s s s s s s s s s d - d d d d d d d - - - N Z V C X * * 0 0 - BWL
Background image of page 10
AND Example D0 = $0000FF FF D1 = $000000 AA AND.B D1,D0 1 1 1 1 1 1 1 1 D0.B = 1 0 1 0 1 0 1 0 D1.B = AND 1 0 1 0 1 0 1 0 D0.B = D0 = $0000FFAA CCR X = unchanged. N = 1 (MSB = 1) Z = 0 (result non-zero) V = always cleared. C = always cleared.
Background image of page 11

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

View Full DocumentRight Arrow Icon
ANDI (AND Immediate) Performs logical AND operation, source is immediate data. Dn An (An) (An)+ -(An) d(An) d(An,i) ASA ALA d(PC) d(PC,i) #n - - - - - - - - - - - s d - d d d d d d d - - - N Z V C X * * 0 0 - BWL
Background image of page 12
ANDI Example D0 = $0000FF FF ANDI.B #$77 , D0 1 1 1 1 1 1 1 1 D0.B = 0 1 1 1 0 1 1 1 D1.B = AND 0 1 1 1 0 1 1 1 D0.B = D0 = $0000FF 77 CCR X = unchanged. N = 0 (MSB = 0) Z = 0 (result non-zero) V = always cleared. C = always cleared.
Background image of page 13

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

View Full DocumentRight Arrow Icon
OR (Logical OR) Performs logical OR operation. Dn An (An) (An)+ -(An) d(An) d(An,i) ASA ALA d(PC) d(PC,i) #n s - s s s s s s s s s s d - d d d d d d d - - - N Z V C X * * 0 0 - BWL
Background image of page 14
OR Example D0 = $0000FF FF D1 = $000000 AA OR.B D1,D0 1 1 1 1 1 1 1 1 D0.B = 1 0 1 0 1 0 1 0 D1.B = OR 1 1 1 1 1 1 1 1 D0.B = D0 = $0000FF FF CCR X = unchanged. N = 1 (MSB = 1) Z = 0 (result non-zero) V = always cleared. C = always cleared.
Background image of page 15

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

View Full DocumentRight Arrow Icon
ORI (OR Immediate) Performs logical AND operation on immediate data. Dn An (An) (An)+ -(An) d(An) d(An,i) ASA ALA d(PC) d(PC,i) #n - - - - - - - - - - - s d - d d d d d d d - - - N Z V C X * * 0 0 - BWL
Background image of page 16
ORI Example D0 = $0000FF AA ORI.B #$67 ,D0 1 0 1 0 1 0 1 0 D0.B = 0 1 1 0 0 1 1 1 D1.B = OR 1 1 1 0 1 1 1 1 D0.B = D0 = $0000FF EF CCR X = unchanged. N = 1 (MSB = 1) Z = 0 (result non-zero) V = always cleared. C = always cleared.
Background image of page 17

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

View Full DocumentRight Arrow Icon
EOR (XOR Logic) Performs Exclusive Or operation. Dn An (An) (An)+ -(An) d(An) d(An,i) ASA ALA d(PC) d(PC,i) #n s - - - - - - - - - - s d - d d d d d d d - - - N Z V C X * * 0 0 - BWL
Background image of page 18
EOR Example D0 = $0000FF BB D1 = $000000 AA EOR.B D1,D0 1 0 1 1 1 0 1 1 D0.B = 1 0 1 0 1 0 1 0 D1.B = XOR 0 0 0 1 0 0 0 1 D0.B = D0 = $0000FF 11 CCR X = unchanged.
Background image of page 19

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

View Full DocumentRight Arrow Icon
Image of page 20
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/17/2011 for the course MCT 3235 taught by Professor Dr during the Spring '11 term at International Islamic University Malaysia.

Page1 / 92

SEMJUL08 - LECT10 - LOGICAL, ROTATE, BCD COMPLETED -...

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

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