uni

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

lab4_ex3.asm (482B)


      1 .eqv SYS_EXIT           10
      2 .eqv SYS_PRINT_CHAR     11
      3 .eqv LOOP_ITER          5
      4 
      5 .text
      6 .globl main
      7 
      8 main:
      9         # init loop counter
     10         li      $t0, 0
     11         
     12 loop:
     13         # exit if t0 == 5
     14         beq     $t0, LOOP_ITER, exit
     15         addi    $t0, $t0, 1
     16         
     17         li      $v0, SYS_PRINT_CHAR
     18         li      $a0, '*'
     19         syscall
     20 
     21         j       loop
     22         
     23         li      $a0, 0xa
     24         syscall
     25         
     26 exit:
     27         li      $v0, SYS_EXIT
     28         syscall