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

Exam (elaborations)

COMSC 260 Test 3 Exam Questions With Correct Answers.

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

COMSC 260 Test 3 Exam Questions With Correct Answers. Suppose a program is supposed to write to memory letter/digit pairs, where the letter comes first and the digit comes second. Each pairing of a capital letter (A - Z) and a digit (0 - 9) should be written to memory in the following order: A0...

[Show more]

Preview 4 out of 47  pages

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




COMSC 260 Test 3 Exam Questions With
Correct Answers.

Suppose a program is supposed to write to memory letter/digit pairs, where the letter comes first
and the digit comes second. Each pairing of a capital letter (A - Z) and a digit (0 - 9) should be
written to memory in the following order: A0, A1, ...., A9, B0, B1, .... B9, ...., Y0, Y1, .... Y9,
Z0, Z1, .... Z9*


In addition, the total number of pairings should be stored in num_of_pairs.


*Remember if you were to actually run this in visual studio, you would see the ASCII codes in
memory itself, and the characters ('A', '0', etc.) off to the side


The start of this program is as follows:


LETTERS = 26
DIGITS = 10


.data


outer_loop DWORD ?
pair WORD ?
num_of_pairs DWORD ?


.code
main proc



1|Page

, ©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.

mov outer_loop, LETTERS
mov ah, '0'
mov al, 'A'
mov pair, ax
mov num_of_pairs, 1


Which of the options below is the correct continuation of this program?


NOTE: inc is the increment instruction -- it increments the value of i - Answer✔B-)
mov ecx, DIGITS-1
jmp L2


L1:
mov outer_loop, ecx
mov ecx, DIGITS-1
mov ah, '0'
mov al, BYTE PTR pair
inc al
mov pair, ax
inc num_of_pairs


L2:
inc BYTE PTR [pair+1]
inc num_of_pairs
loop L2


mov ecx, outer_loop
loop L1


2|Page

, ©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.

All of the options below will cause an infinite loop* EXCEPT*:


C-)
mov ecx, -1
L1:
mov eax, ecx
inc ecx
loop L1


A-)
mov ecx, 0
L1:
mov eax, ecx
inc ecx
loop L1


D-)
mov ecx, -1
L1:
mov eax, ecx
dec ecx
loop L1




B-)
mov ecx, 0
L1:
mov eax, ecx


3|Page

, ©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.

dec ecx

loop L1 - Answer✔*A-)*
*mov ecx, 0*
*L1:*
*mov eax, ecx*
*inc ecx*
*loop L1*
For which of the options below will the jump to OddParity be taken only when the parity of the
number in al is odd?




*D-) and al, al*
* jnp OddParity*


B-) or al, 11111111b
jnp OddParity


C-) and al, al
jp OddParity


A-) or al, 11111111b

jp OddParity - Answer✔*and al, al*
*jnp OddParity*
Suppose a program starts with the following instructions:


mov ebx, 0


mov bl, 11111111b


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