Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assembly Language Programming l T-Mobile Wi-Fi 10:26 PM hw1_type.docx This assignment is to write a MIPS program to get types of input characters. Character types
Assembly Language Programming
l T-Mobile Wi-Fi 10:26 PM hw1_type.docx 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: LWU R2, 3 the output from the program shall be THISLOOP: WU R2, 3 222222224 222 2141 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 # input line inBuf st-prompt: asciiz outBuf for the input line space 80 "Enter a new input line. In # char types Space 80 A rough structure of the program is as follows: while (1) getline0; if (inBufT0]break; for (i 0; i80; i++) key = inBuf[i]; chType lin search(key outBufi char(chType if (key-'#' ) break; print inBuf print outBuf clear inBuf clear outBuf 1. Reading input lines A procedure call to getline is made by the following MIPS statement: l T-Mobile Wi-Fi 10:26 PM hw1_type.docx 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: LWU R2, 3 the output from the program shall be THISLOOP: WU R2, 3 222222224 222 2141 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 # input line inBuf st-prompt: asciiz outBuf for the input line space 80 "Enter a new input line. In # char types Space 80 A rough structure of the program is as follows: while (1) getline0; if (inBufT0]break; for (i 0; i80; i++) key = inBuf[i]; chType lin search(key outBufi char(chType if (key-'#' ) break; print inBuf print outBuf clear inBuf clear outBuf 1. Reading input lines A procedure call to getline is made by the following MIPS statement 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