Question
Please include explanation.
For Problems 14 and 15, use the following code segment. mov AL, 1Ah mov BL, 2Bh xor AL, BL xor BL, AL xor AL, BL 14. What is
0 0
Add a comment Improve this question Transcribed image text
Answer #1

In the problem, we have been given two instructions mov and xor.

  • The instruction mov copies the data referred by the second operand into the first operand. For example, after executing mov A, 0110 the value of A will become 0110.
  • The instruction xor does the bitwise XOR of operand 1 and operand 2 and stores the result in operand 1 if the xor is written as XOR OPERAND1 OPERAND2

14.

Now, let us look at the numerical statement by statement

  • mov AL, 1Ah

AL becomes 1Ah i.e. 00011010

  • mov BL, 2Bh

BL becomes 2Bh i.e. 00101011

Now the following three statements will be done with the help of truth table of xor (bitwise XOR)

XOR Truth Table
A B A xor B
0 0 0
1 0 1
0 1 1
1 1 0
  • xor AL, BL

AL = 00011010

BL = 00101011

AL xor BL(according to truth table) = 00110001

so AL = 00110001, BL = 00101011

  • xor BL, AL

BL = 00101011

AL = 00110001

BL xor AL(according to truth table) = 00011010

so BL = 00011010, AL = 00110001

  • xor AL, BL

AL = 00110001

BL = 00011010

AL xor BL(according to truth table) = 00101011

so AL = 00101011 i.e. 2Bh, BL = 00011010 i.e 1Ah

Hence the correct answer is (b) i.e. 2Bh

Add a comment
Know the answer?
Add Answer to:
Please include explanation. For Problems 14 and 15, use the following code segment. mov AL, 1Ah...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • b) 4 bits c) 12 bits ) 16 bits 12) mov al, 0101b; mov bl, 1100b;...

    b) 4 bits c) 12 bits ) 16 bits 12) mov al, 0101b; mov bl, 1100b; and al, bl; What will AL be equal to after this code runs? b) 0xF3 c) 0x3F d) 0xF5 13) mov al, 0110b; mov bl, 1011b; or al, bl, xchg al, bl; neg al, What will AL and BL be equal to after this code runs? c) AL = 0xF3, BL = 0x1B 14) mov edx, 5 cmp edx, 10 ige L1, je L2...

  • 16.      What value will be in rax after the following operation(s)             Assume the code will...

    16.      What value will be in rax after the following operation(s)             Assume the code will assemble and run without error             mov     rax,      0x10             xor     rdx,     rdx             mov     rbx,     0x4             div     rbx             A.        0x4             B.         0x2 C.         0x25             D.        0x0 17.      What value will be in rdx after the following operation(s)             Assume the code will assemble and run without error Note: This question is asking...

  • Need help on Assembly language 1.Solve the following conditions: A. Suppose AL contains 11001011 and CF...

    Need help on Assembly language 1.Solve the following conditions: A. Suppose AL contains 11001011 and CF = 1.    Give the new contents of AL after each of the following instructions is executed.    Assume the above initial conditions for each part of this question. a. SHL AL,1 b. SHR AL,1 c. ROL AL,2 d. ROR AL,3 e. SAR AL,2 f. RCL AL,1 g. RCR AL,3 B. Suppose EAX contain ABCDH.    Show the contents of BX and CX after...

  • Use the following data declarations. Assume that the offset of byteVal is 00000000: data byteValsbyte 1,2,3,ffh...

    Use the following data declarations. Assume that the offset of byteVal is 00000000: data byteValsbyte 1,2,3,ffh dwordVal dword 34567890h, 90785634h, 12346745h Show the value of the final destination operand after each of the following code fragments has executed:(If any instruction/s is invalid, indicate "INV" as the answer and briefly explain why) a.mov edi, 2 answer al mov al, (byte Val + edi) b.mov ebx, dwordVal+4 answer ebx - [esi).- (show your answer in liteedim mov esi, offset dwordVal+8 xchg ebx,...

  • Please use C programming to write a code segment as an answer. Instead of using an...

    Please use C programming to write a code segment as an answer. Instead of using an while-loop like the following code, please implement a code segment by using a do-while loop. What is the output of the code? #include <stdio.h> void main() {        int i = 0;        while (i < 5);        {               printf(“%d ”, ++i);        } }

  • 14. In the code from Question 12 true is: A. a constant B. a variable C....

    14. In the code from Question 12 true is: A. a constant B. a variable C. Initialized data D. none of these 15. In the code from Question 12 true and false are: A. useless B. necessary for the display C. check if the contents of the eax and ex registers are the same D. help with indirect addressing 16. Assume that some of the memory looks as shown in the following table: Address Content Label Content Ox1A2B Initial Ox1A2C...

  • Can someone explain these three questions for me? Thanks. Answers are provided Use the code segment...

    Can someone explain these three questions for me? Thanks. Answers are provided Use the code segment below for problems 6-7 int x = 1; int y - 0 int z 1: if(! (x && y) ) x 0; İf ( ! (x 11 y) ) y+= (x + y) % 2 == 0 ? 1 : 0; printf ("Total #1 : %d\n", x + y + z); printf ("Total #2: %d\n", !x + !y + !2); 6. Which of the...

  • 1. Consider the following code segment. String str = "AP"; str += "CS " + 1...

    1. Consider the following code segment. String str = "AP"; str += "CS " + 1 + 2; System.out.println(str); What is printed as a result of executing the code segment? A: CS AP12 B: AP CS3 C: CSAP 12 D: APCS 12 E: APCS 3 2. Consider the following code segment. String dessert = "pie"; dessert += "straw" + dessert + "berry"; What is the value of dessert after the code segment has been executed? A: strawpieberry B: piestrawpieberry C:...

  • 31. The following code segment is syntactically correct:              int number{20};          cout << number <<...

    31. The following code segment is syntactically correct:              int number{20};          cout << number << setbase(16) << " " << number                               << setbase(10) << " " << number                                 << showpos << " " << number << endl;                 T__   F__       32. The following statement wants to determine if ‘count’ is outside the     range of 0 through 100:             if (count < 0 && count > 100)                                             T__   F__ 33. There is...

  • After the following code executes, to what will the character string x be equal? #include <iostream>...

    After the following code executes, to what will the character string x be equal? #include <iostream> int main() { char x[20] = "Hello World"; char y[20]; __asm {   cld;   lea EDI, x;   mov ecx, 5;   mov al,60   rep stosb;    nop } }

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT