Presentation is loading. Please wait.

Presentation is loading. Please wait.

ACOE301: Computer Architecture II Labs

Similar presentations


Presentation on theme: "ACOE301: Computer Architecture II Labs"— 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

4

5 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 a Program watch the contents of the registers change as each instruction executes look at the contents of memory as the instructions execute set breakpoints programming mistakes do not cause the machine running the simulation to crash Disadvantage: Slow

6 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)

7 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

8 Additional Reasons for Learning Assembly Language
Understand the microprocessor architecture Understand the hardware/software interface

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

10 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

11


Download ppt "ACOE301: Computer Architecture II Labs"

Similar presentations


Ads by Google