MIPS Assembly.

Slides:



Advertisements
Similar presentations
Lecture 13: 10/8/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Advertisements

Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
MIPS assembly. Review  Lat lecture, we learnt  addi,  and, andi, or, ori, xor, xori, nor,  beq, j, bne  An array is stored sequentially in the memory.
Program Memory MIPS memory operations Getting Variable Addresses Advanced structures.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
MIPS processor continued. Review Different parts in the processor should be connected appropriately to be able to carry out the functions. Connections.
Chapter 2 — Instructions: Language of the Computer — 1 Branching Far Away If branch target is too far to encode with 16-bit offset, assembler rewrites.
SPIM and MIPS programming
MIPS Coding. Exercise – the bubble sort 5/8/2015week04-3.ppt2.
Instructions Set Bo Cheng Instruction Set Design An Instruction Set provides a functional description of a processor. It is the visible.
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
MIPS Instruction Set Advantages
Quiz (Representative of what might appear on a test, see posted sample tests.) Instruction formats and addressing modes.
MIPS assembly. Computer What’s in a computer? Processor, memory, I/O devices (keyboard, mouse, LCD, video camera, speaker), disk, CD drive, …
X86 Assembly Language Same Assembly Language for 8086,80286,80386,80486,Pentium I II and III Newer Processors add a few instructions but include all instructions.
Registers and MAL Lecture 12. The MAL Architecture MAL is a load/store architecture. MAL supports only those addressing modes supported by the MIPS RISC.
Lecture 4: MIPS Instruction Set Reminders: –Homework #1 posted: due next Wed. –Midterm #1 scheduled Friday September 26 th, 2014 Location: TODD 430 –Midterm.
Computer Organization – Memory Access David Monismith Jan. 30, 2015 Based upon notes by Dr. Bill Siever and the Patterson and Hennessy Text.
Computer Organization and Architecture Instructions: Language of the Machine Hennessy Patterson 2/E chapter 3. Notes are available with photocopier 24.
Computer Architecture CSE 3322 Lecture 2 NO CLASS MON Sept 1 Course WEB SITE crystal.uta.edu/~jpatters.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
Computer Architecture CSE 3322 Lecture 3 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/3/09 Read 2.8.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
Arrays in MIPS Assembly Computer Organization and Assembly Language: Module 6.
Computer Organization Instructions Language of The Computer (MIPS) 2.
MIPS Processor.
CHAPTER 2 Instruction Set Architecture 3/21/
MIPS Assembly Language Programming
Memory Access Instructions
MIPS Instruction Set Advantages
CS2100 Computer Organisation
Instruction Set Architecture
Morgan Kaufmann Publishers
MIPS Coding Continued.
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Assembly Programming using MIPS R3000 CPU
MIPS Assembly.
CS170 Computer Organization and Architecture I
MIPS processor continued
MIPS coding.
CSCI206 - Computer Organization & Programming
MISP Assembly.
The University of Adelaide, School of Computer Science
MIPS assembly.
Solutions Chapter 2.
MIPS assembly.
MIPS Processor.
MIPS Instruction Encoding
MIPS processor continued
MIPS Instruction Encoding
MIPS Functions.
MIPS coding.
MIPS Coding.
MIPS Assembly.
MIPS Microarchitecture Multicycle Processor
MIPS function continued
CS334: Memory _ Mars simulator Lab 4(part2-2)
MIPS Coding.
COMS 361 Computer Organization
COMS 361 Computer Organization
COMS 361 Computer Organization
Assembly Programming using MIPS R3000 CPU
MIPS Assembly.
MIPS Coding Continued.
MIPS coding.
MIPS assembly.
MIPS assembly.
9/27: Lecture Topics Memory Data transfer instructions
MIPS Processor.
MIPS instructions.
Presentation transcript:

MIPS Assembly

Questions Is it correct to write this instruction? add $s0, $s1, $s2, $s3 No. Can only take two for add, produce one

Questions Is it correct to write this instruction? add $s0, $s0, $s0 Yes

Questions How to use only one instruction to set $t0 to 0? Add $t0, $0, $0

Questions Is it correct to write this instruction? lw $s0, 100($s0) Yes

Questions Is it correct to write this instruction? lw $s0, $s1($s0) No. The number must be a constant

Questions Is it correct to write this instruction? add $s0, 100($s1), $s2 No. The two numbers to be added must be registers, not from memory

Questions Suppose memory at address 1000 to 1028 are storing 1,2,…,8 (in each 4 bytes). Suppose $t0 is 1000. What will be in $t0 after this instruction? lw $t0, 16($t0) 5

Exercise Suppose we have the address of A[i] in $t0, where A is an integer array. Write instructions to swap A[i] and A[i+1]. lw $t1, 0(t0) lw $t2, 4(t0) sw $t2, 0(t0) sw $t1, 4(t0)

Processor Memory Address t1 100 Assume the values are 100 and 101 100 t0 t2 xxxxxxxxxx 101 t0+4 lw $t1, 0(t0) lw $t2, 4(t0) sw $t2, 0(t0) sw $t1, 4(t0) t1 100 100 t0 t2 101 101 t0+4 t1 100 101 t0 t2 101 101 t0+4 t1 100 101 t0 t2 101 100 t0+4