Assignment: Conversion of Checksum.c into three address code. 0. A set of declarations that defines the global elementsA set of delcarations that defines the elements within your programming frame....

Assignment: Conversion of Checksum.c into three address code.




0. A set of declarations that defines the global elementsA set of delcarations that defines the elements within your programming frame. Use assembly language syntax.2. A table that provides variable assignments
3. A list of three address instructions corresponding to your checksum.c code.
int main (int argc, char * argv[], char ** envp) {

int count = 10; int sum = 0; byte checksum; byte complement;

/* The following is the prototype for the read system call */ /* Int read(int fildes, void *buf, size_t nbyte); */

unsigned char input[10]; int i;

/* read the 10 bytes */

read(STDIN_FILENO, input, count); for (i = 0; i if (i == 5) checksum = input[i]; else { sum += input[i]; if (sum > max_int) { sum = (sum & 0xFF) + 1; } } } complement = ~sum;

fprintf(stdout, "Stored Checksum: %d, Computed Checksum: %d\n", checksum, complement); if (checksum != complement ) { fprintf(stderr, "Error Detected!\n"); return 1; } return 0;}






Apr 19, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here