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 >
Wrap
Text File
|
2009-03-27
|
669b
|
25 lines
# Shows first construction of if statement
.text
.globl __start
__start:
# Setting up values
la $t0, thislec
lw $a0, ($t0)
# Conditional statement follows
# -----------------------------
bne $a0, 33, cont
la $a0, string
li $v0, 4
syscall # display string
# ----------------------------
cont: la $a0, bye
li $v0, 4
syscall # say goobdye
li $v0, 10
syscall # finish up
.data
thislec: .word 32
string: .asciiz "This is the last lecture - yaay!\n"
bye: .asciiz "Goodbye\n"