The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
2k 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 (99.2k points)
recategorized by | 2k views

2 Answers

+1 vote
Ans is C

 in assembly  AX=AH+BL

AL is the lower 8 bits

AH is the higher bits 8
HERE AL and Ah both contains 15 or F so AX contains  0F0F  or 0000 1111 0000 1111  

XOR AL AL will return 0 in AL so AX becomes 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 will

become  0000 0001 1110 0000 or 01E0 in hexadecimal i.e

 

C 01E0 H
answered by Veteran (50.3k points)
edited by
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 (83 points)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

29,157 questions
36,984 answers
92,161 comments
34,824 users