Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( a ) Write an assembly language function DIGJ.TS which will convert a 2 - digit decimal number into the corresponding 2 individual decimal digits.
a Write an assembly language function DIGJ.TS which will convert a digit decimal
number into the corresponding individual decimal digits. The input decimal
mumber is in R and the tens digit output is in R and the ones digit output
in R Assume that there is no division and remainder instruction. You can
invent your own instruction set long as it is reasonebie.
b A party room cen ecommodate at most persons. There is a computer
controlled turnstile in the entrance and exit to count the number of persons
entering and leaxing the party room. The number of persons currently in the
room is displayed on two segment. LEDS in front of the room. The turnstiles
have control and status regislers TCSR entrance and TCSR exit with the
following formal:
Bit Ready bit, the turnstile is reudy
Bit Set this bit to allow turnstile to turn
Bit Set this bit to disallow tumnstile to turn
Bit This bit is when one person has passed tiee turnstile, ard the
turnstile is disellowed automatically.
This bit will reset to zero after reading.
There are buffer registers daia registers for the LEDs, LEDBRfor the tens
digit and LEDBRfor the ones digit If the number of persons in the room is
then display empyy on LEDBR and displey on LEDBR To display empty
on an LED, just write FFFFFFFF to the buffer register.
Write an assembly lawguago program using Programmed IO to do the following:
Initialization: Allow Entrance turnstile and disallow Exit turnstile. Set
number of persons, n to Display on the LEDs.
Repeat:
If disallow Lxit turnstile, otherwise allow it
If disallow Entrance turnstile, otherwise allow it
if someone passes Entrance turnsile:
disallow entrance turnstile
nlarrn
display on LED
if anlow entrance tumstile again
if someone passes Ex turnstile:
disallow exit turnstile
display on LED
if allow exit turnstile sgain.
P of
You can invent your own instruction sct as long as it is reasoneble. You can
also use the function in in your program.
ci Why do we prefer register operands to memory operands for arithmeticlogic
operations?
ii What is the advantage of a regular instruction format, ie the source and
destination operands are always in the same place in the instruction.
iii Explain the difference between axithmetic shift and logical shift.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started