Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4,6 TrustPilot
logo-home
Exam (elaborations)

COS2621 ASSIGNMENT 2 SOLUTIONS 2021 SEMESTER 1 AND 2

Rating
3,0
(3)
Sold
8
Pages
20
Grade
A+
Uploaded on
24-07-2021
Written in
2021/2022

COS2621 ASSIGNMENT 2 SOLUTIONS 2021 SEMESTER 1 AND 2

Content preview

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

Document information

Uploaded on
July 24, 2021
Number of pages
20
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

R301,00
Get access to the full document:
Purchased by 8 students

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Reviews from verified buyers

Showing all 3 reviews
4 year ago

4 year ago

The enlarged letter does not display properly.

4 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

3,0

3 reviews

5
0
4
2
3
0
2
0
1
1
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
hiltontutorials University of South Africa (Unisa)
View profile
Follow You need to be logged in order to follow users or courses
Sold
1905
Member since
7 year
Number of followers
1219
Documents
858
Last sold
9 months ago

3,7

359 reviews

5
145
4
83
3
56
2
28
1
47

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions