Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS-401 Computer Architecture & Assembly Language Programming

Similar presentations


Presentation on theme: "CS-401 Computer Architecture & Assembly Language Programming"— Presentation transcript:

1 CS-401 Computer Architecture & Assembly Language Programming
Lecture-10 Bit Manipulation

2 In the Last Lecture We discussed -Bubble sorting

3 Signed/unsigned numbers

4 Signed / Unsigned Numbers
Number Representation x0002 xFFFE ; two’s compliment of ; decimal 65534

5 Signed / Unsigned Numbers
Example mov ax, -2 ; ax = 65534 mov ax, 2 ; bx = 2 cmp ax, bx ja label1 ; true! > 2

6 Signed / Unsigned Numbers
Example mov ax, ; ax = 0xFFFE mov ax, ; bx = 0xFFFE ; same representation ; different interpretation

7 Signed / Unsigned Numbers
Order and Range (16 – Bit) Unsigned Numbers: 0<1<2<3<4 <………<65535 Signed Numbers: -32768<-32767<…..<0<……<32767

8 Multiplication x x 5 x x x x x x

9 Shift Instructions shr shift logical right shl shift logical left
sar shift arithmetic right sal shift arithmetic left

10 Rotate Instructions rol rotate left rcr rotate through carry right
ror rotate right rol rotate left rcr rotate through carry right rcl rotate through carry left

11 shr CF 1 1 1 1 1

12 shl CF 1 1 1 1 1

13 sal CF 1 1 1 1 1

14 sar CF 1 1 1 1 1 1 CF 1 1 1 1 1 1

15 ror CF 1 1 1 1

16 rol CF 1 1 1 1 1

17 rcr CF 1 1 1 1

18 rcl CF 1 1 1 1 1


Download ppt "CS-401 Computer Architecture & Assembly Language Programming"

Similar presentations


Ads by Google