2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,10 +1,11 @@
|
|||
.data
|
||||
hello: .asciiz "Hello world!"
|
||||
.data #section for declaring variables
|
||||
hello: .asciiz "Hello world!" #asciiz automatically adds the null terminator. If it's .ascii it doesn't have it.
|
||||
|
||||
.text
|
||||
main:
|
||||
la $a0, hello
|
||||
li $v0, 4
|
||||
syscall
|
||||
li $v0, 10
|
||||
syscall
|
||||
.text # beginning of code
|
||||
main: # a label, which can be used with jump and branching instructions.
|
||||
la $a0, hello # load the address of hello into $a0
|
||||
li $v0, 4 # set the syscall to print the string at the address $a0
|
||||
syscall # make the system call
|
||||
|
||||
li $v0, 10 # set the syscall to exit
|
||||
syscall # make the system call
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue