Question: An incomplete assembly language program for the Simple Computer is shown below. For this problem, you will fill in the blanks in the program to
An incomplete assembly language program for the Simple Computer is shown below. For this problem, you will fill in the blanks in the program to complete the following task, using the register assignments shown in the comments at the top of the program.
Program task:
This program concatenates an aggregate bit result.
The input array length is four.
The input array location is variable. This value must be read out of Data Memory location
The output array should be stored in consecutive memory locations beginning in Data Memory location x
Register assignments
r: the value
r: pointer to array data
r: loop counter for loop structure
r: current array element
r: mask
r: data
r: pointer to output array
initialize registers
xor r r r
ld r r
ldi r
Select
ldi r
xor r r r
ldi r
Select
shl r r
shl r r
read data from memory and mask
ld r
Select
rrrrrrrr
and r r r
concatenate and store result
or r r r
st r r
shl r r
shl r r
shl r r
for loop structure
inc r
Select
rrrrrrrr
inc r
Select
rrrrrrrr
dec r
Select
rrrrrrrr
brz r
Select
brz r
Select
infinite loop so program counter does not advance
brz r
Select
This program is stored in Instruction Memory starting at address x
The initial contents of the following Data Memory locations are known. The contents of any location not listed in the table below are unknown prior to program execution.
Data Memory Address in hex Initial Contents in hex
AE
D
FC
AB
E
E
DDF
B
Trace the execution of the program using the Data Memory values in the table above. Determine the register contents after each instruction is executed.
Using these Data Memory values, how many processor cycles are required to execute this program entirely? assume the instruction labeled "infinite loop" is only executed once.
Select
If the clock frequency is MHz how long would this take to execute?
Select
ns
After the entire program is executed, what will the following registers contain? Give your answers in hex.
Register Register contents in hex
R Select AB
R Select ABDDFB "Unknown"
R Select DABE "Unknown"
R Select CEDDF "Unknown"
R Select E "Unknown"
R Select FCFFC "Unknown"
R Select CB "Unknown"
PC Select "Unknown"
After the entire program is executed, what will the following Data Memory locations contain? Give your answers in hex.
Data Memory Location Contents in hex
x Select
x Select AE
x Select E
x Select CCFFCFC "Unknown"
x Select CCFFCDE
x Select
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
