I'm a newbie at assembly and I'm having quite some difficulties with it.
I'm using MARS 4.5 and I want to try to write a code which can take an integer from the keyboard and print it right afterwards.
.data
number: .word
.text
.globl main
main:
li $v0, 5
syscall
move $v0, $a0
li $v0, 1
la $a0, ($v0)
syscall
li $v0, 10
syscall
but when I run this, it returns the value 1 no matter what the input is.
The problem seem to be at the "la $a0, ($v0)" command.
I though that if I loaded the address of the $v0 register that holds the input number to the standard register for printing integers, it could work.
How can I solve this?
move
operands reversed. – Jester