Advertisement
LegoDrifter

MIPS niza od stringovi so manual access

Apr 17th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. .data
  2.  
  3. names: .space 16 #alociralo 16 bytes na mesto bidejki 4 iminja po 4 bajti
  4.  
  5. Kole: .asciiz "Kole\n"
  6. Anto: .asciiz "Anto\n"
  7. Fico: .asciiz "Fico\n"
  8. Bobo: .asciiz "Bobo\n"
  9.  
  10. #ZAMISLUVAME DEKA pocetnata adresa e 1000 krajnata bi bila 1012 ( 1000 + 3 * 4) znaci sega
  11. #popolnavme 4 iminja site so dalecina od 4 bajti bidejki e word
  12.  
  13. .text
  14. main:
  15.  
  16. la $t0, names
  17.  
  18. la $t1, Kole
  19. sw $t1, 0($t0)
  20.  
  21. la $t1, Anto
  22. sw $t1, 4($t0)
  23.  
  24. la $t1, Fico
  25. sw $t1, 8($t0)
  26.  
  27. la $t1, Bobo
  28. sw $t1, 12($t0)
  29.  
  30. #printing ith element
  31.  
  32. li $v0, 4 #printing string zato 4ka
  33. lw $a0, 0($t0)
  34. syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement