MIPS - Writing a simple string
Assembly seems dead lately so here is a tutorial for MIPS.
Thing you will need is mars spim
http://courses.missouristate.edu/KenVollmar/MARS/
here is the commands you need to know for this program very simple.
la = Load Address
li = Load Immediate
j = Jump
Save you're code then hit (f3) or the assemble button and go line by line
to see the processes.
Thing you will need is mars spim
http://courses.missouristate.edu/KenVollmar/MARS/
here is the commands you need to know for this program very simple.
la = Load Address
li = Load Immediate
j = Jump
Save you're code then hit (f3) or the assemble button and go line by line
to see the processes.
Code:
.data
msg: .ascii "MPGH" # Non-null string
.text
main: # Beginning of function
la $a0, msg # Loads address of the msg label to the register $a0
li $v0, 4 # Loads the integer 4 in to the register $v0, output string
syscall # Starts the function
j end # Jumps to the end label
end: # Label
li $v0, 10 # Loads the integer 10 in to the register $v0, tells the program to stop
syscall # Starts the function