Design and test your program in an iterative manner

Assignment Help Computer Engineering
Reference no: EM131435234

Project

Assignment

Download the MARIE simulator (MarieSim.jar), which allows you to observe the contents of registers and memory while running a program. The MARIE simulator is available for free at: https://computerscience.jbpub.com/ecoa/3e/simulators.aspx. I will attach the file. Please review first the marie guide.

It is required to complete this project assignment. Also, note that the Marie simulator requires Java version 5 or later to be installed on your computer. You will not be using thedatapath or memory simulators that are also available at this site.

1. Introduction

The objective of this project is to reinforce your understanding of computer organization, instruction set architectures, and assembly language. You will accomplish this by writing, analyzing, and debugging an assembly language program for the MARIE processor.

You must: (i) design and write an assembly language program for the MARIE processor that inputs, transforms, stores, and then outputs a sequence of characters from the set A-Z; (ii) debug and test your program by simulating it using the MARIE simulator; (iii) document your work in a short report; and (iv) submit the report file (*.pdf), assembler source file (*.mas), assembler listing file (*.lst), and assembler executable file (*.mex).

2. The MARIE Simulator

The MARIE simulator is provided as a zip file containing Java archives (*.jar) files, documentation, and example source files. Unzip the file to a directory for use. Do the following to become familiar with the MARIE simulator.

Rea d " A Quick Start Guide for the MARIE Machine Simulator

Environment" (QuickGuide.pdf provided in the zip file).

Depending on how comfortable you are with using the MARIE simulator after reading the quick start guide, you may also wish to read "A Guide to the MARIE Machine Simulator Environment" (MarieGuide.pdf provided in the zip file).

Review the example assembly language source files and experiment with the MARIE simulator using these examples. The Ex4_3.mas and Ex4_4.mas examples are likely the most relevant to this assignment.

3. Design Specification

You are to design, write, test, and debug a MARIE assembly language program that inputs a sequence of characters from the set A-Z (capital letters only), stores each character in memory after it is transformed by the trivial ROT13 cipher, and then, after character input completes, outputs the transformed characters.

A template source code file (Project-2_Start.mas) is provided with this assignment. Edit this file to create a program that meets the program specifications. Note that the template includes instructions to initialize some working values that your program can use. The template also defines memory locations. You may add data memory locations. The program can be designed without additional data locations, but it may be necessary to do so for your design.

For full credit, your solution must perform the functions and satisfy the requirements specified below.

a) The first instruction of the program must be placed at location (address) 0x100 (100 hexadecimal) in MARIE's memory. This is accomplished by following the program template that is provided.

b) The constant data values (One, ChA, ChZ, ChPer, Val13, Start) should not be changed by the program. The program can load from these memory locations, but should not store to them.

c) Transformed input characters must be stored in successive memory locations beginning at location 0x200 (200 hexadecimal) as indicated in the program template. The program should store all transformed input characters before any characters are output.

d) The program should always initialize the values for Ptrin the working data memory and not rely on the values for these locations that are defined in the assembly source file. This initialization is done by the provided template file.

e) The program should work for any inputs ‘A' through ‘Z' and ‘.' (a period terminates input). In the interest of keeping the program simple, the program does not need to validate inputs.

f) When transformed characters are stored and when transformed characters are output, the program must use a loop and indirect addressing to access the values in the array of words. Note that variable Ptris initialized in the template code and should be used in the loop. You may also define a Count variable to count the number of characters, but there are also correct designs that do not require a Count variable.

g) The program should operate as follows.

Input Phase:

1. A character (A-Z or ‘.') is input. MarieSim allows the user to input a single character that is read into the accumulator (AC) with an Input instruction.

2. If character ‘.' (period) is input, then the input phase ends and the output phase begins (step 5 below). (The period may be stored in memory to mark the end of the characters or the characters can be counted to determine how many transformed characters to output during the output phase.)

3. The character that is input is transformed using the trivial ROT13 cipher (see Section 5.1).

4. The transformed character is stored in the next location in the block of memory beginning at location Start. (Variable Ptrmust be updated and indirect memory addressing must be used.)

Output Phase:

5. All transformed characters are output, beginning with the first character that was transformed. The ‘.' character is not to be output. (This will require a loop using variable Ptr and indirect addressing. Note that the number of characters to output will vary and the program must know when to stop the output by relying on a ‘.' or other special character in memory, counting the number of input characters during the input phase, or some other method.)

6. After all characters are output, the program halts by executing the HALT instruction.

4. Testing

Test and debug the program using the MARIE simulator (MarieSim.jar). Debug the program using the "Step" and "Breakpoint" features of the simulator. You must test your program with the following two test cases.

Test 1: Input the eight-character sequence "VIRGINIA" followed by a ‘.' to terminate the input. Note that you need to input one character at a time into MarieSim's ASCII Input area, with each character followed by pressing the "Enter" key. The ROT13 value of each character ("IVETVAVN") should be displayed after the ‘.' character is input.

Test 2: Reload the program in MarieSim, without reassembling, input the four-character sequence "GRPU" followed by a ‘.' To terminate the input. Note the output.

When you create your source file within MarieSim (using the File > Edit menu pick), use file namelastname_firstname_P2.mas, where "lastname" is your last or family name and "firstname" is your first or given name. You can assemble your source file in the editor program. The assembly process creates a listing file (lastname_firstname_P2.lst) and an executable file (lastname_firstname_P2.mex). Load the executables file into the simulator for execution.

5. Design Notes

5.1. The ROT13 Cipher
The ROT13 cipher (see https://en.wikipedia.org/wiki/ROT13) is an old, but trivial cipher that simply rotates the characters by 13 positions. For example, ‘A' is transformed to ‘N' and ‘Z' is transformed to ‘M'.

The Project-2_Start.mas source file includes a ROT13 subroutine that almost performs this transformation. You need to fix one bug in the subroutine.

5.2. Tips for Program Design and Debugging

Here are some suggestions to keep in mind as you design and implement your program.

Design and test your program in an iterative manner, building from simple functionality to full functionality. For example, first write a program that inputs characters and just stores them in memory. Then, add the code to transform the characters using ROT13 before they are stored (and fix ROT13). Then complete the program by adding code to output the transformed characters.

Study sample code in the textbook. For example, Example 4.4 (page 254) provides code that traverses and outputs a string. (Sound familiar?) Example 4.5 (page 255) shows code that calls a subroutine. The operand used with the Skipcondinstruction is a source of frequent errors, so study the examples, such as Example 4.4 (page 254), to be sure you understand how to specify the operand for Skipcond.

Correct solutions for the project require that about 25 to 30 instructions are added to the template. If you find that you are using significantly more instructions than this, you should reconsider your design and, as needed, consult with the GTA and/or instructor.

When debugging your program, set a breakpoint in MarieSim to execute past the input operation and then single-step through the program to ensure the code is doing what you want it to do.

When debugging and testing, be sure that "ASCII" is selected for the input and output windows in MarieSim.

An "Instruction Set Cheat Sheet" can be displayed from the "Help" menu in the MARIE Assembler Code Editor.

Submission Requirement

1. Simple report( I ONLY NEED SECTION2 AND SECTION3)

Section 2 - Design Description: Describe the high-level operation of the program. In particular, briefly describe initialization and the operation of the loop.

Section 3 - Testing and Results: Give a summary of the two tests and associated outcomes that you obtained using the MARIE simulator. Provide images of one or more screen captures for Test 1 described in Section 4 above. Your screen capture(s) should show the final results in the output area of MarieSim, and the contents of memory locations 0x200 through 0x20F from the memory display in MarieSim.

2. Files

Create the source file with file name lastname_firstname_P2.mas. When the source file is assembled, the assembly process will create an executable file (lastname_firstname_P2.mex) and a listing file (lastname_firstname_P2.lst). Save the *.mas, *.lst, and *.mex files for submission.

Attachment:- Assignment.rar

Reference no: EM131435234

Questions Cloud

How you are going to turn around the department : You are to develop a paper to present to the CEO that will outline how you are going to turn around the department (your department - hint - you are NOT in charge of production).
What annual interest rate did she receive : To save for retirement, Karla Harby put $650 each month into an ordinary annuity for 15years. Interest was compounded monthly. At the end of the 15years, the annuity was worth $221,450. What annual interest rate did she receive?
How is ebph different from evidence-based medicine : The concept of evidence-based practice is well established in numerous disciplines including psychology, social work, nursing, medicine, and public health. Respond to the following: How is EBPH different from evidence-based medicine
Industry and competitor standard ratios : Compare and contrast your company's (PepsiCo Corporation) ratios to industry and competitor standard ratios obtained from Yahoo Finance, Morningstar, MotleyFool, Macroaxis or other Internet sources, and provide a detailed answer and analysis as to..
Design and test your program in an iterative manner : Design and test your program in an iterative manner, building from simple functionality to full functionality. For example, first write a program that inputs characters and just stores them in memory.
Value of the annuity on the purchase date : Lois is purchasing an annuity that will pay $5,000 annually for 20 years, with the first annuity payment made on the date of purchase. What is the value of the annuity on the purchase date given a discount rate of 7%?
Demand variability follows a poisson distribution : Consider the data given in problem 16b at the end of chapter 2 of Factory Physics. Assume that demand variability follows a Poisson distribution and that the desired service level is 98% probability of not stocking out. Calculate the best order quant..
How was a beam of electrons shown to have wavelike propertie : How was a beam of electrons show to have wavelike properties?
What does the literature say about extrinsic motivators : Who should monitor the process and determine if the pay being awarded is having a positive effect on hard-wiring behavior? What does the literature say about extrinsic motivators such as pay

Reviews

Write a Review

Computer Engineering Questions & Answers

  Express and give an example of a web database.

Explain the difference between system design and system analysis.

  Discuss aspect of ajax in relation to service architecture

AJAX will help the trend of pushing software as a service on the Web! Discuss this aspect of AJAX in relation to the Service Oriented Architecture of Web services. Are the two really doing the same thing, or is AJAX fundamentally used for a more r..

  Write ieee floating point representation of the following

Write IEEE floating point representation of the following decimal numbers.

  Find out the strategic merits and demerits of using

determine the strategic advantages and disadvantages of using customer relations management crm services provided by

  Write down program for a bank account

Write down program for a bank account

  Would the same steps to correct a color image be followed

would the same steps to correct a color image be followed when restoring an old black and white photo? explain your

  Questiontwo parties a and b try to communicate with

questiontwo parties a and b try to communicate with following encryption scheme-both sides agree on same long random

  How may a business use the internet

How may a business use the Internet. Provide three examples with web links demonstrating your answer.

  What are the advantages of using a compiled language

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you choose to use an interpreted language?

  Developing logic for program

Design the logic for a program which reads in 100 customer records and stores first and last names and total purchases in three parallel arrays.

  Describe about quantum computing

Quantum computing is the latest technological concept in information processing. Your imaginings and musings about where technology may take us after quantum-based computing

  Beginning with your code add a jmenubar to your main window

beginning with your code add a jmenubar to your main window with a game menu which contains 5 jradiobuttonmenuitems as

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