Instruction Set Architecture


Instruction set architecture is the structure of a computer that a machine language programmer or a compiler must understand to write a correct, timing independent program for that machine.

Elements of a machine instruction:
  • Operation code (opcode)
  • Source operand reference
  • Result operand reference
  • Next instruction reference





Obtain instruction from program storage




Determine required actions and instruction size



Locate and obtain operand data




Compute result value or status




Deposit results in storage for later use









Source and result operands can be in one of four areas:
  • main or virtual memory
  • I/O device
  • processor register
  • Immediate




A simple instruction format represented by a sequence
of bits



Instruction types:
  • data processing: arithmetic and logic instructions
  • data storage: memory instructions
  • data movement: I/O instructions
  • program flow control: test and branch instructions






Number of addresses








Types of operand:

  • Addresses
  • numbers
  • characters
  • logical data



Processor actions for various types of Operations






Addressing Modes and Formats


Immediate Addressing:
  • Simplest form of addressing
  • Operand = address field
  • e.g. ADD 5 - Add 5 to contents of accumulator, 5 is operand
Direct Addressing
  • Address field contains address of operand
  • Effective address (EA) = address field (A)
  • e.g.  ADD A - Add contents of cell A to accumulator, Look in memory at address A for operand
Indirect Addressing
  • Memory cell pointed to by address field contains the address of (pointer to) the operand
  • EA = (A)
  • e.g. ADD (A) - Add contents of cell pointed to by contents of A to accumulator
Register Addressing
  • Similar to direct addressing, the only difference is that the address field refers to a register rather than a main memory address
  • EA = R
Displacement Addressing
  • Combines the capabilities of direct addressing and register indirect addressing
  • EA = A + (R)
Relative Addressing
  • A version of displacement addressing
  • R = Program counter, PC
  • EA = A + (PC)
Base-Register Addressing
  • A holds displacement
  • R holds pointer to base address
  • R may be explicit or implicit
  • e.g. segment registers in 80x86
Indexed Addressing
  • A = base
  • R = displacement
  • EA = A + R
Stack Addressing
  • Operand is (implicitly) on top of stack
  • A stack is a reserved block of locations
  • e.g.  ADD - Pop top two items from stack and add
Instruction Formats


> Define the layout of the bits of an instruction, in terms of its constituent fields



> Must include an opcode and, implicitly or explicitly, indicate the addressing mode for each operand



> For most instruction sets more than one instruction format is used




Allocation of Bits:
  • Number of addressing modes
  • Number of operands
  • Register versus memory
  • Number of register sets
  • Address range
  • Address granularity

About the author

Admin
Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus. Aenean fermentum, eget tincidunt.

0 comments:

Template by GagakHitam
Copyright © 2012 Gagak Hitam and Hishamuddin.