I am working on a code for my assembly language class that takes user input and stores it in memory and then prints it out again for the user. I don't know what the problem is but ever time I invoke the system call code to read the users input it always skips the first 2 letters. The following is my code.
.data
myname: .asciiz "Please Type Your Name:"
ram1: .word 4
ram2: .word 4
blank: .asciiz "\n"
.text
.globl main
main:
li $v0, 4 #loads the system call code to print a string
la $a0, myname
syscall
la $a0, ram1
li $a1, 20
li $v0, 8 #this is the opcode that reads a user input in the console
syscall
li $v0, 4 #loads the call code to print a string
la $a0, blank
andi $a1, $a1, 0
syscall
syscall
syscall
la $a0, myname
syscall
la $a0, ram1
syscall
I understand that the system call code 8 requires 2 arguments to function properly which I added. Any insight would be greatly appreciated!
Cheers