1 / 10

The MIPS Processor

The MIPS Processor. Appendix A. Assembly Language. Symbolic representation of a computer's machine language. more readable than machine language each processor has its own assembly language no two assembly languages are the same. Why Use Assembly Language. Primary reason:

aldan
Download Presentation

The MIPS Processor

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 MIPS Processor Appendix A

  2. Assembly Language • Symbolic representation of a computer's machine language. • more readable than machine language • each processor has its own assembly language • no two assembly languages are the same.

  3. Why Use Assembly Language • Primary reason: • for speed or size of a critical application • compiler may not produce the best instructions • have better control over which instructions are used • Example: • embedded systems or devices

  4. Drawbacks of Assembly Language • Are not widely used by everyday programmers • programs are machine dependent • programs are longer than those in a high-level language • programs have no structure; hard to read

  5. The Assembler • Translates assembly language instructions into machine language instructions

  6. Translation • Symbols can be used before they are defined. • A two step translation is required: • resolve labels (find memory locations) • translate assembly instructions

  7. Sample Program # # Prints all primes in the numbers 1 - 100 # .text main: li $t0, 1 WHILE: bgt $t0, 100, WHILE_END move $a0, $t0 jal TEST_PRIME beqz $v0, INC1 la $a0, Message move $a1, $t0, jal PRINTF INC1: addi $t0, $t0, 1 j WHILE WHILE_END: li $v0, 10 syscall ################################### .data Message: .asciiz "This number is prime: " NEWLINE: .asciiz "\n"

  8. Object File • object code - machine instructions, data, and bookkeeping info. • can not be executed directly • it may refer to routines in other object files • Six distinct sections on Unix systems:

  9. The Linker • linker - combines a collection of object files into an executable file. • programs can be split into smaller pieces (files) • each file contains logically related routines and data

  10. The Loader • loader - used to load a program into memory • sets the registers • initializes the program counter • For the MIPS processor:

More Related