3 votes 3 votes 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 0F00 h 0F0F h 01E0 h FFFF h Compiler Design ugcnetcse-dec2015-paper2 machine-instruction compiler-design + – go_editor asked Aug 8, 2016 recategorized May 24, 2020 go_editor 8.9k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes 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 Sanjay Sharma answered Aug 9, 2016 edited Nov 11, 2017 by Sanjay Sharma Sanjay Sharma comment Share Follow See all 2 Comments See all 2 2 Comments reply manmohan singh commented Sep 13, 2017 reply Follow Share sir can u explain me why "ax" got tht value.... becoz i can't understand that 0 votes 0 votes Devshree Dubey commented Jan 18, 2018 reply Follow Share @manmohan singh,Actually ax has got 0000 1111 0000 0000 if you see in previous instruction XOR AL AL the value 0000 1111 has been done XOR. This gives the value 00000000. (XOR of 00001111 and 00001111). That is how we get 0000 1111 in AH and 00000000 in AL part. I hope you've understood now. Any register in Assembly Language has two parts low and high respectively. Each is of 8 bit each. The answer is represented in Hexadecimal notation. I hope you've understood d ans. :). If not please comment. :) 0 votes 0 votes Please log in or register to add a comment.
0 votes 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 Nayak Pankaj answered Sep 14, 2017 Nayak Pankaj comment Share Follow See 1 comment See all 1 1 comment reply Mrinal Mahato commented Jul 5, 2018 reply Follow Share Sie can you explain add al,90H plz. cant understand the change of value of ax from 01E0 to 0170. 0 votes 0 votes Please log in or register to add a comment.