uni

University stuff
git clone git://git.christosmarg.xyz/uni-assignments.git
Log | Files | Refs | README | LICENSE

lab1.asm (513B)


      1 .data
      2         str: .asciiz "Hello world\n"
      3         num: .word   256
      4 
      5 .text
      6 .globl main
      7 
      8 main:
      9         li      $v0, 4          # 4 - print string
     10         la      $a0, str        # load address of str
     11         syscall
     12         
     13         la      $t0, num        # load address of num
     14         lw      $s1, 0($t0)     # load (t0 + 0) to s1
     15         addi    $t2, $s1, 8     # add s1 + 8 to t2
     16         sw      $t2, 0($t0)     # store t2 to address of (t0 + 0)
     17         
     18         li      $v0, 10         # exit
     19         syscall