Advertisement
Lautaroleguizamon

B19

Sep 13th, 2023 (edited)
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .data
  2.     vector: .word 5,29,-331,58,-8,-102,14,75,901,1
  3.     indice: .word 0
  4. .text
  5.     la x5 vector
  6.     la x6 indice
  7.     lw x6 0(x6)
  8.     slli x6 x6 2
  9.     li x10 36
  10. primero:
  11.     add x7 x5 x6
  12.     lw x8 0(x7)
  13. busqueda:
  14.     addi x6 x6 4
  15.     add x7 x5 x6
  16.     lw x9 0(x7)
  17.     blt x9 x8 reemplazo
  18.     blt x6 x10 busqueda
  19.     beq x0 x0 fin
  20. reemplazo:
  21.     addi x8 x9 0
  22.     beq x0 x0 busqueda
  23. fin:
  24.     addi a0 x8 0
  25.     li a7 1
  26.     ecall
  27.     nop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement