1 / 23

Welcome to My Presentation

Welcome to My Presentation. 3.1 : Levels of Programming Languages 3.2 : Assembly Language Instructions 3.3 : Instruction Set Architecture Design. By Tien Phung CS 147 Dr. Sin-Min Lee. 3.1.1 : Language Categories. High-level Languages Assembly Languages Machine Languages.

pierce
Download Presentation

Welcome to My Presentation

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. Welcome to My Presentation 3.1 : Levels of Programming Languages 3.2 : Assembly Language Instructions 3.3 : Instruction Set Architecture Design By Tien Phung CS 147 Dr. Sin-Min Lee

  2. 3.1.1 : Language Categories • High-level Languages • Assembly Languages • Machine Languages

  3. High-Level Languages • Highest level of abstraction • Platform-independent: same program • code can be converted and run on • computer with different • microprocessors and operating • system without modification. • C ++, Java, Fortran

  4. Assembly Languages • Lower level of abstraction. • Not platform-independent. • Backward compatible. • Can directly manipulate the data • stored in a microprocessor’s • interval components.

  5. Machine Languages • Contain binary values • Instruction is read and executed • directly by microprocessor. • Platform-specific: each microprocessor • has its own machine language.

  6. High-level Languages • Assembly Languages Compiled Assembled 3.1.2: Compiling and Assembling Programs

  7. Compilation process for HLL High-level language program (C++, Fortran, etc.) Compiler for G4 Power Mac Computer Compiler for SPARC UNIX workstation Compiler for Pentium Windows PC Other Pentium object files Other G4 object files Other SPARC object files Pentium object code G4 object code SPARC object code Pentium linker G4 linker SPARC linker Pentium executable file G4 executable file SPARC Executable file Windows Pentium PC G4 Power Mac SPARC UNIX workstation

  8. Assembly Language Program for processor X Process for assembly language programs. Assembler for processor X Processor X object code Other processor X object file Process X linker Processor X executable file Computer with processor X

  9. 3.2.1: Assembly Language Instruction Types • Data Transfer Instructions • Data Operation Instructions • Program Control Instructions

  10. Data Transfer Instructions • Do not modify data, only copy value • to its destination. • Main operation: move data from one place to another • * Load data from memory into microprocessor. • * Store data from microprocessor into memory. • * Move data within the microprocessor. • * Input data to the microprocessor. • * Output data from the microprocessor.

  11. Data Operation Instructions • Modify their data value • Arithmetic instructions: add, subtract, • multiply and divide. • Logic instruction: AND, OR, XOR, or • complement a single value. • Shift instruction: shift the bits of data • value to either left or right.

  12. Program Control Instructions • Use jump or branch to go to another • part of the program. (jr $ra) • Conditional calls and returns • bne $t0, $t1, endloop • Software and hardware interrupts • Exception or traps • Half-instruction: stop executing instruction

  13. Unsigned 0 to 2n - 1 < • Integer Signed -2 n-1 to 2 n-1 - 1 • Floating Point • Boolean True = non-zero < False = zero 3.2.2: Common Data Types • Characters: • * Stored as binary values • * Encoded using ASCII, EBCDIC, UNICODE.

  14. 3.2.3: Addressing Modes • Direct Mode • Indirect Mode • Immediate Mode • Implicit Mode

  15. Direct Mode • 0: LDAC 5 • instruction gets data from location 5 • 5: 10 stores value in CPU • Indirect Mode • 0: LADC @ 5 • instruction gets address from location 5 • 5: 10 • then gets data from location 10 • 10: 20 stores value in CPU

  16. Immediate Mode • 0: LDAC #5 stores value from instruction in CPU • Implicit Mode • 0: LDAC • instruction gets value from stack • stack store value in CPU

  17. 3.2.4: Instruction Format • Instruction code: assembly language • instruction converted to machine • code as binary value (0 and 1) • Opcode needs 4 bits • Operand needs 2 bits • A microprocessor may be designed • to work with instructions that specify • 3, 2, 1 or 0 operands.

  18. 4 bits 2 bits 2 bits 2 bits ADD A,B,C (A=B+C) opcode operand #1 operand #2 operand #3 1010 00 01 10 4 bits 2 bits 2 bits opcode operand #1 operand #2 MOVE A,B (A=B) 1000 00 01 ADD A,C (A=A+C) 1010 00 10 4 bits 2 bits LOAD B (Acc=B) 0000 01 ADD C (Acc=Acc+C) 1010 10 STORE A (A=Acc) 0001 00 opcode operand 4 bits PUSH B (Stack=B) 0101 PUSH C (Stack=C,B) 0110 ADD (Stack=B+C) 1010 POP A (A=Stack) 1100 opcode

  19. Microprocessor With Few Operand Instructions • Need more instructions to accomplish • the same task. • Hardware implement the microprocessor • become less complex as the number • of operand decreases. • Instructions code use fewer bits. • Microprocessor execute instruction more • quickly.

  20. 3.3: Instruction Set Architecture Design • Completeness: Does the instructions set have • all of the instruction a program needs to • perform its required task? • Orthogonality: No overlap or perform the • same function. • Good Instruction Minimize overlap between instructions < Provide programmers necessary functions with less instructions.

  21. Register Set: • Large effect on performance of CPU • CPU retrieve data from its registers • more quickly than from memory. • Speed up program execution.

  22. Concerning Question About ISA Design • Does this processor have to be backward • compatible with other microprocessor? • What types and size of data will the • microprocessor deal with? • Are interrupts needed? • Are conditional instruction needed? • Flag: zero, carry, sign

  23. THANK YOU.

More Related