GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
1.1k views

What will be the hexadecimal value in the register $ax$ (32-bit) after executing the following instructions?

mov al, 15

mov ah, 15

xor al, al

mov cl, 3

shr ax, cl

  1. 0F00 h
  2. 0F0F h
  3. 01E0 h
  4. FFFF h

 

asked in Others by Veteran (87.3k points)   | 1.1k views

2 Answers

+1 vote
ans is C 
in assembly  AX=AH+BL

AX is the lower 16-bits
AL is the lower 8 bits
AH is the bits 8 through 15
 

HERE AL and Ah both contains 15 or F so AX contains 00FF or 0000 1111 0000 1111  

XOR AL AL will return 0 in AL so AX bcomes 0000 1111 0000 0000

MOV CL,3 will store  3 in CL  

shr ax,cl  will shift right ax by 3 so 0000 1111 0000 0000 become  0000 0001 1110 0000 or 01E0 in hexadecimal i.e 

C 01E0 h

answered by Veteran (45.1k points)  
sir can u explain me why "ax" got tht
value.... becoz i can't understand that
0 votes
mov al,15 AX=??0F CL=??
mov ah,15 AX=0F0F CL=??
xor al,al AX=0F00 CL=??
mov cl,3 AX=0F00 CL=03
shr ax,cl AX=01E0 CL=03
add al,90h AX=0170 CL=03 CY=1
adc ah,0 AX=0270
___0270h______________
___0000 0010 0111 0000
answered by (45 points)  


Top Users Sep 2017
  1. Habibkhan

    7166 Points

  2. Warrior

    2640 Points

  3. Arjun

    2574 Points

  4. rishu_darkshadow

    2520 Points

  5. A_i_$_h

    2280 Points

  6. nikunj

    1980 Points

  7. manu00x

    1846 Points

  8. makhdoom ghaya

    1770 Points

  9. Bikram

    1744 Points

  10. SiddharthMahapatra

    1718 Points


26,144 questions
33,726 answers
79,957 comments
31,116 users