Write an assembly function to determine the hamming distance


Assignment

General Instructions : In the following pages you are requested to write 4 Assembly language functions. The skeleton code for the C version of these functions is given below.

Place all Assembly functions into a file named as "Homework6yourreadID.S" and submit this file on blackboard.

Note that you will write all functions in this homework in assembly. Function 1 :

int isNumber(char *c)

Function should return 1 is the argument passed is a digit and zero otherwise. Please note the asci equivalents of numeric characters from an asci table.

Function 2 :

Given the following C function prototype that accepts two integer arguments. Complete the function and return 1 if a > b , return -1 if a < b and return 0 if a is equal to b. Please write the function in assembly. Note that the assembly languge skeleton code is given in the attached .s file.

int compare(int a, int b) Function 3 :

Given the following C function prototype which accepts an integer argument, complete the implementation of the function in Assembly language to return the number of 1's in the binary representation of the number passed. For example if the number is (011100011 ) then the function should return 5 as the number of 1s. Please remember that an integer is 32 bits long. Note that the assembly languge skeleton code is given in the attached .s file.

int countOnes(int number)

Function 4:

Write an assembly language function to determine the hamming distance ( the number of different bits) between two characters passed as parameter. Please note that the function prototype is given below and the function will be implemented in assembly language. Note that the assembly languge skeleton code is given in the attached .s file.

int returnHammingDistance( char firstparameter, char secondparameter)

Format your assignment according to the following formatting requirements:

1. The answer should be typed, double spaced, using Times New Roman font (size 12), with one-inch margins on all sides.

2. The response also includes a cover page containing the title of the assignment, the student's name, the course title, and the date. The cover page is not included in the required page length.

3. Also include a reference page. The Citations and references should follow APA format. The reference page is not included in the required page length.

Request for Solution File

Ask an Expert for Answer!!
Assembly Language: Write an assembly function to determine the hamming distance
Reference No:- TGS02996515

Expected delivery within 24 Hours