$29.99
Computer Project #8
Assignment Overview
This assignment develops familiarity with control constructs in assembly language. You will develop an assembly language program for theARMmicroprocessor to process ASCII characters.
It is worth30 points (3% of course grade) and must be completed no later than 11:59 PM on Thursday,11/3.
Assignment Deliverables
The deliverablesfor this assignmentarethe following files:
proj08.makefile –themakefile which produces "proj08" proj08.main.s –the source code for yourprogram
Be sure to use the specified file names and to submit themfor grading via theCSEhandin system.
Assignment Specifications
The program will classify each characterin an input stream, and then producea summary about that input stream.
1. The program will repeatedly read one character from the standard input stream (using the "getchar" function), will process that character, and will write that character to the standard output stream (using the "putchar" function).
2. After processing all characters in the standard input stream, the program will display the following counts (with appropriate labels):
a) Total number of characters b) Number of newline characters c) Number of whitespace characters (blanks, tabs and newlines) d) Number of octal digits (in the set {0-7}) e) Number of decimal digits (in the set {0-9}) f) Number of hexadecimal digits (in the set {0-9, A-F, a-f}) g) Number of letters (in the set {A-Z, a-z})
The program will display a separate line for each of the seven counts.
Assignment Notes
1. To perform input and output operations,youwill use threefunctions which are part of the standard C library.
To readonecharacter from the standard input stream,your program will call"getchar", which returns a 32-bit value in registerR0 (either an ASCIIcharacter or the value-1, representing end-of-file).
To writeonecharacter to the standard output stream, your program will call "putchar", which accepts a 32-bit value in registerR0(representing anASCII character).
To display the seven counts, your program will call "printf".
2. Your program will be assembled and linked using "gcc". For example, ifyour data file (containing ASCII characters) is named"proj08.data",the following commands could be used to assemble and link your program, thenload and execute it:
<prompt gcc proj08.main.s <prompt a.out < proj08.data
You will test your program using text files which you create, but yourprogram is expected to execute correctly for any text file.
You may also input text directly from the keyboard by executing the program without input redirection:
<prompt a.out
End-of-file is simulated byenteringcontrol-d at the beginning of a line.
3. In orderto interfaceARMassembly language functions with standardlibrary functions (such as "getchar", "putchar"and "printf"), you must follow certainconventions about register usage.
The standard library functionsassume thatthe calling function will placeup tofourparameters in registersR0 throughR3 (with the first argumentin registerR0).
The standard library functions place their return value in register R0before returning to the calling function.
RegistersR12, R13, R14 and R15are usedby the systemand their contents must not be modified by yourprogram.