85.6k views
2 votes
If AL contains binary 1000 1111, which one will show the information of the binary bits in AL after performing operation SHR AL, 2

a) AL will contains 0011 1100
b) AL hold the binary 1110 0011
c) AL will contains 00100011
d) AL will contain 00100011

1 Answer

4 votes

Answer:

a) AL will contains 0011 1100

Step-by-step explanation:

In assembly language, shifting bits in registers is a common and important practice. One of the shifting operations is the SHR AL, x where the x specifies that the bits be shifted to the right by x places.

SHR AL, 2 therefore means that the bits contained in the AL should be shifted to the right by two (2) places.

For example, if the AL contains binary 1000 1111, the SHR AL, 2 operation will cause the following to happen

Original bit => | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |

Shift once to the right => | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | (0) |

Shift once to the right => | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | (0) | (0) |

Notice;

(i) that there are two shifts - one at a time.

(ii) that the bits in bold face are the bits in the AL after the shift. Those that in regular face are those in the carry flag.

(iii) that the new bits added to the AL after a shift are the ones in bracket. They are always set to 0.

User David Kean
by
5.3k points