Chapter 3 ISA
Chapter 3 ISA
● Make the common case fast.(For example the use of immediate addressing)
4. The memory of MIPS is byte-addressable;and the word length is 32 bits and the
address length is also 32 bits. Words must always start at byte addresses that are multiples
of 4. This property is called alignment. MIPS is a big-endian machine ( IBM36/370,
Motorola, SPARC, and Mac are also big-endian machines). This means when a multi- byte
data is stored in memory , the lsb is at the highest address and msb is at the lowest
address. A little-endian machine stores such data in the reverse order ( intel 80x86, DEC
Vax,DecAlpha are little-endian machines). Suppose
x: .word 3 ,
● Only few instruction for accessing the memory: lw and sw( and lh,sh,lb,sb).
● Only two conditional branches, beg and bne. Other branches are implemented
using slt instruction.
● lui needed to load immediate values larger than 16 bits.
● Fixed instruction size (32 bits) and three simple formats
R-format, I-format and J- format
● R-format instructions:
op(6 bits) rs( 5 bits) rt( 5 bits) rd(5 bits) shamt( 5 bits) funct (6 bits)
Examples of this type are the arithmetic and logical instructions. rs and rt
are the operands and the result will be in rd; the field shamt is set to zero ;
and the two fields op and funct are used to indicate the type of arithmetic
operation. add rd , rs, rt rd rt+ rs
Also this format is used for some branch instructions,
For all a these instruction shamt is set to zero The field shamt is used to indicate
the #of bits to be shifted.
● J-format instruction(jump-format)
j label(target address)
jal label jump to label and save the address of the next instruction in the
register $ra= PC +4.
6. MIPS has many other instructions and macros. Macros are also called pseudo
instructions and has a format similar to the assembly language format of
instructions but each macro is equivalent to one ore more instructions.
During the assembly process the assembler replaces each micro by its
equivalent. In this way the assembly language is extended to provide new
operations. For example b label( branch unconditionally to the instruction at
the label).
7. The addressing modes of MIPs):
PC-relative addressing: where the address is the sum of the PC and a constant
in the instruction;
8. procedure calls
jal procAddr // jump and store the return address404 in the register $ra
At the end of the calle(the return statement) ,the instruction jr $ra is executed.
9. For nested calls , the stack is used . The stack grows toward low memory
addresses. Push and pop are implemented by lw, sw, add, and sub. For push
decrement the stack pointer and for pop , increment the stack pointer.
9. Read Section 2.16(Text#2) that describes the Intel IA-32 one of the most
popular CISC processor.
10. Fallacies:
More powerful instructions mean higher performance.
Write in assembly language to obtain the highest performance.