Highlights
Notes:
- All numbers are in base-10 unless otherwise noted.
- If part of a problem is not solvable, explain why in the answer area.
- Print out the form and handwrite your answers in the spaces below.
- Place the hw3.s file and the scanned answers to problem 1 in a single zip file with name lastname_hw3.zip, where lastname is your last name as listed in MyMav.
- Submit the single zip file to Canvas before 11:59:00pm on August 1, 2020.
- Make sure that the code follows the procedure call standards for ARM architecture (see IHI0042F section 5.1), with emphasis on this requirement: “A subroutine must preserve the contents of the registers r4-r8, r10, r11 and SP (and r9 in PCS variants that designate r9 as v6).” (in other words, push and pop R4-11 if you need to use them, as shown in the vector.s examples in class)
1. Suppose that BUSINESS5 structure is defined as:
typedef struct _BUSINESS5
{
uint32_t taxId;
char name[24];
char direction;
char street[35];
uint32_t addNo;
char city[32];
char state[3];
uint32_t zip;
} BUSINESS5;
Show the relative offset of each field in the structure from the beginning of the structure for the unpacked (default alignment) case:
Show the relative offset of each field in the structure from the beginning of the structure for the packed case:
2. Write assembly functions that implement the following C functions:
a. bool isStrEqual(const char str1[], const char str2[]) // returns 1 if the strings match, 0 otherwise
b. void strCopy(char strTo[], const char strFrom[]) // copies strFrom to strTo
// note: strTo must have enough space to hold strFrom
c. uint16_t sumU8_16(const uint8_t x[], uint32_t count)
// returns sum of the values in the array (x) containing count entries.
d. uint32_t sumU32(const uint32_t x[], uint32_t count)
// returns sum of the values in the array (x) containing count entries.
e. uint32_t countInstances(const int32_t x[], int32_t match, uint32_t count)
// returns number of values in the array (x) containing count entries that are equal to match
f. void leftStringFull(char* strOut, const char* strIn, uint32_t length)
// input: array (strIn) containing the input string, and the number of characters to extract (length)
// output: array (strOut) containing length number of strIn characters from the end of the array or an empty string if the length is larger than can be accommodated
// strIn = ‘abcdef’, length = 5 → returns strOut = ‘abcde’
// strIn = ‘abcdef’, length = 7 → returns strOut = ‘’
g. void rightStringTrunc(char* strOut, const char* strIn, uint32_t length)
// input: array (strIn) containing the input string, and the number of characters to extract (length)
// output: array (strOut) containing up to, but not exceeding length number of strIn characters from the end of the array
// strIn = ‘abcdef’, length = 5 → returns strOut = ‘bcdef’
// strIn = ‘abcdef’, length = 7 → returns strOut = ‘abcdef’
h. int32_t findNthMatch(const char strIn[], const char strMatch[], uint32_t n)
// input: array (strMatch) containing the string to find in the array (strIn)
// output: returns the offset within strIn of the nth occurrence of strMatch or -1 if not found
i. void sortDescending (uint32_t y[], const uint32_t x[], uint32_t count)
// input: array (x) containing count entries
// output: array (y), with the values sorted in descending order
j. uint16_t decimalStringToUint16(const char* str)
// convert the null-terminated string (str) to an unsigned 16-bit integer
// treat the string as representing a decimal number
// if a character other than 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9 is present or the value is too large, return 0
k. int8_t decimalStringToInt8(const char* str)
// convert the null-terminated string (str) to a signed 8-bit integer
// treat the string as representing a decimal number
// if a character other than 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, or – is present or the value is out of range, return 0
l. uint8_t hexStringToUint8(const char* str)
// convert the null-terminated string (str) to an unsigned 8-bit integer
// treat the string as representing a hexadecimal number
// if a character other than 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, or F is present or the value is too large, return 0
m. void uint8ToBinaryString (char* str, uint8_t x)
// convert the unsigned integer (x) to a null-terminated string (str) representing a binary number
n. int32_t findCity (char city[], const BUSINESS5 business[], uint32_t count)
// returns the index of the first entry in the array (business) containing count entries which matches the requested street. If the name is not found, return a value of -1. You can assume that C default alignment is used for this problem.
Write the solution of each of these functions in a single file hw3.s with functions being callable from a C program. You do not need to send the .c file.
This CSE2312-001: Computer Science Assignment has been solved by our Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.