Tuesday, 7 March 2017

UGC-NET January 2017 Assembly Language Question with Explanation

Q:: 32 Consider the following assembly language instructions:
mov al, 15
mov ah, 15
xor al, al
mov cl, 3
shr ax, cl
add al, 90H
adc ah, 0

What is the true in ax register after execution of above instructions?
(1)0270H                                                                         (2)0170H

(3)01E0H                                                                         (4)0370H

Answer:: (1)

Explanation::

mov al, 15

It means move 15 to lower part of 'ax' register

mov ah, 15

It means move 15 to higher part of 'ax' register

The 'ax' register content looks like 

0000111100001111

xor al,al

It means 'XORing lower part of 'ax' register with its own content and storing result back in 'al' , now the 'ax' register content will be

       00001111
       00001111
xor00000000

'ax' register content::  0000111100000000

move cl,3

It means move 3 to lower part of 'cx' register

The 'c' register content looks like 

0000000000000011

shr ax, cl

It will shift right and rotate content of 'ax' register

The 'ax' register content looks like 

0000000111100000

add al, 90H

Add hexadecimal 90 to al


   0000000111100000
   0000000010010000
+0000001001110000

adc ah,0

It means addition with carry which does not affect 'ax' register

So, content of ax register will be 0270H.







UGC-NET January 2017 Assembly Language Question with Explanation, Assembly language, assembly programs, cbse NET January 2017 Assembly Language Question with Explanation,UGC-NET January 2017 Assembly Language programs with Explanation,

3 comments:

  1. Add hexadecimal 90 to al
    CAN U PLZ EXPLAIN THE VALUE OF al

    ReplyDelete
    Replies
    1. ax= 0000000111100000
      90H=0000000010010000 --> (0090)
      After addition result is
      0000001001110000

      Delete
  2. Please explain one more time

    ReplyDelete