300 likes | 403 Vues
This lesson covers essential concepts in computer architecture focusing on instruction sets, addressing modes, and formats. Topics include data transfer, arithmetic, control transfer, and types of operations. Learn about MMX, saturation arithmetic, stack, and call/return instructions.
E N D
Instruction SetsAddress Modes and Formats Week 11 Computer Architecture Computer Architecture
Review Keywords & Concepts • English words & ideas you must know: • MMX • Saturation Arithmetic • Stack • Call / Return Instructions Computer Architecture
What we will learn today • Review last class • Instruction Sets: Addressing Modes & Formats • Addressing • Instruction Formats • QUIZ Computer Architecture
Types of Operations • Data Transfer • Arithmetic • Logical • Conversion • I/O • System Control • Transfer of Control Computer Architecture
Data Transfer • Move – transfer from source to destination • Store – CPU to memory • Load (fetch) – memory to CPU • Exchange – swap contents of src & dest • Clear (reset) – set to all zero’s • Set – set to all one’s • Push – push onto a stack • Pop – pop off a stack Computer Architecture
Transfer of Control • Branch Instruction • Basically sets PC (Program counter) • Jump or ‘goto’ statement • Also, conditional branch (test instructions) • Skip Instructions • ex: ISZ – Increment-and-skip-if-zero • Procedure calls Computer Architecture
Procedure Call Instructions • Stacks • Call - Save State (push onto stack) • Save return address • Save registers • Return – Restore State (pop off stack) • Restore registers • Jump to return address Computer Architecture
Pentium & PowerPC Operation Types • MMX • Designed for Multi-media tasks • SIMD (single-instruction, multiple-data) • Parallel processing feature • Focused on video & audio data Computer Architecture
Byte order • Little-Endian vs. Big-Endian (pages 376-380) • Hexadecimal – 12345678 • Little-Endian • 78563412 • Big-Endian • 12345678 Computer Architecture
Addressing Modes • Immediate • Direct • Indirect • Register • Register Indirect • Displacement • Stack Computer Architecture
Immediate Addressing • Immediate • Operand is actually present in the instruction • Advantage – no memory reference • Disadvantage – limited magnitude opcode, operand operand IS the data Computer Architecture
Direct Addressing • Direct • The address of the data is located in the operand • Advantage – Simple • Disadvantage – Limited Address Space opcode, address operand contains address in main memory • Issue – how many bits available for address? Computer Architecture
Indirect Addressing • Indirect • Operand is an address in memory which contains the ACTUAL address of the real operand • Advantage – large address space • Disadvantage – multiple memory references opcode, address-of-address operand contains the address of the operand • Issue – multiple memory references / clock cycles Computer Architecture
Register Addressing • Register • Operand field refers to a register • Advantage – No memory reference • Disadvantage – Limited address space opcode, register the data for the instruction is stored in a register Computer Architecture
Register Indirect Addressing • Register Indirect • Register contains address of operand • Advantage – Large address space • Disadvantage – Extra memory reference opcode, register register contains address of operand Computer Architecture
Displacement Addressing • Displacement – 3 kinds • Relative addressing • Base-register addressing • Indexing • Combines direct addressing with register indirect addressing • Operand address is determined by adding a direct address to an address in a register Computer Architecture
Displacement – Relative Addressing • Relative Addressing • Direct address is assumed to be PC • Register contains off-set (2’s compliment) • Advantage – flexibility • Disadvantage – complexity opcode, register address in register is added to (or subtracted from) Program Counter Computer Architecture
Displacement – Base-Register • Base-Register • Offset address is in operand • Base register contains ‘base’ address • Final address is direct address PLUS address in base register • Advantage – very flexible • Disadvantage – complex opcode, register, address Computer Architecture
Displacement - Indexing • Indexing • Base address is in operand • Displacement address is in register • Final address is base address PLUS displacement in displacement register • Advantage – very flexible • Disadvantage – complex opcode, register, address Computer Architecture
Displacement - Indexing • Autoindexing • Displacement register is automatically updated (incremented) after each reference Effective Address = Address + (Register) (Register) = (Register + 1) • Can have postindexing & preindexing Computer Architecture
Stack Addressing • Stack • All data is on a stack • Advantage – no memory reference • Disadvantage – limited applicability Computer Architecture
Instruction Formats • Instruction Length • Memory size • Memory organization • Bus structure • CPU complexity • CPU speed Computer Architecture
Instruction Formats • Allocation of Bits • Opcode • Addressing modes • Register versus memory • Number of registers • Address range Computer Architecture
Instruction format – PDP-8 • PDP-8 • 12 bit instructions (12 bit word size) • 3 bit Opcode • 1 bit Direct or Indirect • 1 bit Page 0 or current page • 7 bits Displacement (2 * 128 words) • http://www.faqs.org/faqs/dec-faq/pdp8/section-3.html Computer Architecture
Instruction Formats – PDP-10 • PDP-10 • 36 bit instructions (36 bit word) • 9 bits Opcode • 4 bits Register • 1 bit Indirection • 4 bits Index register • 18 bits address (262,144 words) • http://www.inwap.com/pdp10/opcodes.html Computer Architecture
Instruction Formats • Variable-Length Instructions • PDP-11 • 16 bit minicomputer • 13 different instruction formats • 16 bits to 48 bits per instruction • http://www.village.org/pdp11/faq.pages/PDPinst.html • VAX • 1 or 2 byte opcode • 0 to 6 operands • 1 byte to 37 byte instruction size Computer Architecture
Instruction Formats • Pentium • 0 to 4 byte Prefixes • 1 or 2 byte Opcode • 0 or 1 or 2 byte Optional address specifier • 0,1,2, 4 byte - Optional displacement • 0,1,2,4 byte - Optional immediate field • http://www.laynetworks.com/Pentium_Instruction%20formats.htm Computer Architecture
What you know now • Instructions Sets – Addressing Modes & Formats • Addressing • Immediate • Direct • Indirect • Register • Register Indirect • Displacement • Stack • Pentium & PowerPC Addressing Modes • Instruction Formats • Pentium & PowerPC Instruction Formats Computer Architecture
Reading • Look at the various web pages presented in the slides. Get an idea of various architectures. Next Lecture • CPU Structure & Function Computer Architecture
HomeworkWeek 11 Available on the web page! Computer Architecture