CS061 Assignment 1- LC-3 assembly language programming Solved

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

5/5 - (1 vote)

The purpose of this assignment is to familiarize you with the basics of LC-3 assembly language programming, the SIMPL emulator, and rudimentary debugging.

Your Tasks

Implement the LC-3 program from the image below.

Note​: This is similar to, but not ​quite​ the same as, the program you worked on in Lab 1: it uses a DO-WHILE loop to multiply two numbers together.

First (as with all your labs and assignments) go to the Assignment folder in Piazza​, and download the assignment 1 zip file to your assignments/assn1 folder in your cs account, and unzip it in place.

Type the code from the image into your assn1.asm file ​(again, the registers are assigned differently from your Lab 1 exercise, so don’t copy that!)​: geany assn1.asm &

and then launch & run simpl: simpl assn1.asm &

Remember: whenever you run simpl, you must ALWAYS keep the Text Window open so you can see warnings & error messages from the emulator!

When the emulator opens, place a ​breakpoint​ at the ​beginning​ of the DO-WHILE loop by right-clicking that line of code and selecting “Mark as Breakpoint”.

Lastly, create a table in your .asm file (below the header, above the code) to record the register contents for each​ register (R0 through R7) as you step through the program, as follows:

  • Before entering the loop (i.e. the first time the program halts at the breakpoint)
  • After each iteration of the loop (each subsequent breakpoint halt)
  • Note that since your breakpoint is at the start of the loop, the register values after the last iteration will just be the values when the program has ended, as suggested by the naming of the last row in the image below.

How many rows do you think you will end up with in your table?

Record the table just like the one in the image below ​(but obviously with the actual values from ALL your registers for ALL iterations of the loop!)

The following program performs the action:

R3 <– 12 * 6   ; (i.e. multiply 12 by 6 and write the result into Register 3)  using the equivalent of a DO-WHILE loop:

 

 

 

  • assn1-ciomlr.zip