I'm writing a program that reads 4 hexadecimals digits, that represent an unsigned integer number, then it condensates those digits in $t1 and finally it calculates and displays the decimal number.
I have completely grasped the solution in theory,but I have trouble using mips as this is my first program. Currently, I have trouble storing the bytes of the string. Here's my code thus far:
.data
msg1: .asciiz "Enter the hexadecimal : "
newline: .asciiz "\n"
.text
main:
#Print string msg1
li $v0 ,4 # print_string syscall code = 4
la $a0,msg1 #load the adress of msg
syscall
# Get input A from user and save
li $v0,8 # read_string syscall code = 8
syscall
move $t0,$v0 # syscall results returned in $v0
li $v0,10
syscall
I know that I'll use lb Rdest, address at some point. But,won't I have to read each digit of the string one by one if that's the case?