100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS2621 ASSIGNMENT 2 SOLUTIONS 2021 SEMESTER 1 AND 2 $16.70
Add to cart

Exam (elaborations)

COS2621 ASSIGNMENT 2 SOLUTIONS 2021 SEMESTER 1 AND 2

3 reviews
 113 views  8 purchases
  • Course
  • Institution

COS2621 ASSIGNMENT 2 SOLUTIONS 2021 SEMESTER 1 AND 2

Preview 2 out of 20  pages

  • July 24, 2021
  • 20
  • 2021/2022
  • Exam (elaborations)
  • Questions & answers

3  reviews

review-writer-avatar

By: gothamhtpc • 3 year ago

review-writer-avatar

By: lilianmapara1 • 3 year ago

The enlarged letter does not display properly.

review-writer-avatar

By: hobolives • 3 year ago

The Question 2 does get the result but only outputs the Enlarged letter and doesn't do the Bit Pattern, Hex number and Line number as requested by the question

avatar-seller
COS2621 ASSIGNMENT 2 SOLUTIONS 2021 SEMESTER 1

Question 1 [20]

(a) The following table reflects the memory contents of a part of memory in a one address
machine with an accumulator:

Address Contents

300 320

305 310

310 310

315 325

320 305

325 300



LOAD DIRECT 300

LOAD DIRECT 300: Direct addressing. The instruction contains the address where the value is

to found. Address 300 contains the value 320, thus the value 320 will be loaded into the
accumulator.

LOAD DIRECT 320

LOAD DIRECT 320: Direct addressing. The instruction contains the address where the value is

To found. Address 320 contains the value 305, thus the value 305 will be loaded into the
accumulator.

LOAD INDIRECT 325

LOAD INDIRECT 325: Indirect addressing. The instruction contains the address where the

address of the value to be used, is to be found. Address 325 contains the address of the value to

be used, ie address 300. Address 300 contains 320, thus the value 320 will be loaded into the

accumulator.

(b) Give examples of x86 instructions in which the following addressing modes are used:

, Immediate addressing

mov al,3

Direct addressing

mov al,[temp]

Stack addressing Indexed addressing Base-addressing

push ax (pop ax)

Register indirect addressing

mov al,[bp] (mov al,[si], mov [di],al)



Question 2 [50]

Assembly language programming:

Write a program in assembly language to read a number entered by the user. The program
should display an enlarged version of a given number on the screen. The program should
do the following:

Clear the screen and change the screen colour to yellow on blue.

Change the cursor position to row 10, column 0.

Prompt the user to key in an upper case letter (A - E). Read the letter from the keyboard.

Test whether the number is in range (A,…, E). Display an error message if the letter is out
of range and terminate the program.

Display an enlarged version of the letter on the screen.

Example: If the user enters B, the following pattern is displayed:

Enlarged letter Bit pattern Hex number Line number

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 hiltontutorials. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

53068 documents were sold in the last 30 days

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

Start selling
$16.70  8x  sold
  • (3)
Add to cart
Added