MipsAssemblyLanguage

MIPS Assembly Language

This is a text book to teach MIPS assembly langauge. It covers the major parts of any assembly language, including how to transfer data between registers and memory, basic addressing, and branching. It also includes how to translate assembly language into machine code, which is essential in teaching how a CPU works to execute an assembly program.

It is different that many books on assembly in that it does not teach how to program in assembly. Programers using assembly almost invariably reinvent spaghetti code. This book presents assembly as a translation of structured pseduo code. All conditions are evaluated to a true/false variable (stored in a register), and the only branches allowed are beqz (branch on equal zero) and br (unconditional branch). Conditionals and loops are then translated into assembly. This might not always be the most efficient assembly, but it prevents spaghetti code, and makes more reasonable programs.

More advanced concepts, such as functions (including a discuss of non-reentrant, reentrant, and recursive functions) , and array addressing, are also covered in a fashion that emphasizes structure of the program.

Note that the link is the main site for this book. At the link are two downloads. The first is the text of the book in pdf format. The second is a zip file of resources for the book, including all the programs and the original Word document.