Question: Part 1 : MMIO In Phase 1 we will update ecalls.asm to interact with the RARS tool MMIO Display and Keyboard Use the supplied ecalltest.asm

Part 1: MMIO
In Phase 1 we will update ecalls.asm to interact with the RARS tool MMIO Display and Keyboard
Use the supplied ecalltest.asm program to update ecalls.asm so all tests pass.
This will require you to change the names of your ecall routines.
If your ecall routines were not generic, you will need to update the routines.
Remove any subroutines not required by ecalltest.asm
You will need to update the routines to follow register usage guidelines.
Use the stack to save registers, do not use the data section.
You can use the data section for MMIO Address locations.
You need to implement the following ecalls, with the indicated caveats.
printInt: #1
Prints the value in a0 as a decimal integer.
printString: #4
Prints a string one char at a time from a starting address provided in a0.
readInt: #5
Reads a decimal integer from the keyboard and places the value in a0
readString: #8
Reads a string one char at a time to a starting address provided in a0.
Use the readString you implemented in printSort as a starting point.
There is no built-in size limit to the readString routing
Type slowly. Dont type faster than you can read the RDR.
exit0: #0
Exits the program using the standard ecall 10.
printChar: #11
Prints the value in a0 as an ASCII character.
readChar: #12
Reads an ASCII character from the keyboard and places the value in a0.
Copy your ecalls.asm file to a new file called MMIO.asm
Update the wrapper subroutines in MMIO.asm to interact with the MMIO Display and Keyboard tool in RARS.
Replace the ecalls in MMIO.asm with polling routines to the MMIO device registers.
For simplicity, the following routines are modified as follows:
printInt: #1
Prints a single digit value from 0-9.
*hint* How is the number represented as a char.
No error checking is required.
readInt: #5
Reads a single digit value from 0-9.
*hint* How is the number represented as a char.
No error checking is required
exit0: #0
Prints the message -- program is finished running (0)-- to the MMIO display.
Exits the program using the standard ecall 10.
The MMIO device registers are described in the lecture and the help of the MMIO Display and Keyboard tool.
The MMIO routines can print to the RunI/O window for debug purposes ONLY.
The changes to MMIO.asm must be transparent to the caller (no changes to ecalltest.asm).
If you need to update ecalltest.asm, there is likely a bug somewhere.
I recommend writing the simplest routines first, then moving to more complex routines such as printstring and readstring.
Use the MMIO registers as described in the lecture.
Use the supplied ecalltest.asm program to update MMIO.asm so all tests pass.
The ecalltest.asm program only verifies register usage.
You need to ensure correct behavior on the display.
Verify that you are using the stack correctly.
Do NOT edit ecalltest.asm, except for debug purposes.
If you need to update ecalltest.asm, there is likely a bug somewhere.
Before you run your program using the MMIO Display and Keyboard
Set the run speed to 30instructions/second or less.
Press Connect on the tool to link the MMIO window to RARS.
Press Reset on the tool to set the MMIO window to the default values.
Make sure the Display After Delay(DAD) box in MMIO window is unchecked
RESET the MMIO Device every time you assemble your code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!