Summary

MIPS registers

  • 32 32-bit registers
  • no data type, just a number
NameNumberUse
$zero0Constant value 0, cannot be overridden
$at1Reserved for the assembler
$v0-$v12-3Values for results and expression evaluation
$a0-$a34-7Arguments
$t0-t78-15Temporaries
$s0-s716-23Program variables
$t8-t924-25Temporaries
$k0-k126-27Reserved for the operating system
$gp28Global pointer
$sp29Stack pointer, the stack is where the program’s instructions are stored in memory
$fp30Frame pointer
$ra31Return address

Concept

Instruction Set Architecture(ISA)

  • abstraction on the interface between hardware and low-level software
  • tells the programmer about the processor’s functionality
  • specification of the processor’s supported instructions and registers

Assembly

  • human-readable
  • provide pseudo-instructions, which are converted into real instructions before being assembled into machine code

Machine code

  • instructions in binary format

Processor and memory(load-store model)

  • code and data reside in memory
  • during execution, each instruction is sent to the processor via the bus
  • accessing memory is slow, the processor provides registers for temporary storage(load) of values
  • we can perform operations on the values in the registers quickly
  • post-computation, the value can be sent back to memory(store)

processor_bus_memory.png