recategorized
3,627 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$
recategorized

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

Answer:

Related questions

0 votes
0 votes
4 answers
3
go_editor asked Mar 24, 2020
989 views
Match the following :$\begin{array}{llll} & \textbf{List – I} & {} & \textbf{List – II} \\ \text{a.} & \text{Absurd} & \text{i.} & \text{Clearly impossible being con...