MIPS Oxford Hello World
Do you love or would like to learn Assembly? Here is your starting code:
## Methark Technology - MIPS Example
## hello.asm
## Registers used
## hello.asm
## Registers used
## $v0 - syscall parameter and return value.
## $a0 - syscall parameter-- the string to print.
.text
main:
la $a0, hello_msg
## load the addr of hello_msg into $a0.
li $v0, 4
## 4 is the print_string syscall.
syscall
## do the syscall (print the string).
li $v0, 10
## 10 is the exit syscall.
syscall
## do the syscall (close the program).
## Data for the program:
.data
hello_msg: .asciiz "Hello World\n"
## end hello.asm
You can download the Spim MIPS simulator from Source Forge.
## $a0 - syscall parameter-- the string to print.
.text
main:
la $a0, hello_msg
## load the addr of hello_msg into $a0.
li $v0, 4
## 4 is the print_string syscall.
syscall
## do the syscall (print the string).
li $v0, 10
## 10 is the exit syscall.
syscall
## do the syscall (close the program).
## Data for the program:
.data
hello_msg: .asciiz "Hello World\n"
## end hello.asm
You can download the Spim MIPS simulator from Source Forge.