Relative Content

Tag Archive for mips

I’m not sure what value is stored on the $8 register

.data .align 2 avar: .asciiz “Have a nice summer” bsum: .space 4 .text .glbl main main: add $8,$0.$0 backS: lb , $4 ,avar($0) beq $4 , $0 , label1 addi $8,$8,1 j backS label1: sw $8,bsum($0) addi $2, $0, 10 syscal I’m not sure what value is stored on the $8 register. It stores the […]

i m not sure what value is stored on the $8 register

.data
.align 2
avar: .asciiz “Have a nice summer”
bsum: .space 4
.text
.glbl main
main:
add $8,$0.$0
backS: lb , $4 ,avar($0)
beq $4 , $0 , label1
addi $8,$8,1
j backS
label1:
sw $8,bsum($0)
addi $2, $0, 10
syscal

Usage of recursion with array in MIPS

.data A: .word 21 16 -12 25 -25 12 -32 -56 19 -11 .text main: la $a0, A #argument 1 : array address li $a1, 10 #argument 2 : number of elements in array jal print li $v0, 10 syscall print: addi $sp, $sp, -12 sw $ra, 0($sp) sw $a0, 4($sp) sw $a1, 8($sp) li […]

MIPS instructions

what does the following two MIPS INSTRUCTIONS mean >>>>> lw $t1,offset_value($t2) (or) sw $t1,offset_value ($t2)