Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Purpose: The purpose of this assignment is to write a program in LC3 assembly language code that can perform addition and negation of 8-bit unsigned

image text in transcribed

Purpose: The purpose of this assignment is to write a program in LC3 assembly language code that can perform addition and negation of 8-bit unsigned numbers and store the result back in memory. Your program will calculate this function: result =(x+y). Both x and y are 8-bit unsigned numbers and are stored in memory locations x4000 and x4001, respectively. Each 8-bit number is stored in bits [7:0]. Note that bits [15:8] are not part of the number. Do NOT assume that bits [15:8] are all zeros. Your program should store the result in memory location x4002. Example: If the memory location x4000 contains 0110101001111100 (x6A7C), and memory location x4001 contains 0001100000111111 (x183F), then your program should: (i) Retrieve the two numbers to be added from memory location x4000 and x4001. (ii) Mask out bits [15:8] from both numbers, resulting in x007C and x003F, respectively. (iii) Add x007C with x003F, which is x00BB. (iv) Negate x00BB by performing 2's complement, which results in xFF45. (v) Place the final result, xFF45, in memory location x4002. 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 3000 ). - When you load memory location x4000 and x4001, bits [15:8] need to be masked out when computing the sum

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

Students also viewed these Databases questions