100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COMSC 260 Test 2 Exam Questions With Correct Answers. $10.49
Add to cart

Exam (elaborations)

COMSC 260 Test 2 Exam Questions With Correct Answers.

 0 view  0 purchase
  • Course
  • Comsc 260
  • Institution
  • Comsc 260

COMSC 260 Test 2 Exam Questions With Correct Answers. Which of the options below meets *BOTH* of the following criteria: The loop is a *pretest* loop. This means the condition for the loop is checked *BEFORE* executing the body of the loop. The body of the loop (i.e., add eax, eax) is executed...

[Show more]

Preview 4 out of 55  pages

  • January 14, 2025
  • 55
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • Comsc 260
  • Comsc 260
avatar-seller
Brightstars
©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.




COMSC 260 Test 2 Exam Questions With
Correct Answers.



Which of the options below meets *BOTH* of the following criteria:


The loop is a *pretest* loop. This means the condition for the loop is checked *BEFORE*
executing the body of the loop.


The body of the loop (i.e., add eax, eax) is executed exactly five times.


-------------------------
*D-)*
*mov eax, 0*
*mov ecx, 6*
*jmp L2*


*L1:*
* add eax, eax*
*L2:
* loop L1*


-------------------------
B-)
mov eax, 0

1|Page

, ©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.

mov ecx, 5
jmp L2


L1:
add eax, eax
L2:
loop L1




-------------------------
A-)
mov eax, 0
mov ecx, 5
jmp L1


L1:
add eax, eax
L2:
loop L1




-------------------------
C-)
mov eax, 0
mov ecx, 6
jmp L1


L1:


2|Page

, ©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.

add eax, eax
L2:

loop L1 - Answer✔*D-)*
*mov eax, 0*
*mov ecx, 6*
*jmp L2*


*L1:*
* add eax, eax*
*L2:*
* loop L1*
Suppose a program has the following data segment:


.data
arr BYTE 1, 2, 3, 4, 5, 6, 7, 8, 9, 10


And the goal is to change second value in the array to 99. After the program has finished arr
should be:


[1, *99*, 3, 4, 5, 6, 7, 8, 9, 10]


Which of the options below is the correct implementation of the program?




D-) mov [arr+SIZEOF arr - (SIZEOF arr -2)], 99


*B-) mov [arr+SIZEOF arr - (SIZEOF arr -1)], 99 *


3|Page

, ©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.



C-) mov [arr+SIZEOF arr - SIZEOF arr -2], 99


A-) mov [arr+SIZEOF arr - SIZEOF arr -1], 99 - Answer✔*B-) mov [arr+SIZEOF arr -
(SIZEOF arr -1)], 99 *
When a loop instruction is encountered, and the jump is taken, which register is affected by the
jump?


*B-) EIP *
A-) ESI
C-) ESP

D-) EBP - Answer✔*B-) EIP *
Suppose a program is supposed to reverse an array. Part of the program is as follows:


.data
array DWORD 1,5,6,8,0Ah,1Bh,1Eh,22h,2Ah,32h


.code
mov edx, 0
L1:
mov eax, array[edx]
xchg eax, array[ebx]
mov array[edx], eax


add edx, TYPE array
sub ebx, TYPE array
loop L1




4|Page

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Brightstars. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $10.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

56880 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 15 years now

Start selling
$10.49
  • (0)
Add to cart
Added