Purchase Solution

An Assembly Language Program

Not what you're looking for?

Ask Custom Question

Design and write an assembly language program for the MARIE processor that counts the number of occurrences of a particular word value in an array of words.

This program must perform the required function and must satisfy the following requirements.

a) The first instruction of the program must be placed at location (address) 0x100 (100 hexadecimal) in MARIE's memory.

b) Use constant data values (One, Words, Key, and Base) that should not be changed by the program. The program can load from these memory locations, but should not store to them. The array of word values that are to be processed by the program should be in successive memory locations beginning at location Array. The program should not change any of the data values in the array. These values should all be "hard-coded" into the program. Ensure that you set the value in location Base depending on where the assembler places the array, as indicated in the listing file.

c) The program should work for any value in location Words and Key and for any set of values in the array of words, not just those provided in your solution, so test the program thoroughly with different values. The value in location Words must be greater than or equal to 1.

d) The program must place the final value for the count of matching words in location Match.

e) The program must use a loop and indirect addressing to access the values in the array of words. Use meaningful loop variables names like Ptr, Cnt, and Match in the loop.

f) The program should always initialize the values for Cnt, Ptr, and Match in the working data memory and not rely on the values for these locations that are defined in the assembly source file.

Purchase this Solution

Solution Summary

Solution provides a high-level operation of the program including initialization and operation of the loop using C like pseudocode, and later implements that logic in MARIE assembly language. It also provides a brief guidance as to how user can test the program with different values.

Solution Preview

Please refer to the attached 589231-wordcount.mas (Marie program) that implements the following loop logic.

Cnt = Words
Ptr = Base (i.e. &Array[0])
Match = 0

do
{
if (*Ptr == Key)
...

Purchase this Solution


Free BrainMass Quizzes
Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C# variables and classes

This quiz contains questions about C# classes and variables.

Basic Networking Questions

This quiz consists of some basic networking questions.