Description
Purpose: The purpose of this assignment is to write a program in LC-3 assembly language
code to find the sum and difference of two 8-bit unsigned numbers and store the result back in
memory. The two unsigned numbers are specified in memory locations x3300 and x3301. Each
8-bit number is stored in bits [7:0]. Note that bits [15:8] are not part of the number.
Your program should store the sum of the two numbers in memory location x3302.
Your program should store the difference of the two numbers (Number1 – Number2) in memory
location x3303.
Example: If the memory location x3300 contains 0110101001111100 (x6A7C), and memory
location x3301 contains 0001100000111111 (x183F), then your program should:
(i) Add x007C with x003F, which is x00BB, and store this sum in memory location
x3302.
(ii) Subtract x003F from x007C, which is x003D, and store this difference in memory
location x3303.
Notes:
• The first line of your program must specify the memory address of the first instruction of
your program. The LC-3 simulator will place your program starting at that address. For
this assignment, you should place your program starting at x3000 (i.e. the first line of
your program needs to be .ORIG x3000).
• Bits [15:8] need to be masked out when computing the sum and difference.
• Use the LC3Edit program to type in your programs. Your program needs to be in LC-3
assembly language. Please ask any TA or Dr. Telang if you have any questions.
• Your file should be named exactly after your EID, for example, xy1234.asm. Your
program will not be graded if you fail to follow the file naming convention.