Hello guys,

I am taking the MIPS assembly course this semester. indeed, I am struggling with this course. any way i need ur help ..

My guestion is how to make the output appears right justified and how to connect the previous functions to the new function which is the right justification one.. plzzzz guys helpme out and clue me in..

I did the following code ... if it needs some corrections just tell how to correct and where ....

.data 
buffer: .space 13
.text
 
li $t5, 12
li $t6, 10
 
add $a1, $a1, 12
sb $0, 0($a1)
move $a2, $a0 
loop: 
 
addiu $a1, $a1, -1
 
bnez $a0, loop 
 
 
 
li $v0, 5
syscall
 
div $a0,$t6
mflo $a0 
mfhi $t4
addi $t4, $t4, 48
sb $t4, 0($a0)
addiu $a1, $a1, -1 
addiu $t5, $t5, -1 
 
bnez $t5, loop2 
loop2:
 
li $t2, 0x20
addiu $t5, $t5, -1
sb $t2, 0($a1)
addiu $a1, $a1, -1
 
li $v0, 8
la $a0, buffer
li $a1, 13
syscall

Hello guys,

I am taking the MIPS assembly course this semester. indeed, I am struggling with this course. any way i need ur help ..

My guestion is how to make the output appears right justified and how to connect the previous functions to the new function which is the right justification one.. plzzzz guys helpme out and clue me in..

I did the following code ... if it needs some corrections just tell how to correct and where ....

.data
buffer: .space 13
.text

li $t5, 12
li $t6, 10

add $a1, $a1, 12
sb $0, 0($a1)
move $a2, $a0
loop:

addiu $a1, $a1, -1

bnez $a0, loop

li $v0, 5
syscall

div $a0,$t6
mflo $a0
mfhi $t4
addi $t4, $t4, 48
sb $t4, 0($a0)
addiu $a1, $a1, -1
addiu $t5, $t5, -1

bnez $t5, loop2
loop2:

li $t2, 0x20
addiu $t5, $t5, -1
sb $t2, 0($a1)
addiu $a1, $a1, -1

li $v0, 8
la $a0, buffer
li $a1, 13
syscall

Dont understand your problem.

My guestion is how to make the output appears right justified and how to connect the previous functions to the new function which is the right >ustification one.. plzzzz guys helpme out and clue me in..

What this means? BTW you cant do this sb $t4, 0($a0). Specify your problem more clearly. Add main: after text section.
Use only temporary registers and not globals. If U use global registers than U must save their content on the stack at the begining of program and at the end restore their values.

This article has been dead for over six months. Start a new discussion instead.