Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Suppose EAX, EBX, and ECX contained three unsigned integers. Which of the follow

ID: 3642352 • Letter: S

Question

Suppose EAX, EBX, and ECX contained three unsigned integers. Which of the following code excerpts would display the largest of the three integers?
a.
cmp eax,ebx
jb L1
mov eax,ebx
L1: cmp eax,ecx
jb L2
mov eax,ecx
L2: call WriteInt
b.
cmp eax,ebx
jae L1
mov eax,ebx
L1: cmp eax,ecx
jae L2
mov eax,ecx
L2: call WriteInt
c.
cmp eax,ebx
jnae L1
mov eax,ebx
L1: cmp ecx,eax
jnae L2
mov eax,ecx
L2: call WriteInt
d.
cmp eax,ecx
jae L1
mov eax,ebx
L1: cmp eax,ebx
jae L2
mov eax,ecx
L2: call WriteInt


What will be the final value of ESI when the following code executes?
.data
array SWORD 8,2,3,5,-4,6,0,4
.code
mov esi,0
mov ecx,LENGTHOF array
L1: mov ax,array[esi]
cmp ax,0
pushf
add esi,TYPE array
popf
Loopne L1
a. 00000006h
b. 00000007h
c. 0000000Ch
d. 0000000Eh


What will be the final values of CX and DX when the following code executes?
.data
array SWORD 8,2,3,5,-4,6,0,4
.code
mov cx,1
mov esi,2
mov ax,array[esi]
mov bx,array[esi+4]
cmp ax,3
jae L2
cmp bx,4
jb L1
jmp L3
L1: mov cx,4
L2: mov dx,5
jmp L4
L3: mov dx,6
L4:
a. CX = 4, DX = 5
b. CX = 1, DX = 6
c. CX = 1, DX = 5
d. CX = 4, DX = 6


In Protected mode (flat model), which of the following CALL instructions executes an indirect call to a procedure whose address is stored in a memory location pointed to by EBX?
a. call [ebx]
b. call DWORD PTR [ebx]
c. call FAR [ebx]
d. call NEAR PTR [ebx]

Explanation / Answer

Solution:

Suppose EAX, EBX, and ECX contained three unsigned integers. Which of the following code excerpts would display the largest of the three integers?

a.
cmp eax,ebx
jb L1
mov eax,ebx
L1: cmp eax,ecx
jb L2
mov eax,ecx
L2: call WriteInt
b.
cmp eax,ebx
jae L1
mov eax,ebx
L1: cmp eax,ecx
jae L2
mov eax,ecx
L2: call WriteInt
c.
cmp eax,ebx
jnae L1
mov eax,ebx
L1: cmp ecx,eax
jnae L2
mov eax,ecx
L2: call WriteInt
d.
cmp eax,ecx
jae L1
mov eax,ebx
L1: cmp eax,ebx
jae L2
mov eax,ecx
L2: call WriteInt


What will be the final value of ESI when the following code executes?
.data
array SWORD 8,2,3,5,-4,6,0,4
.code
mov esi,0
mov ecx,LENGTHOF array
L1: mov ax,array[esi]
cmp ax,0
pushf
add esi,TYPE array
popf
Loopne L1
a. 00000006h
b. 00000007h
c. 0000000Ch
d. 0000000Eh


What will be the final values of CX and DX when the following code executes?
.data
array SWORD 8,2,3,5,-4,6,0,4
.code
mov cx,1
mov esi,2
mov ax,array[esi]
mov bx,array[esi+4]
cmp ax,3
jae L2
cmp bx,4
jb L1
jmp L3
L1: mov cx,4
L2: mov dx,5
jmp L4
L3: mov dx,6
L4:
a. CX = 4, DX = 5
b. CX = 1, DX = 6
c. CX = 1, DX = 5
d. CX = 4, DX = 6


In Protected mode (flat model), which of the following CALL instructions executes an indirect call to a procedure whose address is stored in a memory location pointed to by EBX?
a. call [ebx]
b. call DWORD PTR [ebx]
c. call FAR [ebx]
d. call NEAR PTR [ebx]

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote