Answer:
a) AL will contains 0011 1100
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.