.data SPC: .asciz " " RTN: .asciz " " ID: .word 7, 5, 4, 3, 1, 0, 2, 6 COUNT: .word 0 HW: .space 4 HG: .space 1024 PX: .space 1024 .globl main .text#------------------------------------- getid: # &COUNT la t0, COUNT lw t1, 0(t0)# COUNT++ addi t2, t1, 1 sw t2, 0(t0)# store in mem. slli t1,t1, 2# &ID la t0, ID add t0, t0, t1# &ID[COUNT] lw a0, 0(t0)# ID[COUNT] ret #------------------------------------- # a3=histogram,a1=pixel,a2=size comph: # alloco frame addi sp, sp, -4 sw ra, 0(sp)# salvo OLD-ra jal getid# a0=tid add t0, x0, x0# t1=8 addi t1, x0, 8# size/8 div t2, a2, t1# tid*size/8 mul t3, a0, t2# t8=&HW la a5, HW lw a5, 0(a5)# t8=HW comph_forini1: slt a6, t0, t2# i