Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
620 B
2
Indexable
Never
// TODO : 
"li i, 0\n\t" // i for loop 
"li size, 16\n\t" // arr_size
// lw counter
"addi %[lw_cnt], %[lw_cnt], 2\n\t" 

"loop_label:\n\t" 
// loop starts here
"bqe i, size, end_of_loop\n\t" 
// other counter
"addi %[others_cnt], %[others_cnt], 1\n\t"

"addi i, i, 1\n\t" // i++ 
"lw h, (%[h])\n\t"
"lw x, (%[x])\n\t"
"add y, h, x\n\t" // y = h + x
"sw y, (%[y])\n\t"
"addi %[h], %[h], 1\n\t"
"addi %[x], %[x], 1\n\t"
"addi %[y], %[y], 1\n\t"
// adder counter
"addi %[arith_cnt], %[arith_cnt], 5\n\t"
// lw counter
"addi %[lw_cnt], %[lw_cnt], 2\n\t" 
// sw counter
"addi %[sw_cnt], %[sw_cnt], 1\n\t"
"end_of_loop:\n\t"