1 / 11

Exploring MIPS Assembly Language through Practical Labs

This course focuses on MIPS Assembly programming, providing hands-on experience in computer architecture through weekly lab sessions. Students will utilize the SPIM MIPS emulator to write, debug, and execute assembly programs. The labs take place in Room 12, where participants will submit lab papers that include source code and answers to questions via an e-learning page. This immersive experience helps deepen understanding of microprocessor architecture and the hardware/software interface, while reinforcing key programming concepts.

vicki
Télécharger la présentation

Exploring MIPS Assembly Language through Practical Labs

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. ACOE301: Computer Architecture II Labs

  2. Lab conduct • Time: 1 period/week • Location: Room 12 • Material: MIPS Assembly • Equipment: SPIM MIPS emulator, PC • Deliverables: Lab papers with source code and answers to questions • Deliverable submission mode: e-learning page

  3. SPIM • a self-contained simulator that runs MIPS32 programs • reads and executes assembly language programs • provides a simple debugger and minimal set of operating system services • does not execute binary (compiled) programs. • Latest version is QTSPIM http://spimsimulator.sourceforge.net/

  4. Advantages of using a Simulator • You can learn the language without having to buy a MIPS-based computer • The simulator provides debugging features • single stepping through aProgram • watch the contents of the registers change as each instruction executes • look at the contents of memory as the instructions execute • setbreakpoints • programming mistakesdo not cause themachine running the simulation to crash • Disadvantage: Slow

  5. Assembly language • One-to-one relationship with machine language unlike high-level languages • Many lines of code even for simple programmes • Requires at least some knowledge of the microprocessor architecture, memory structure and operating system • Not portable (source files will not run on a different architecture microprocessor)

  6. Why use Assembly Language • Traditionally, more efficient use of the main memory • Less memory required • Programs execute faster • Traditionally, avoid redundant instructions inserted by compilers. • Direct access to the hardware of the computer, • Usually not supported or even prevented by compilers. • Access to the microprocessor’s internal control registers. • Embedded systems have tight constraints on performance, memory size and power consumption

  7. Additional Reasons for Learning Assembly Language • Understand the microprocessor architecture • Understand the hardware/software interface

  8. Typical Assembly Language Instruction LOOP:add$3, $3, $2 ;$3<-$3+$2 Label (optional) Opcode Destination operand Source operand(s) Comment (optional)

  9. Assembler Directives • Directives are instructions given by the programmer to the assembler on how to assemble the program. • Directives are not part of the instruction set of the microprocessor. • The use of directives might vary from assembler to assembler. • Some MIPS assembler directives: • .data declares a data memory segment where you can declare ‘variables’ • .text declares a code memory segment where a program is stored • .word declares word size (32-bit) variables or constants • .byte declares byte size (8-bit) variables or constants • .ascii declares a non null-terminated ascii string • .asciiz declares a null-terminated ascii string

More Related