Q1. After the following operation, what status flag will be set to 1 right after the add instruction?
mov DX, 0FFFFh
add DX, 0001b
Alternatives:
A. Carry flag
B. Zero flag
C. Overflow
D. Sign flag
Q2. After the following operation, what status flag will be set to 1 right after the mul instruction?
mov BL, 2d
mov EAX, 0FFFFh
mul BL
A. Carry flag
B. Zero flag
C. Overflow flag and Zero flag
D. Sign flag and Overflow flag
E. Carry flag and Overflow flag
Answers:
Q1: A
Q2: E
Q1: Which register will store the result for mul cl?
A. eax B. ax C. ecx D. cx
Answer. B. ax
Q1: How many bits in one double word?
A. 4 bits B. 8 bits C. 16 bits D. 32 bits
answer:D
Q2. Which 32-bit register is used as the default loop counter?
A. EAX B. ECX C. ESI D. EBX
ANSWER: B
Q1 , FIND AND FIX ERROR
NUM3 = ((NUM1+3)*2)/NUM2
THE SIZE of NUM1, NUM2, NUM3 IS 4 BYTES (calculation never exceed 4 bytes size)
add num1,3
mov ebx, num1
mul 2
div num2
mov num3,eax
A1:
add num1,3 // mov eax, 3
add eax, num1
mov ebx, num1 // delete
mul 2 // mov ebx, 2
mul ebx
div num2 // forget to mov edx, 0
mov num3, eax
Q2Which flag is set when an unsigned value is too large to fit into a destination operand?
Sign b. Carry c. Overflow d. Auxiliary Carry
A2: b
mov ebx, 00000014h
mov edx, 0h
mov eax, 00000195h
div ebx
What is stored in EAX and EDX?
Ans:
EAX: 00000014h EDX: 00000005h
In what order are data types, larger than one byte, stored in memory?
Answer:
All data types larger than a byte store their individual bytes in reverse
order. The least significant byte occurs at the lowest memory
address. This is known as the Little Endian Order
Q1: Which 32-bit register is used as the default loop counter?
1. ECX 2. ESP 3. ESI 4. EIP
answer: 1 ECX
Q2: What is 01100101b XOR 11010110b?
1. 01000100b
2. 01001101b
3. 11110111b
4. 10110011b
answer: 4
.data
array1 DWORD 6, 943, 2 DUP(3 DUP("null")), 24
array2 BYTE "ptr", "CPU", "null"
.code
mov eax, sizeOf array1
mov ebx, sizeOf array2
mov ecx, lengthOf array2
mov edx, lengthOf array1
add ebx, ecx
mul ebx
sub eax, edx
div edx
Question:
Locate the error in the block of code above, and remove any applicable line(s) that causes the error.
Answer:
Division by zero occurred on this line: div edx
Question:
What is the output after the error has been resolved?
Answer: 720
Question: Which register is used to point to a string when using Irvine library?
A.EAX B.EBX C.ECX D.EDX
Answer: D. EDX
Where are the quotient and remainder stored for each of the following (assume ebx is not 0)
A) div bl B) div bx C) div ebx
Answers:
A) The quotient is stored in al while the remainder is stored in ah
B) The quotient is stored in ax while the remainder is stored in dx...