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!
Create a Linux-based assembler language program (NASM) which:
Define/Reserve some data/arrays, be sure that your arrays contain these EXACT They will be used during testing of your application(s):
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
Reserve an array of six bytes called Array3. This should be done in the bss section, not the data section
Define another array which contains double word values: Array4 contains (unsigned): 11BDh, 3453h, 2FF0h, 6370h, 3350h, 1025h
Define another array which contains quad word values: Array5 contains (unsigned): FFFh, C3Fh, 22FFh, EF53h, 400h, 5555h
Reserve an array of six quad words called Array6. This should be done in the bss section, not the data section
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.
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.
Using our functions library, print out the contents of Array3 and Array6 after all of the additions for all arrays are
Separate each number with a “, “ to make them easy to read
Add a new line after printing
Label each print. Example: “Contents of Array3 is: xx, xx, xx, xx”
You are only allowed to use the following functions from the Linux function library:
Printendl
PrintString, PrintText
Print64bitNumHex
PrintComma
Do this on Windows as well using the Irvine libraries (64-bit as well)
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
You are only allowed to use the following functions from the Irvine function library:
Crlf
WriteString
WriteHex64
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
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme