home *** CD-ROM | disk | FTP | other *** search
/ cs.rhul.ac.uk / www.cs.rhul.ac.uk.zip / www.cs.rhul.ac.uk / pub / CS187 / ex1.a next >
Text File  |  2009-03-27  |  669b  |  25 lines

  1. # Shows first construction of if statement
  2.          .text
  3.          .globl __start
  4. __start:
  5. # Setting up values
  6.          la      $t0, thislec
  7.          lw      $a0, ($t0)
  8. # Conditional statement follows
  9. # -----------------------------
  10.          bne     $a0, 33, cont
  11.          la      $a0, string
  12.          li      $v0, 4
  13.          syscall               # display string
  14. # ----------------------------
  15. cont:    la      $a0, bye
  16.          li      $v0, 4
  17.          syscall               # say goobdye
  18.      li      $v0, 10
  19.          syscall               # finish up
  20.  
  21.          .data
  22. thislec: .word 32
  23. string:  .asciiz "This is the last lecture - yaay!\n"
  24. bye:     .asciiz "Goodbye\n"
  25.