Book creator (disable)

MIPS Assembly/MIPS Architecture

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search


Contents

[edit] MIPS History

[edit] The MIPS architecture

MIPS is a register based architecture, meaning the CPU uses registers to perform operations on. There are other types of processors out there as well, such as stack-based processors and accumulator-based processors.

Registers are memory just like RAM, except registers are much smaller than RAM, and are much faster. In MIPS the CPU can only do operations on registers, and special immediate values.

MIPS processors have 32 registers, but some of these are reserved. A fair number of registers however are available for your use. For example, one of these registers, the program counter, contains the memory address of the next instruction to be executed. As the processor executes the instruction, the program counter is incremented, and the next memory address is fetched, executed, and so on.

[edit] Why MIPS?

The MIPS processor is Reduced Instruction Set Computer (RISC) based. It was actually developed by the people who pioneered RISC (John Hennessy, the president of Stanford University, founded MIPS Computer Systems, Inc, in 1984 to commercialize his research done on RISC systems at Stanford.) This means that you don't get complex and fun instructions like you would in say, VAX. It all boils down to how long one instruction takes to execute, as well as how easily can we write a compiler for this architecture? For example, the VAX has a CRC (cyclic redundancy check) instruction, this is commonly used in things like TCP/IP. You'd be hard pressed to identify C code that did a CRC and replace it with that particular instruction as a compiler designer. This is one of the main reasons why RISC was developed. There are quite a few others, a good guide to learning about more would be to look up why x86 processors are non-RISC (CISC, complex instruction set computer) on the outside but RISC on the inside.

MIPS instructions are always 32 bits long. There are only 3 instruction formats in MIPS, which makes programming fun and easy. Try remembering the whole x86 instruction set some day.

[edit] MIPS Philosophies

  • Simplicity favors regularity
  • Good design demands good compromise
  • Smaller is faster
  • Make the common tasks the fastest