Answered step by step
Verified Expert Solution
Question
1 Approved Answer
COMP.2030 HW 2: CharType Due Date: 2/12 (Mon) 11:59 PM This assignment is to write a MIPS program to get types of input characters. Character
COMP.2030 HW 2: CharType Due Date: 2/12 (Mon) 11:59 PM This assignment is to write a MIPS program to get types of input characters. Character types are listed at the end in table Tabchar, with a word for a char and the next word for its type. Your program should (1) reads a line from the keyboard, (2) for each character in the input line, search Tabchar for its type and store types of individual characters on the line, and (3) echo print of the input line and print types. As an example, when the following is entered in the keyboard THISLOOP: LUR2, 3 the output from the program shall be THISLOOP 222222224 222 2141 LWU R2, 3 6 Note that each input line includes as the end-of-the-line symbol, although it may be missing. The blank type of 5 can be left out when printing character types Approaches Besides Tabchar table, buffers to store an input line and character types are to be declared .data inBuf st prompt: .asciiz outBuf: space 80 # input line "Enter a new input line. In" space 80 # char types for the input line A rough structure of the program is as follows: while (1M getline0; if (inBuflo] break, for (i=0; i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started