Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this question, you may invent your own instruction set as long as it is reasonable for your program. You should comment your program properly,

In this question, you may invent your own instruction set as long as it is reasonable
for your program. You should comment your program properly, so that it can be
easily understood.
(a) Write an assembly language function to convert an integer 100 into two single
digit decimal values. For example, if input is 89, then output is 8 and 9, and if
input is 3, then output is 0 and 3. You can design your calling convention (i.e.
where are the input and output parameters for this function. Also, assume there
is NO division operation in the instruction set. No error checking on the input is
needed.)7
(b) Consider a scale with LED display that can measure up to 99g. There are two
I/O ports, one for reading the weight of the object (100g), while the other is
to control two LED displays, each of which can display a single digit from 0 to
The scale has a Control and Status Register SCSR, and a buffer register SBR.
The buffer register is to return the weight of the object.
The SCSR has the following format:
Bit 0 Ready Bit, the scale is ready
Bit 1 weight of the object been read and stored in SBR,
will be automatically cleared after SBR read
Bit 2 Set this bit to start reading the scale.
Bit 3 Scale error
The two LED display is controlled by two LED buffer registers LEDBR1 and
LEDBR2. To write to the LED, just write a value between 0 and 9 to LEDBR1
and LEDBR2. If the value 10 is written, a hyphen (-) will be displayed.
LEDBR1- the value of the digit to be displayed on the right LED.
LEDBR2- the value of the digit to be displayed on the left LED.
Write an assembly language program that use Programmed IO to read the scale
and display the value on the two LEDs. If error is returned from the scale, display
two hyphens (--). You may assume the function in part (a) is available. [9]
(c)(i) When does the CPU check interrupt in the instruction execution cycle?
Why? [3]
(ii) What is DMA? Explain how the DMA controller can access the memory
without conflict with the CPU. [4]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

What is the difference between risk aversion and loss aversion?

Answered: 1 week ago

Question

Which of the following may be controlled by an investor

Answered: 1 week ago

Question

What is the general process for selecting expatriates?

Answered: 1 week ago