void ungetch(int c) { if (bufp BUFSIZE) printf("ungetch: too many characters\n"); else buf[bufp++] = c; }
Translate all functions except main() into ARMv8 assembly language, and put them into a separate assembly source code file called a5.asm. These functions will be called from the main() function given above, which will be in its own C source code file called a5Main.c. Also move the global variables into a5.asm. Your assembly functions will call the library routines printf() and getchar(). Be sure to handle the global variables and format strings in the appropriate way. Input will come from standard input; the program is terminated by typing control-d. Run the program to show that it is working as expected, capturing its output using the script UNIX command, and name the output file script.txt. Use a variety of input expressions to show that your program is calculating correctly.
New Skills need for this Assignment:
• Understanding and use of external variables in assembly • Separate compilation • Calling assembly functions from main() • Calling library functions from assembly routines
Submit the following:
1. Your source code and script via electronic submission. Use the Assignment 5 Dropbox Folder in D2L to submit electronically. Your TA will assemble and run your programs to test them. Name your files a5Main.c and a5.asm, and the script as script.txt.