CSE 320
Assignment Overview
Summer 2019
Computer Project #7
This assignment develops familiarity with control constructs in assembly language. You will develop an assembly language program for the ARM microprocessor to process ASCII characters.
It is worth 40 points (4% of course grade) and must be completed no later than 11:59 PM on Tuesday, 6/11.
Assignment Deliverables
The deliverables for this assignment are the following files: proj07.makefile themakefilewhichproducesproj07
proj07.student.s the source code for your program
Be sure to use the specified file names and to submit them for grading via the CSE handin system before the
project deadline.
Assignment Specifications
The program will classify each character in an input stream, and then produce a summary about that input stream.
1. The program will repeatedly read one character from the standard input stream (using function getchar), will process that character, and will write that character to the standard output stream (using function putchar).
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 printable characters (0x20 to 0x7E)
e) Number of control characters (0x00 to 0x1F, 0x7F)
f) Number of octal digits (in the set {0-7})
g) Number of decimal digits (in the set {0-9})
h) Number of hexadecimal digits (in the set {0-9, A-F, a-f})
i) Number of upper case letters (in the set {A-Z})
j) Number of lower case letters (in the set {a-z})
k) Number of letters (in the set {A-Z, a-z})
The program will display a separate line for each of the eleven counts.
Assignment Notes
1. To perform input and output operations, you will use three functions which are part of the standard C library.
To read one character from the standard input stream, your program will call function getchar, which returns a 32-bit value in register R0 (either an ASCII character or the value -1, representing end-of-file).
To write one character to the standard output stream, your program will call function putchar, which accepts a 32-bit value in register R0 (representing an ASCII character).
To display the eleven counts, your program will call function printf.
2. Your program will be assembled and linked using gcc. For example, if your data file (containing ASCII characters) is named proj07.data, the following commands could be used to assemble and link your program, then load and execute it:
End-of-file is simulated by entering control-d at the beginning of a line.
3. In order to interface ARM assembly language functions with standard library functions (such as getchar, putchar and printf), you must follow certain conventions about register usage.
The standard library functions assume that the calling function will place up to four parameters in registers R0 through R3 (with the first argument in register R0).
The standard library functions place their return value in register R0 before returning to the calling function. Registers R12, R13, R14 and R15 are used by the system and their contents must not be modified by your program.
Reviews
There are no reviews yet.