Question
Here is what has been done so far Load values from memory locations Ox3080, Ox3081, Ox3082, Ox3083 into R0, R1, R2, R3 respectively LD R0,
Here is what has been done so far
Load values from memory locations Ox3080, Ox3081, Ox3082, Ox3083 into R0, R1, R2, R3 respectively
LD R0, Ox3080
LD R1, Ox3081
LD R2, Ox3082
LD R3, Ox3083
; Add the values in R0, R1, R2, R3
ADD R0, R0, R1
ADD R0, R0, R2
ADD R0, R0, R3
; Load the value stored in Ox3084 into
R1 LD R1, Ox3084
; Subtract the value in R1 from the sum in
R0 SUB R0, R0, R1
; Store the result in R0 in memory location Ox3085 ST R0, Ox3085
; Halt the program
HLT
And here's the hexadecimal equivalent: (I put these numbers down below into my grader and I got many errors.) Please help me fix this below to get it right!
3000
2080
3081
2082
3083
0003
4020
4020
4020
6084
5020
7085
F025
This is a programming assignment that will be graded and scored as a homework since it is so simple. Write a program for the LC3. This program should be named hwAdd4Sub1Mem.hex. This hex file will be a machine language program for the LC3 processor. This program will be written as an ASCII hex file. DON'T TRY TO ASSEMBLE IT WITH AN LC3 ASSEMBLER. The hex file must contain only hex characters; 09 and A-F with no x,X,Ox, or 0X. Each line should be a four digit hex number. Do not include a 0x or x at the beginning of this number. The first line should be the starting address in memory, use 3000 to be safe. The last line should be a halt (F025) The lines between the first and last line should do the following: Add the values from memory locations 03080,03081,03082, and 03083. Subtract the value stored in 0x3084. Store the sum in memory location 0x3085 Write your program in assembly. Convert it manually to hex. Put the hex in hwAdd4Sub1Mem.hex. Test your program using the simulator. Make sure to test with numbers OTHER than the ones we discussed in class. Do not submit a program that somehow stores values in 003080,03081,03082,03083, and 03084. Doing this will work for testing but will overwrite the test values that my testing software inserts. You have been warned. The following hint(s) may help you locate some ways in which your solution may be improved - Value in 03085 incorrect when adding 510,800,73,186, and 1255 - Value in 0x3085 incorrect when adding 1662,1855,1377,1105, and 1036 - Value in 0x3085 incorrect when adding 739,1996,1257,1824, and 114 - Value in 0x3085 incorrect when adding 1469, 1375, 592, 1712, and - 1357 - Value in 03085 incorrect when adding 1, 2, 3, 4, and -5 - Value in 0x3085 incorrect when adding 251,662,267,694, and 586Step 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