In the problem, we have been given two instructions mov and xor.
14.
Now, let us look at the numerical statement by statement
AL becomes 1Ah i.e. 00011010
BL becomes 2Bh i.e. 00101011
Now the following three statements will be done with the help of truth table of xor (bitwise XOR)
A | B | A xor B |
---|---|---|
0 | 0 | 0 |
1 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 0 |
AL = 00011010
BL = 00101011
AL xor BL(according to truth table) = 00110001
so AL = 00110001, BL = 00101011
BL = 00101011
AL = 00110001
BL xor AL(according to truth table) = 00011010
so BL = 00011010, AL = 00110001
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
Please include explanation. For Problems 14 and 15, use the following code segment. mov AL, 1Ah...
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 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 = 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 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 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. 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 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 + 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 << 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> int main() { char x[20] = "Hello World"; char y[20]; __asm { cld; lea EDI, x; mov ecx, 5; mov al,60 rep stosb; nop } }