Different between jump and jump and link

maxflow picture maxflow · Mar 30, 2012 · Viewed 42.5k times · Source

Could someone provide an example of the usefulness of the jal instruction can how it can be used to return to the main body after completing a subroutine?

regards

Answer

paulsm4 picture paulsm4 · Mar 30, 2012

"jmp" is a "goto".

"jal" is a "gosub"

jal saves the return address in $ra, should you wish to return from whence you came ;)

http://logos.cs.uic.edu/366/notes/mips%20quick%20tutorial.htm