Monday, May 17, 2010

Shifting & Rotating

Question
Complete the following program so that at the end, AL will equal to FC and CF=1. Use only SHL followed by SAR AL,3 and finally RCR instruction.


MOV AL,33h // AL = 33h , initial CF=0
SHL ________
SAR AL,3 // CF-AL = 1-1111 1001
RCR ________

Answer

MOV AL,33H CF,AL : 0 0011 0011

SHL AL, 2 ; CF,AL : 0 1100 1100
SAR AL, 3 ; CF,AL : 1 1111 1001
RCR AL, 2 ; CF,AL : 0 1100 1100

No comments:

Post a Comment

Popular Posts

Latest Post from my Other Blog