1 / 27

The Instruction Set Architecture

The Instruction Set Architecture. September 27 th , 2007 By: Corbin Johnson CS 146. What is the Instruction Set Architecture?. It contains instructions to use and manipulate programmer-accessible hardware in a computer. in terms of place in a

Download Presentation

The Instruction Set Architecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Instruction Set Architecture September 27th, 2007 By: Corbin Johnson CS 146

  2. What is the Instruction Set Architecture? • It contains instructions to use and manipulate programmer-accessible hardware in a computer. in terms of place in a computer

  3. What is the relationship between the Instruction Set Architecture and Assembly / Machine language? • An assembly / machine program is made up of the instructions in the ISA and makes use of registries in the ISA.

  4. Here’s how it works • Higher level languages (Java, C++, etc…) are translated into assembly / machine language by compilers. • When a user calls the program, the compiled program is loaded into RAM. • The program then executes, line by line, until the Operating System takes back control of the computer.

  5. A Sample Computer: ARC • The ARC has an ISA that is a subset of the ISA of the SPARC, or Scalable Processor Architecture processor developed by Sun in the mid 80’s. • Has most important features of SPARC but has left out most complex portions. • ARC is considered a RISC or “Reduced Instruction Set Computer.”

  6. Goal: Program the ARC • A program can be written for the ARC using the ISA of the ARC. • Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set

  7. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • 32 bit memory • Byte Addressable • Memory-mapped I/O

  8. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • The OS • 211 bits of memory • Only OS uses this area

  9. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • The User Space • Undefined amount • User’s program fills Into unused space • Designed to work well If stack small and Program large or Vice versa.

  10. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • The System Stack • Undefined amount • Program’s execution Uses stack for storage • Grows towards lower Memory as user’s Space grows towards Higher memory.

  11. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • Memory-Mapped I/O • Static slots • Data talks with input And output devices

  12. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • The CPU • Executes programs In main memory • Contains Registries Holding data • Four-Step cycle to Execute program

  13. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • The Four Step Cycle • Fetch next instruction • Decode the instruction • Read operand in main memory if any • Execute instruction and store results, if any.

  14. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • The registers • Positions in CPU that hold data during calculation • Special Registries: %r0, %sp, %link, %psr, % pc

  15. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • The Arithmetic and Logic Unit • Takes care of calculations that need to be executed • Fed instructions by the Control Unit

  16. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • Some Features of the ISA: • All of the instructions in the Instruction Set are 32 bit • ARC is load-store: all operands must be either loaded to use or stored in memory to be stored • ARC is two’s compliment

  17. Discuss three main parts of ARC: • RAM • Processor (CPU) • Instruction Set • Three different classes of instructions: • Arithmetic and Logic • Memory Access • Transfer of Control

  18. Three different classes of instructions: • Arithmetic and Logic • Memory Access • Transfer of Control • Arithmetic and Logic • Includes instructions like Add and Subtract • Also includes instructions like AND, OR and NOT.

  19. Three different classes of instructions: • Arithmetic and Logic • Memory Access • Transfer of Control • Memory Access • Includes instructions load and store • Loads into registers and stores into memory slots in RAM

  20. Three different classes of instructions: • Arithmetic and Logic • Memory Access • Transfer of Control • Transfer of Control • Instructions help get to different places in program • Place in ISA where conditionals first are seen (if statement, loops, etc…) • Essentially changes program counter register

  21. The Syntax of the ARC Assembly Language The Mnemonic is a way for the programmer to remember the instruction’s name. A Compiler will take a written assembly language code and convert it to machine code.

  22. What’s that cc after addcc? CC stands for Condition Code and they are set in the PSR (it is a 32 bit registry) There are 4: Z: if the result of the instruction is zero, this flag is set. N: if the most significant bit is 1, this bit is set C: if there is a carry out of the MSB or a borrow into it, this flag is set. V: Overflow. The result cannot be represented in 32 bits.

  23. THE PSR (Processor Status Register)

  24. More on The Syntax of the ARC Assembly Language Brackets [ ] around an operand means to load (or store) from (or in) the memory which is addressed by the operand within the brackets.

  25. A few of the 35 instructions • The ARC ISA has more than 35 instructions. • Memory: ld [%r5 + 2064] , %r1 • Arithmetic: addcc %r1, 129, %r1 • Control: call sub_r

  26. From Assembly Language to Machine Code Each Assembly Language instruction is translated one line for one line (one to one). rd: destination registry Cond: based on the PSR, this executes differently Simm13: a user defined constant in 2’s compliment in 13 bits. Rs1: registry 1 in the CPU Disp30/Disp 22: 30/22 bit number is shifted to the left to achieve 32 bit destination of it’s function.

  27. Summary • Although not explicitly shown, this method will take an upper level program and convert it into actual things the computer can do. • Involves translation from the higher level into assembly language into machine code using the ARC ISA.

More Related