Question: For this lab you will implement a basic LC 3 assembly program which calculates the sum of 1 0 2 s complement numbers Program Details
For this lab you will implement a basic LC assembly program which calculates the sum of
s complement numbers
Program Details
Your program will start at x in memory and sum the numbers stored at memory
locations x to x Please note that while the autograder will populate these memory
address with data values, when testing your program, you will need to place these values into
memory manually. I recommend doing so by modifying the memory values via the simulator
rather than using assembly code. The final sum will be stored at memory location xA
Once stored, your program will halt the machine using the HALT command.
You must place any FILL pseudoops after your HALT command. Placing FILL pseudo
ops before the HALT will cause the data stored at those locations to be executed as
instructions. This can cause your code to produce unexpected results and prevent
Gradescope from executing correctly.
My code so far:
ORIG x
AND R R #
LD R STARTADDR
AND R R #
ADD R R #
LOOP
LDR R R #
ADD R R R
ADD R R #
ADD R R #
BRp LOOP
ST R RESULT
HALT
STARTADDR FILL x
RESULT FILL xA
END
ErrorsFailed Tests:
oneTenTest Test
When summing the values we expected but was
tenOneNegativeTest
When summing the values we expected but was
somePositiveSetTest
When summing the values we expected but was
someNegativeSetTest
When summing the values we expected but was
someMixedSetTest
When summing the values we expected but was
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
