I can understand and use Java/c++ to a good extent, but for the life of me assembly just confuses me there are 2 functions I'm having trouble with. First:
One function that receives a string and prints it on the terminal
And another one that receives a string and converts it to integers (Strings given all made of numbers).
Any idea on where to start?
On the second function, so far I got this:
main: atoi: li $v0, 8 la $a0, tstr li $a1, 64 syscall sub $sp, $sp,4 sw $ra, 0($sp) move $t0, $a0 li $v0, 0 next: lb $t1, ($t0) beqz $t1, endloop mul $v0, $v0, 10 add $v0, $v0, $t1 sub $v0, $v0, 48 add $t0, $t0, 1 b next endloop: lw $ra, 0($sp) add $sp, $sp, 4
Updated code, still getting the error on 10 being an invalid operand. And about
sub $v0, $v0, 48 should I just do it as
sub $t1, $t1, 48?