Portfolio assignment for CS 271: Computer Architecture & Assembly Language course at Oregon State University
Write and test a MASM program to perform the following tasks:
-
Implement and test two macros for string processing
mGetString
: Display a prompt (input parameter, by reference), then get the user’s keyboard input into a memory location (output parameter, by reference)mDisplayString
: Print the string which is stored in a specified memory location (input parameter, by reference)
-
Implement and test two procedures for signed integers which use string primitive instructions
ReadVal
:- Invoke the
mGetString
macro to get user input in the form of a string of digits - Convert (using string primitives) the string of ascii digits to its numeric value representation (SDWORD), validating the user’s input is a valid number (no letters, symbols, etc.)
- Store this one value in a memory variable (output parameter, by reference)
- Invoke the
WriteVal
:- Convert a numeric SDWORD value (input parameter, by value) to a string of ASCII digits
- Invoke the
mDisplayString
macro to print the ASCII representation of the SDWORD value to the output
-
Write a test program (in
main
) which uses theReadVal
andWriteVal
procedures above to:- Get 10 valid integers from the user
- Stores these numeric values in an array
- Displays the integers, their sum, and their truncated average