[XoL]
2013-12-11 18:40:27
Create a MIPS function readchar that reads a single character from the secondary UART on our backend machines. An incomplete main-hw10-q2.S is provided for you. Rename it to main.S for this question. This main.S calls readchar function, for which you will implement at the end of the file to input characters from the second UART, and echoes them back using sendchar until an EOF character is seen.
Here is the code I was given (Am require to use) Anyone know what this question is asking me to do? and is anyone capable of doing this? I honestly hit a brick wall
Help would glaadlyyy be appreciated, and or compensated if wanted.
Here is the code I was given (Am require to use) Anyone know what this question is asking me to do? and is anyone capable of doing this? I honestly hit a brick wall
#include <mips.h>
.data
FMT: .string "the char is %c\r\n"
.text
.globl main
main:
/* Function prolog. */
/* Sets up environment for user program to execute. */
addiu sp, sp, -32 /* Make room on Stack for O/S values. */
sw ra, 28(sp) /* Store O/S return address on Stack. */
/* Start of your program. */
li s0, 0xB8000400//THR
loop:
jal readchar
li t0, 4
beq v0, t0, done
move s2, v0
la a0, FMT
move a1, v0
jal kprintf
// move a0, s2
// jal sendchar
b loop
done: /* End of your program. */
/* Function epilogue. */
/* Restores the environment from the O/S. */
lw ra, 28(sp) /* Restore O/S return address. */
addiu sp, sp, 32 /* Restore O/S stack pointer. */
li v0, 0 /* Return value of 0 (normal exit). */
jr ra /* Return to Operating System. */
//reads character
//implement the readchar function below
readchar:
Help would glaadlyyy be appreciated, and or compensated if wanted.