Lecture11 - Lecture 11 Instruction Set Architectures, MIPS...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 11 Instruction Set Architectures, MIPS Instruction Formats & Addressing Modes Basic Instruction Set Architectures (ISA) y There is a number of different ISA. We have seen two so far. o Accumulator (single register) (JVN Machine) ± 1 address add A acc acc + mem [A] ± 1 address + x add x A acc acc + mem [A+x] o Stack ± 0 address add tos tos + next (tos = ‘top of stack’) o General Purpose Register ± 1 address add A Rb mem[A] mem[A] + Rb ± 2 address add A B Rc mem[A] mem[B] + Rc o Load/Store (MIPS Machine) ± Load Ra Rb Ra mem[Rb] ± Store Ra Rb mem[Rb] Ra o Memory to Memory ± All operands and destinations can be memory addresses y Each ISA will result in a number of different instructions to perform an operation. o Ex: C = A + B Stack Accumulator Register (register- memory) Register (load/store) Push A Load A Load R1, A Load R1, A Push B Add B Add R1, B Load R2, B Add Store C Store C, R1 Add R3, R1, R2 Pop C Store C, R3 y RISC machines (like MIPS) have only load/store instructions that access memory. So they are also called load-store machines. y CISC machines may even have memory-memory instructions, like mem[C] = mem[A] + mem[B]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Addressing Modes y Every word in memory has an address, similar to the index of an array. y Early computers numbered words like C numbers elements in an array: o Memory[0], Memory[1], Memory[2], … y Today machines address memory as bytes, hence word addresses differ by 4. o Memory[0], Memory[4], Memory[8], … ± 0, 4, 8 is called the address of a word o Computers needed to access 8-bit bytes as well as words (4 bytes/word). Called ‘byte addressing’. Addressing Mode Example Meani ng Generic Examples of Instruction Formats y Depending on the hardware architecture and ISA, there are varying types of instruction formats. y Three types: variable , fixed and hybrid. y Variable instruction format means that each instruction can have a different length. y Fixed instruction format means that all instructions are of the exact same length. y Hybrid instruction format means that classes of instructions have the same instruction length, but different classes can have different lengths. Variable: Fixed: Hybrid: Register Add R4,R3 R4 R4+R3 Immediate Add R4,#3 R4 R4+3 Displacement Add R4,100(R1) R4 R4+Mem[100+R1] Register indirect Add R4,(R1) R4 R4+Mem[R1] Direct or absolute Add R1,(1001) R1 R1+Mem[1001]
Background image of page 2
y If code size is most important, use variable length instructions: (1) Difficult control design to compute next address. (2)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

Lecture11 - Lecture 11 Instruction Set Architectures, MIPS...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online