1. A. What will be the value of EAX and sign flag after the following lines exec
ID: 3754126 • Letter: 1
Question
1. A. What will be the value of EAX and sign flag after the following lines execute? Mov eax,6 Sub eax,'7 B.Is it possible to set the overflow flag if you subtract a positive integer to a negative integer? examples where applicable. C. at that same time? State reasons. D. In the following code, the value in AL is intended to be a signed byte. Does the overflow flag help to determine whether the final value in AL is within a valid signed range? Explain with Is it possible for both the sign and zero flags to be set Explain. mov al, -1 add al, 130 E. What will be the value of the parity flag after the following lines execute? Mov al, 2 Sub al, 5Explanation / Answer
.
The contents of al is 0011 0011b, by performing test instruction the result will be 0000 0010.
Therefore, no flag will be set.
Hence, the correct answer is option (c).
2.
Test instruction is used to test the carry zero and sign flags.
Hence, the correct answer is option (b).
3.
Ja instruction is used to jump when the contents of eax are greater than ebx.
Hence, the correct answer is option (a).
4.
Correct answer is option (c).
5.
Correct answer is option (a).
6.
In protected mode, call [ebx] instruction executes an indirect call to a procedure whose address is stored in a memory location pointed by EBX.
Hence, the correct answer is option (c).
7.
RCR (Rotate Right through Carry) instruction shifts the bits towards right and place the carry bit at MSB (Carry flag holds the last bit rotated out and the shifted bit is placed at MSB side).
Initially al is loaded with 1000 0101
After executing rcr with count 1, al becomes 1100 0010.
Hence, the correct answer is option (a).
8.
RCL (Rotate Left through Carry) instruction shifts the bits towards left and place the carry bit at LSB (Carry flag holds the last bit rotated out and the shifted bit is placed at LSB side).
Initially al is loaded with 0110 1011
After executing rcr with count 2, al becomes 1010 1110.
Hence, the correct answer is option (c).
10.
imul is an instruction used to perform signed multiplication. The values of dx and ax after the execution are shown as follows:
Dx = -16h (the sign is negative, therefore convert the number into 2’s complement form)
2’s complement of 16 = FFEAh
Ax = 0002h
After executing imul instruction DX = FFFFh and AX = FFE0h.
Hence, the correct answer is option (c).
11.
The hexadecimal value of DX is 0042h and AX is 0F63 after executing the div instruction.
Hence, the correct answer is option (a).
12.
The series of instructions given below will not multiplies the EAX by 18 using the shift, mov and ADD instructions.
For example consider EAX = 2h
Copy the contents of eax to ebx;
By perform shift left by count 4, eax will be 0. Now, multiply eax with 16 will give 0.
By perform shift left by count 1, ebx will be 0001h. Now, multiply ebx with 2 will give 2
Addition of eax and ebx will gives 2.
Hence, the given statement is FALSE.
13.
By performing shift right with count 4 and then move the contents from a1 to b1 will copies the integer in bits 4-7 from AL register into bits 0-3 of the BL register. Since, the upper 4 bits of AL and BL will be cleared.
Hence, the correct answer is option (d).
15.
The sequence instructions given below divide the numbers -16 by 5 using IDIV instruction.
Hence, the given statement is TRUE.
16.
Shift right al by 1 will gives the copy of the carry flag into bit 7 of AL and shift all existing bits in AL one position to the right.
Example:
AX = 0100 0011 (MSB bit is the carry bit that is 0 in the example), now by perform right shift by 1, carry flag bit moves right towards 1 position (carry flag moves into 7th bit of AL).
Hence, the correct answer is option (b).
18.
By executing the div instruction the value of DX is 0056h and AX is 1234h.
Hence, the correct answer is option (C).
20.
Initially ax is loaded with 6B49h and dx with 0095h. Convert ax and dx into binary format which is shown below:
ax = 6B49h = 0110 1011 0100 1001
dx = 0095h = 0000 0000 1001 0101
By executing the first instruction ax is 0011 0101 1010 0100
By executing the second instruction dx is 1000 0000 0100 1010
By executing the third instruction ax is 0001 1010 1101 0010 which is equal to 1AD2 in hexadecimal.
By executing the fourth instruction dx is 0100 0000 0010 0101 which is equal to 4025 in hexadecimal.
Hence, the correct answer is option (a).
22.
The following procedure UseThree has three unsigned integer stack parameters which are bye, word and double word.
Hence, the given statement is TRUE.
23.
From the following procedure, a local variable named as var1 is added to the type DWORD.
Hence, the given statement is TRUE.
27.
Local variables can make efficient use of memory because their storage space can be released and also a same variable name can appear in two different procedures.
Hence, the correct answer is option (c).
28.
Global variables are visible from all procedures in the source code file and the lifetime of a static variable is the same as the lifetime of its program.
Hence, the correct answer is option (b).
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.