1

Basically, I'm using syscall 100 in MIPS, and I'm trying to program a game at the moment. I have this code below to check user input:

getInput:
#===================================================================
addi $v0, $zero, 0

lui $t8, 0xffff
lw $t7, 0($t8)
andi $t7,$t7,1
beq $t7, $zero, getInput1
lw $v0, 4($t8)

getInput1:  
jr $ra

Now, I want to check what key the user has pressed and perform an action (won't go into details about it here) immediately, without the user pressing enter. Also, the input is in ascii format, and me using bne or beq to check with an integer won't work because they are different formats.

So far, I have:

li $v0, 100
li $a0, drwho #drwho is the object i'm moving on the game screen
jal getInput

Any idea how to immediately get and perform an action based on the user input?

  • syscall 100..? Which simulator are you using? – Michael Apr 21 '15 at 09:19
  • i'm using a version of Mars 4.4 – Starscreen60 Apr 21 '15 at 09:21
  • There's no system call 100 listed [here](http://courses.missouristate.edu/kenvollmar/mars/help/syscallhelp.html). What does it do? – Michael Apr 21 '15 at 09:28
  • System call 100 was custom made by a professor at our university for this game development. But basically, for this syscall of code 100, $v0 is set to 100. $a0 is the action code set to indicate what action the syscall should do. So for example, if $a0 = 1, a game will be created. If $a0 = 2, it creates game objects and so on. – Starscreen60 Apr 21 '15 at 09:34
  • [This question](http://stackoverflow.com/q/27365528/3369324) might be helpful. – Cel Skeggs Jun 30 '15 at 04:44

0 Answers0