Develop trap routines and the use them to implement program

Assignment Help Assembly Language
Reference no: EM131449750

Lab Assignemnt: TRAPs and Subroutines - Memory Dump Computer Organization

PURPOSE

In this lab, students will gain familiarity with the use of low-level subroutines, caller/callee register saving policy, and TRAP calls.

ASSIGNMENT

Using the LC-3 simulator, you will construct an assembly-level program that prompts the user for a starting address (in hex) and an ending address (in hex). Your program will then output the contents of memory (in hex) between the provided ranges (inclusive).

Enter starting memory address:
x3000
Enter ending memory address:
x3001
Memory contents x3000 to x3001:
x3000 xF030
x3001 xF025

Example execution of the Memory Dump routine:

I/O for this routine requires that we develop a routine to enable the input of a 4-digit hex value and a routine for displaying the contents of a 16-bit registers/memory location as a 4-digit hex value. We will implement each of these routines as TRAPs.

• Input (Trap x40): A Trap routine (invoked as TRAP x40) that reads a 4-digit hex from the keyboard and returns the value in R0. This trap may call other traps. You will develop this trap routine and locate it in memory at address x4000.

• Output (Trap x41): A Trap routine (invoked as TRAP x41) that displays the contents of R0 to the display as a 4-digit hex value. This routine should output exactly 5 characters: a leading "x" and the 4 hex digits. Do not display a carriage return/line feed/end-of-line as part of the trap call. This trap may also call other traps. You will develop this trap routine and locate it in memory at address x5000.

Develop these TRAP routines and the use them to implement a program to perform memory dumps (using the i/o format provided in the example above).

Note: The representation for output characters (ASCII) is different than the standard binary representation of the value. For example, you may find it useful to note that the ASCII representation for any single-digit value is #48 greater than the number itself. Thus, the ASCII representation of the character 0 has value #48 (x30) while the ASCII representation of the character 1 has value #49 (x31).

Attachment:- Shift_r.rar

Reference no: EM131449750

Questions Cloud

What is good and bad about each one : Research 3 online tools/services on the internet....tell me what they offer, what is good and bad about each one, and what would you recommend?
Security engineering-cryptography : Define steganography and discuss a method of how steganography is accomplished.
Explain how technology has advanced each of their businesses : Utilize your research and identify the methods these innovators or leaders are using to communicate through technology in an effort to remain relevant.
Expression affect privacy and personal intellectual : How does freedom of expression affect privacy and personal intellectual?
Develop trap routines and the use them to implement program : Develop these TRAP routines and the use them to implement a program to perform memory dumps (using the i/o format provided in the example above).
Describe what the home page will look like : Explain the effects that the Cascading Style Sheet (.css) will have on the Web page. There must be a minimum of two (2) changes. Be sure to include detail.
Determine a discrete-time transfer function : Determine a discrete-time transfer function that approximates G(8) using the Adams-Schlumberger predictor as an operational substitution method. You may use a computer algebra package to help with the resulting algebra.
Substantial security threats facing networks today : 1. What are some of the most substantial security threats facing networks today? Why should we be worried about those threats?
What is the profitability index : What is the profitability index for the following set of cash flows if the relevant discount rate is 10 percent

Reviews

Write a Review

Assembly Language Questions & Answers

  What is the maximum length of a symbol

Scrooge has declared that symbols may consist only of letters, except the letter Q, which is forbidden. What is the maximum length of a symbol? Describe your encoding scheme.

  Write program which should first ask for five random numbers

You are to write a program which should first ask for 5 random numbers from 0-20 (user will input these numbers in no preset order). Input these 5 numbers in variables called num1, num2, num3, num4, and num5.

  Advantage of assembly and high-level programming languages?

What are the advantages and disadvantage of assembly and high-level programming languages?

  Accept two 1-digit numbers (from 0 to 9) from the keyboard

Write an assembly language program that will accept two 1-digit numbers (from 0 to 9) from the keyboard, compare the two numbers, and then print out th enumber of greatest value

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Create a basic i-o (input/output) library of subroutines

For this lab, you will create a Basic I/O (input/output) Library of subroutines. There are 7 subroutines in this library, 4 of which you must write. The lowest level routines have been provided for you and are in the file BasicIO.asm. They are:

  Program that requests n as input

Write a program that requests N as input and computes the left-hand and the right-hand sides of the equation, verifies that they are equal, and displays the result.

  Write a mips program that uses a recursive implementation

Write a MIPS program that uses a recursive implementation of quick sort to sort an array of numbers. The values of the array will be given to you via standard input.

  Write a program which will give the calendar for 3 mnth

Need the following assignment assembled Using MASM and notepad ++ for windows 8086 processor write a program which will give the calendar for atleast 3 months starting from November 2011 to January 2012 including the days/dates

  Function which correctly sorts three

Write an x8086 HLA Assembly language program that implements a function which correctly sorts three parameters and returns a boolean value in AL which should be set to true if any swaps were performed to sort the sequence in increasing order.

  Write a program that clears the screen

Write a program that clears the screen, locates the cursor near the middle of the screen, prompts the user for two integers, adds the integers, and displays their sum. You will need to use the CIrScr, Gotoxy, WriteString, Grit, and ReadInt procedu..

  Develop assembly program to implement a finite state machine

In this lab we will write an assembly program to implement a Finite State Machine (FSM) that recognizes hexadecimal integer constant that conforms to MASM syntax.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd