Question
Simple ARM Assembly Project with Given C Code: The objective of this program is to develop a checksum computation in ARM Assembly language. The program
The objective of this program is to develop a checksum computation in ARM Assembly language. The program will read in an ascii string, compute the checksum over the string, and output the checksum value to the console.
This program will compute a trivial checksum value over a given ascii string. A checksum is a value computed over a piece of data to ensure the integrity of data (used to detect errors in the data if its transmitted/moved, or a trivial signature). In this program a relatively simple checksum value is computed.
An example of checksum formula in C is as follows: // in ASCII hex the Hello string is: 0x48 0x65 0x6C 0x6C 0x6F
char *text = Hello;
int i;
unsigned int checksum = 0; // Compute the checksum over the string
for(i = 0; i // mask off all but the lower 8 bits (or 2 hex digits)
Checksum &= 0x000000FF; // display it in HEX
printf(\"checksum: %02X \", checksum); Output: checksum: F4
Or mathematically its: 0x00000048
0x00000065
0x0000006C
0x0000006C
+ 0x0000006F
--------------
0x000001F4
AND 0x000000FF
--------------
0x000000F4 = Trivial Checksum
So the above algorithm needs to be implemented in ARM assembly. The program will read in a short ascii string (16 bytes or less) from a given text file and compute the checksum on the data read from the file. The name of the text file needs to be within the assembly code as an ascii null-terminated string variable such as: InFileName: .asciz \"C:\\\\datafiles\\\\Infile1.txt\" The ARM assembly SWI codes 0x66 and 0x6A must be used to open and read the string into a buffer in memory. A buffer in assembly can be allocated by the following line that creates a variable named LineBuff of 80 bytes: LineBuff: .skip 80 After the calculation it needs to display the checksum to the console using the SWI Code 0x00 for displaying ASCII characters. The value must be displayed as a two-digit hex number. So the checksum digits will have to be converted to ascii before calling the SWI Code 0x00.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started