Earn Higher Grades With Instant Assignment Help.Ask Question!

Assembly Programming
(5/5)

two arrays in your program which need their contents added together. While doing the additions, you also need to reverse the order of the summed numbers.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Project - Chapter 4: Arrays/Loops

Possible Points: 40

There are two arrays in your program which need their contents added together. While doing the additions, you also need to reverse the order of the summed numbers.

 

This is a 64-bit Application Only!

  1. Create a Linux-based assembler language program (NASM) which:

    1. Define/Reserve some data/arrays, be sure that your arrays contain these EXACT They will be used during testing of your application(s):

      1. Define three arrays, each of which contains single byte values (name these EXACTLY as shown):

        • Array1 contains (unsigned): 10h, 30h, F0h, 20h, 50h, 12h

        • Array2 contains (unsigned): E0h, 40h, 22h, E5h, 40h, 55h

        • Array3 contains (unsigned): Uninitialized

      2. Reserve an array of six bytes called Array3. This should be done in the bss section, not the data section

      3. Define another array which contains double word values: Array4 contains (unsigned): 11BDh, 3453h, 2FF0h, 6370h, 3350h, 1025h

      4. Define another array which contains quad word values: Array5 contains (unsigned): FFFh, C3Fh, 22FFh, EF53h, 400h, 5555h

      5. Reserve an array of six quad words called Array6. This should be done in the bss section, not the data section

    2. Using the loop statement, add the contents of our Byte Array1 and Array2, and store each value into Array3. Array1 and Array2’s values should not change. Use indirect operands to traverse the Use the rsi register as your indirect position register

  • DO NOT use the movsx or movzx statements

•    Put the summed values in ‘reverse’ order in the third array. Example: 10h

+ E0h (first positions in Array1 and array2) should go into the 6th position of the third array.

  1. Using the loop statement, add the contents of our Double Word Array4 to Array 5, store each value into Array6. Array4 and Array5’s values should not

Use indexed operands to traverse the array.

  • DO NOT use the movsx or movzx statements

•    Put the summed values in ‘forward’ order in the sixth array. Example: 11BDh + 0FFFh (first positions in Array4 and Array5) should go into the 1st position of Array6.

  1. Using our functions library, print out the contents of Array3 and Array6 after all of the additions for all arrays are

 

  1. Separate each number with a “, “ to make them easy to read

  2. Add a new line after printing

  3. Label each print. Example: “Contents of Array3 is: xx, xx, xx, xx”

  4. You are only allowed to use the following functions from the Linux function library:

    • Printendl

    • PrintString, PrintText

    • Print64bitNumHex

    • PrintComma

  5. Do this on Windows as well using the Irvine libraries (64-bit as well)

    1. Zip these in separate files and submit them to Canvas. Make sure the .zip file for the Linux project contains the word Linux, and the .zip file for the Windows project contains the word Windows

    2. You are only allowed to use the following functions from the Irvine function library:

      • Crlf

      • WriteString

      • WriteHex64

    3. Note: YOU ARE NOT ALLOWED to use any stack operations in this project! (Do I need to say it again?)

Assumptions

Here are some of the things I assume you know how to do attending class and reading the text(s).

 

  • You understand how to write, assemble and link both a Linux assembly language program and a Windows assembly language

 

  • You understand how to use the Linux and Windows (Irvine) functions for printing data to the console

 

  • You have attended class and read the text and understand all of the data types which you can define within an assembly language program

 

  • You understand how to create an array in assembly language

 

  • You understand how to add two values together using register addition

 

  • You understand how to access single array values and place them into a register using indirect means using a register (rsi/rdi to be specific)

 

  • You understand how to move a value into an array from a register (after the addition) using the indirect means using a register (rsi/rdi to be specific)

 

  • You understand how to use the LOOP statement in assembly language

 

  • You understand how to create a 64-bit linux and windows applications

 

Data to be Used

  • Just what you define in your

Hints/Tips

  • Take a look at the Chapter 4 presentation. EVERYTHING you need is in there. Chapter 5, section 5.5 discusses the Irvine libraries for 64-bit programming

 

  • If you use the Irvine 64 function Write64Hex on Windows, you will want to execute it in the way shown The reason for this is because the Write64Hex function destroys the rcx register and doesn’t restore it (bad Kip Irvine!). The WriteInt64 seems to not have this problem

Attachments:
(5/5)

Related Questions

CSI 1420 Introduction to C Programming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Fu

The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Assignment To Be Done By Our ExpertsGet A+ Grade Solution Guaranteed

expert
joyComputer science
(4/5)
12 Answers Hire Me
expert
Robert DLaw
(4.8/5)
707 Answers Hire Me
expert
Dr Samuel BarberaStatistics
(5/5)
506 Answers Hire Me
expert
Tutor For YouEconomics
(5/5)
579 Answers Hire Me