in CO and Architecture recategorized
3,635 views
0 votes
0 votes

Consider the following assembly language instructions:

mov al, 15
mov ah, 15
xor al, al
mov cl, 3
shr ax, cl
add al, 90H
add ah, 0

What is the value in $ax$ register after execution of above instructions?

  1. $0270H$
  2. $0170H$
  3. $01E0H$
  4. $0370H$
in CO and Architecture recategorized
3.6k views

1 comment

i got 0370H... but i feel it is wrong :(
0
0

2 Answers

3 votes
3 votes

it is 8086 question AX(16 bit) =AH( 8 bit) +AL (8 bit)

MOV AL  ,15    //  00001111 in AL

mov ah, 15    //  00001111 in AH   and AX =0000 1111 0000 1111

xor al, al    // AL is 0000 0000 now  and so AX  =0000 1111 0000 0000

mov cl, 3 // CL is 0000 0011

shr ax, cl   //AX  = 000 0000 1111 0000 0   or (01E0) h

add al, 90H   // AL= 1001 0000  add this to( AX=AH+AL)  , now AX =0170 h with carry 1


adc ah, 0 // add  0 to ah with carry which is one so final ans 0270 h 

so ans is A

0 votes
0 votes
Answer = 0270H

1 comment

Can you provide me steps  how to solve you ??
0
0
Answer:

Related questions