Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a C callable assembler function that counts the number of characters in a

ID: 3591910 • Letter: W

Question

Write a C callable assembler function that counts the number of characters in a string. The function should work for any string and character. The address of the string and character to be counted are passed as arguments according to the C function prototype: int count (char *string, char c); Since there are arguments, your assembly function should use a stack frame. It should return the count to the calling C program in %eax. Use 32-bit quantities for all data, chars have only 8 significant bits but they are stored in memory (and on the stack) as 32 bits in "little endian" format. After moving a 32 bit char value from memory to a register, the char value is available in the 8 lsb's, e.g. %al. You are given a C calling program that calls count to count the number of a user entered character in a user entered string and prints the result. The C code "driver" is in countc.c. Put your assembly code in counts. Then build it using the same makefile by invoking "make A=count".

Explanation / Answer

}

then call it like this:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote