uni

University stuff
git clone git://git.margiolis.net/uni.git
Log | Files | Refs | README | LICENSE

lab4_ex1.asm (557B)


      1 .eqv SYS_PRINT_STRING   4
      2 .eqv SYS_READ_WORD      5
      3 .eqv SYS_EXIT           10
      4 
      5 .data
      6         zstr:  .asciiz "Zero\n"
      7         nzstr: .asciiz "Non Zero\n"
      8         
      9 .text
     10 .globl main
     11 
     12 main:	
     13         li      $v0, SYS_READ_WORD
     14         syscall
     15         
     16         bne     $v0, $zero, nonzero
     17         li      $v0, SYS_PRINT_STRING
     18         la      $a0, zstr
     19         syscall
     20         
     21         j       exit
     22         
     23 nonzero:
     24         li      $v0, SYS_PRINT_STRING
     25         la      $a0, nzstr
     26         syscall
     27         
     28 exit:   
     29         li      $v0, SYS_EXIT
     30         syscall