MIPS - Writing a simple string

Posts 1–4 of 4 · Page 1 of 1
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.

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
Lol nice to see another person interested in assembly.

I only really have experience with x86 assembly, but it's nice to see and intriguing to look at other processor architectures and assembly languages
There is still people who enjoy assembly just needs to be brought back to life lol, I'm not to familiar with x86 but always looking to learn, I even made a group for assembly for people who are interested in it.
thanks it helps
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us