Computer Organization and Architecture I José Nelson Amaral

Slides:



Advertisements
Similar presentations
Lecture 9: MIPS Instruction Set
Advertisements

Instructor: Tor Aamodt
ECE 232 L6.Assemb.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 6 MIPS Assembly.
Systems Architecture Lecture 5: MIPS Instruction Set
MIPS Assembly Language Programming
Wannabe Lecturer Alexandre Joly inst.eecs.berkeley.edu/~cs61c-te
Faculty of Computer Science © 2006 CMPUT 229 Why Computer Architecture? An Introduction to CMPUT 229.
1 COMS 361 Computer Organization Title: Instructions Date: 9/28/2004 Lecture Number: 10.
Lecture 8: MIPS Instruction Set
1-1 Welcome to: CSC225 Introduction to Computer Organization Paul Hatalsky.
Slide 1 Instructor: Dr. Hong Jiang Cse.unl.edu/~jiang/cse Department of Computer Science & Engineering University of Nebraska-Lincoln.
Spring 2008, Jan. 14 ELEC / Lecture 2 1 ELEC / Computer Architecture and Design Spring 2007 Introduction Vishwani D. Agrawal.
PC hardware and x86 3/3/08 Frans Kaashoek MIT
CMPUT Computer Organization and Architecture I1 CMPUT229 - Fall 2006 Computer Organization and Architecture I Li-Yan Yuan.
CS 300 – Lecture 11 Intro to Computer Architecture / Assembly Language Quiz Wrapup Strings and Characters and More.
Computer Organization: Introduction Spring 2006 Jen-Chang Liu ( )
1 Homework Reading –PAL, pp , Machine Projects –Finish mp2warmup Questions? –Start mp2 as soon as possible Labs –Continue labs with your.
Vacuum tubes Transistor 1948 –Smaller, Cheaper, Less heat dissipation, Made from Silicon (Sand) –Invented at Bell Labs –Shockley, Brittain, Bardeen ICs.
Faculty of Computer Science © 2006 CMPUT 229 Why Computer Architecture? An Introduction to CMPUT 229.
Slide 1 Instructor: Dr. Hong Jiang Teaching Assistants: Hailong Cai & Zhimin Wang Department of Computer Science & Engineering University of Nebraska-Lincoln.
X86 ISA Compiler Baojian Hua Front End source code abstract syntax tree lexical analyzer parser tokens IR semantic analyzer.
ECE200 – Computer Organization Course Introduction.
Slide 1 Instructor: Dr. Hong Jiang Teaching Assistant: Mr. Sheng Zhang Department of Computer Science & Engineering University of Nebraska-Lincoln Classroom:
Lecture 7: Instruction Set Architecture CSE 30: Computer Organization and Systems Programming Winter 2014 Diba Mirza Dept. of Computer Science and Engineering.
CENG311 Computer Architecture Kayhan Erciyes. CS231 Assembly language and Digital Circuits Instructor:Kayhan Erciyes Office:
1 CS/COE0447 Computer Organization & Assembly Language Pre-Chapter 2.
Introduction Course Overview and Basic understanding of Computer Architecture.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
Winter 2015 COMP 2130 Introduction to Computer Systems Computing Science Thompson Rivers University Introduction and Overview.
Natawut NupairojAssembly Language1 Introduction to Assembly Programming.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1-1 Welcome to: CSC225 Introduction to Computer Organization.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Fall 2015, Aug 17 ELEC / Lecture 1 1 ELEC / Computer Architecture and Design Fall 2015 Introduction Vishwani D. Agrawal.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Computer Organization and Architecture II José Nelson Amaral.
CS355 Advanced Computer Architecture Fatima Khan Prince Sultan University, College for Women.
Spr 2015, Feb 9... ELEC / Lecture 4 1 ELEC / Computer Architecture and Design Spring 2015 Compiling and Executing Programs.
(1) ECE 3056: Architecture, Concurrency and Energy in Computation Lecture Notes by MKP and Sudhakar Yalamanchili Sudhakar Yalamanchili (Some small modifications.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Computer Architecture Mehran Rezaei
1 Compilers Modern Compiler Design Supplementary Note 2 SPIM Overview NCYU C. H. Wang.
CS35101 Computer Architecture Spring 2006 Week 1 Slides adapted from: Mary Jane Irwin ( Course url:
April 23, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Assemblers, Linkers, and Loaders * Jeremy R. Johnson Mon. April 23,
Derived from "x86 Assembly Registers and the Stack" by Rodney BeedeRodney Beede x86 Assembly Registers and the Stack Nov 2009.
ELEC Digital Logic Circuits Fall 2015 Introduction
CWRU EECS 3141 Computer designers must be experienced: in both hardware and software co-design, as well as in embedded applications, be familiar with optimization.
 1998 Morgan Kaufmann Publishers MIPS arithmetic All instructions have 3 operands Operand order is fixed (destination first) Example: C code: A = B +
CMPUT Computer Organization and Architecture I1 CMPUT229 - Fall 2003 Topic5: Linking José Nelson Amaral.
Spring 2016, Jan 13 ELEC / Lecture 1 1 ELEC / Computer Architecture and Design Spring 2016 Introduction Vishwani D. Agrawal.
CMPUT Computer Organization and Architecture I1 CMPUT229 - Fall 2003 Topic4: Procedures José Nelson Amaral.
May 2, 2001System Architecture I1 Systems Architecture I (CS ) Lecture 11: Arithmetic for Computers * Jeremy R. Johnson May 2, 2001 *This lecture.
Slide 1 Instructor: Dr. Hong Jiang Teaching Assistant: Ms. Yuanyuan Lu Department of Computer Science & Engineering University of Nebraska-Lincoln Classroom:
CMPUT Computer Systems and Architecture1 CMPUT429/CMPE382 Winter 2001 Computer Systems and Architecture José Nelson Amaral.
CMPUT Computer Organization and Architecture I1 CMPUT229 - Fall 2003 Topic3: Instructions, The Language of the Machine José Nelson Amaral.
Assembly language.
Introduction to Lab #1 José Nelson Amaral.
ACOE301: Computer Architecture II Labs
CS170 Computer Organization and Architecture I
Instructions - Type and Format
Systems Architecture Lecture 5: MIPS Instruction Set
T Computer Architecture, Autumn 2005
Assembly Language Programming II: C Compiler Calling Sequences
COMS 361 Computer Organization
January 16 The books are here. Assignment 1 now due Thursday 18 Jan.
Lecture 1 Class Overview
ELEC / Computer Architecture and Design Fall 2014 Introduction
Computer Architecture and System Programming Laboratory
Topic 2b ISA Support for High-Level Languages
Presentation transcript:

Computer Organization and Architecture I José Nelson Amaral CMPUT229 - Fall 2003 Computer Organization and Architecture I José Nelson Amaral CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I In Your Course Package Hennessy, John L., Patterson, David A., Computer Organization and Design: The Hardware/Software Interface, Morgan Kaufmann Pub., San Mateo, CA. (H&P) Hennessy, John L., Patterson, David A., Computer Organization and Design: The Hardware/Software Interface, Morgan Kaufmann Pub., San Mateo, CA. (H&P) Patt, Yale N., and Patel, Sanjay J., Introduction to Computing Systems: from bits & gates to C & Beyond, McGrawHill Press, 2001. (P&P) Patt, Yale N., and Patel, Sanjay J., Introduction to Computing Systems: from bits & gates to C & Beyond, McGrawHill Press, 2001. (P&P) Goodman, James and Miller, Karen, A Programmer’s View of Computer Architecture with Assembly Language Examples from the MIPS RISC Architecure, Oxford University Press, 1993. (G&M) Goodman, James and Miller, Karen, A Programmer’s View of Computer Architecture with Assembly Language Examples from the MIPS RISC Architecure, Oxford University Press, 1993. (G&M) Bryant, Randal E., O’Hallaron, David, Computer Systems: A Programmer’s Perspective, Prentice Hall, 2003. (B&H) Bryant, Randal E., O’Hallaron, David, Computer Systems: A Programmer’s Perspective, Prentice Hall, 2003. (B&H) CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I In Your Course Package Hennessy, John L., Patterson, David A., Computer Organization and Design: The Hardware/Software Interface, Morgan Kaufmann Pub., San Mateo, CA. (H&P) Patt, Yale N., and Patel, Sanjay J., Introduction to Computing Systems: from bits & gates to C & Beyond, McGrawHill Press, 2001. (P&P) Goodman, James and Miller, Karen, A Programmer’s View of Computer Architecture with Assembly Language Examples from the MIPS RISC Architecure, Oxford University Press, 1993. (G&M) Bryant, Randal E., O’Hallaron, David, Computer Systems: A Programmer’s Perspective, Prentice Hall, 2003. (B&H) CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I Your Course Package Source Pages Topic P&H A.1-A.78 MIPS Assembly Reference P&P 1-16 Introduction P&P 17-45 Number Representation P&P 47-74 Digital Logic P&P 75-78 Von Neumann Architecture H&P 104-206 MIPS instructions H&P 275-301; 322-329 Floating Point G&M 287-306 I/O - polling vs. interrupts G&M 307-338 Interruption Handling P&P 223-239 C Fundamentals P&P 241-279 Variables & Memory Storage B&O 730-764 Dynamic Memory, Heap P&P 365-391 Pointers & Arrays B&O 454-537 Caches & Coding CMPUT 229 - Computer Organization and Architecture I

Additional Optional Reading An excellent reference book for the C Language: Harbison, Samuel P., and Steele Jr., Guy, C: A Reference Manual, Prentice Hall, 4th Edition, 1995. An easy to follow reference to MIPS Assembly: Waldron, J., Introduction to RISC Assembly Language Programming, Addison-Wesley, ISBN 0-201-39828-1. A more recent and complete book on MIPS Assembbly: Britton, Robert L., MIPS Assembly Language Programming, Prentice Hall, Upper Saddle River, NJ, 2004. CMPUT 229 - Computer Organization and Architecture I

2000 1998 1990 1994 1988 1980

CMPUT 229 - Computer Organization and Architecture I Below Your Program High-level language program in C void swap(int v[ ], int k) { int temp; temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; } swap: muli $2, $5, 4 add $2, $4, $2 lw $15, 0($2) lw $16, 4($2) sw $16, 0($2) sw $15, 4($2) jr $31 Compiler Assembly language program (for MIPS) 00000000101000010000000000011000 00000000100011100001100000100001 10001100011000100000000000000000 10001100111100100000000000000100 10101100111100100000000000000000 10101100011000100000000000000100 00000011111000000000000000001000 Assembler Binary machine language program (for MIPS) Henn-Pat, pp. 7 CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I Trying it out #include <stdio.h> void swap(int v[ ], int k); void print_vector(int v[ ]); int main(int argc, char *argv[ ]) { int v[]={1,3,5,7,9,-1}; print_vector(v); swap(v,2); } void swap(int v[], int k) { int temp; temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; } void print_vector(int v[]) int i; for(i=0 ; v[i]>0 ; i++) printf("\t%d ",v[i]); printf("\n"); CMPUT 229 - Computer Organization and Architecture I

$ gcc -S swap.c [on a MIPS R12K machine] swap: # vars= 8, regs= 2/0, args= 0, extra= 8 .frame $fp,24,$31 .mask 0x50000000,-4 .fmask 0x00000000,0 .set noreorder .cpload $25 .set reorder subu $sp,$sp,24 .cprestore 0 sw $fp,20($sp) sw $28,16($sp) move $fp,$sp sw $4,24($fp) sw $5,28($fp) lw $2,28($fp) move $3,$2 sll $2,$3,2 lw $3,24($fp) addu $2,$2,$3 lw $3,0($2) sw $3,8($fp) lw $3,28($fp) move $4,$3 sll $3,$4,2 lw $4,24($fp) addu $3,$3,$4 addu $4,$3,4 # page 1 lw $3,0($4) sw $3,0($2) lw $2,28($fp) move $3,$2 sll $2,$3,2 lw $3,24($fp) addu $2,$2,$3 addu $3,$2,4 lw $2,8($fp) sw $2,0($3) # page 2

$ gcc -O3 -S swap.c [on a MIPS R12K machine] swap: # vars= 0, regs= 0/0, args= 0, extra= 0 .frame $sp,0,$31 .mask 0x00000000,0 .fmask 0x00000000,0 .set noreorder .cpload $25 .set reorder sll $5,$5,2 addu $5,$5,$4 lw $2,4($5) lw $3,0($5) sw $2,0($5) .set nomacro j $31 sw $3,4($5) .set macro .end swap .rdata .align 2

[on a Pentium III machine] $ gcc -S swap.c [on a Pentium III machine] swap: pushl %ebp movl %esp, %ebp subl $4, %esp movl 12(%ebp), %eax imull $4, %eax, %edx movl 8(%ebp), %eax movl (%eax,%edx), %eax movl %eax, -4(%ebp) imull $4, %eax, %ecx movl 8(%ebp), %edx imull $4, %eax, %eax addl 8(%ebp), %eax addl $4, %eax movl (%eax), %eax movl %eax, (%edx,%ecx) leal 4(%eax), %edx movl -4(%ebp), %eax movl %eax, (%edx) leave ret $ gcc -O3 -S swap.c [on a Pentium III machine] swap: pushl %ebp movl %esp, %ebp movl 8(%ebp), %edx pushl %ebx movl 12(%ebp), %eax movl (%edx,%eax,4), %ebx movl 4(%edx,%eax,4), %ecx movl %ecx, (%edx,%eax,4) movl %ebx, 4(%edx,%eax,4) movl (%esp), %ebx leave ret

[on an Itanium I machine] swap: .prologue 2, 2 .vframe r2 mov r2 = r12 ;; .body st8 [r2] = r32 mov r14 = r2 ;; adds r14 = 8, r2 ;; st4 [r14] = r33 mov r14 = r2 adds r16 = 12, r2 ;; ld4 r14 = [r14] ;; sxt4 r15 = r14 addl r14 = 4, r0 ;; setf.sig f6 = r15 setf.sig f7 = r14 ;; xma.l f6 = f6, f7, f0 ;; getf.sig r15 = f6 ld8 r14 = [r2] ;; add r14 = r15, r14 ;; st4 [r16] = r14 add r16 = r15, r14 mov r14 = r2 ;; #page 1 $ gcc -S swap.c [on an Itanium I machine] ld4 r14 = [r14] ;; sxt4 r15 = r14 addl r14 = 4, r0 ;; setf.sig f6 = r15 setf.sig f7 = r14 ;; xma.l f6 = f6, f7, f0 ;; getf.sig r15 = f6 ld8 r14 = [r2] ;; add r14 = r15, r14 ;; adds r14 = 4, r14 ;; st4 [r16] = r14 mov r14 = r2 ;; adds r14 = 8, r2 ;; adds r15 = 4, r14 adds r14 = 12, r2 ;; st4 [r15] = r14 .restore sp mov r12 = r2 br.ret.sptk.many b0 .endp swap# .section .rodata .align 8 # page 2

[on an Itanium I machine] $ gcc -O3 -S swap.c [on an Itanium I machine] swap: .prologue .body sxt4 r33 = r33 ;; shladd r33 = r33, 2, r32 ;; mov r14 = r33 ;; ld4 r16 = [r14], 4 ;; ld4 r15 = [r14] ;; st4 [r33] = r15 st4 [r14] = r16 br.ret.sptk.many b0 .endp swap#

CMPUT 229 - Computer Organization and Architecture I Admin. Information Instructor: Prof. José Nelson Amaral Office: Athabasca 3-42 Phone: 492-5411 email: amaral@cs.ualberta.ca Office Hours: Wednesday 10:00-11:00 Wednesday 1:00-2:00 (Open Door Policy --- check published schedule) http://www.cs.ualberta.ca/~amaral/courses/329 http://ugweb.cs.ualberta.ca/~c229 CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I Important Dates September 15 (Monday) : lab classes start this week TBA : mid-term exam December 03 (Wednesday) : last day of classes December 10 (Wednesday) : final for section A1 (9 AM class) Course work will carry the following weights towards your final grade: Lab. Assignments(using try): 27% Midterm Exam: 35% Final Exam: 38% Homeworks: Zero CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I Honor Code By turning the solution of the homework for grading, I certify that I have worked all the solutions on my own, that I have not copied or transcribed solutions from a classmate, someone outside the class, or from any other source. I also certify that I have not facilitated or allowed any of my classmates to copy my own solutions. I am aware that students are encouraged to discuss the material covered in the class and to work examples together. However, the joint solution of problems assigned as individual homework exercises is not allowed. I am aware that the violation of this honor code constitutes a breach of the trust granted me by the teaching staff, compromises my reputation, and subjects me to the penalties prescribed in Section 26.1 of the University of Alberta 2001/2002 Calendar. CMPUT 229 - Computer Organization and Architecture I

Some Sad Statistics in Computing Science 21 cases of plagiarism in the 2000/2001 Academic Year: 29 cases of plagiarism in the 2002/2003 Academic Year. CMPUT 229 - Computer Organization and Architecture I

Late Submission Policy For Labs: There is no late submission for labs! All deadlines are “drop-dead deadlines”! Deferred exams will be scheduled for early January, and will be different from the final given on the scheduled date. CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I Did I mention? NO Late Submissions!!!! None. At all. CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I Reading Assignment Hennessy Patterson Texbook: Appendix A: Sections A.1 to A.4 and A.9 CMPUT 229 - Computer Organization and Architecture I

Machine Organization CPU Interrupt Controler 256-KB L2 Bus interface P-Pro bus (64-bit data, 36 bit address, 66 MHz) PCI Bridge I/O Cards PCI Bus PCI Bridge I/O Cards PCI Bus Memory Controller Memory Interleave Unit 1-, 2-, 4-way Interleaved DRAM CMPUT 229 - Computer Organization and Architecture I (See CullerSinghGupta, pp. 32)

Example of SMP machine: Pentium “quad pack” CPU Interrupt Controler 256-KB L2 Bus interface CPU Interrupt Controler 256-KB L2 Bus interface CPU Interrupt Controler 256-KB L2 Bus interface CPU Interrupt Controler 256-KB L2 Bus interface P-Pro bus (64-bit data, 36 bit address, 66 MHz) PCI Bridge I/O Cards PCI Bus PCI Bridge I/O Cards PCI Bus Memory Controller Memory Interleave Unit 1-, 2-, 4-way Interleaved DRAM CMPUT 229 - Computer Organization and Architecture I (See CullerSinghGupta, pp. 32)

Converting Source into Executable Files COPYRIGHT 1998 MORGAN KAUFMANN PUBLISHERS, INC. ALL RIGHTS RESERVED Henn-Pat, pp. A-4 CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I A More Complete Story Program library Source file Compiler Assembler file Object file Assembler Linker Source file Compiler Assembler Object Executable file Program library CMPUT 229 - Computer Organization and Architecture I

Converting Source into Executable Files COPYRIGHT 1998 MORGAN KAUFMANN PUBLISHERS, INC. ALL RIGHTS RESERVED Henn-Pat, pp. A-8 CMPUT 229 - Computer Organization and Architecture I

The Linker Henn-Pat, pp. A-18 COPYRIGHT 1998 MORGAN KAUFMANN PUBLISHERS, INC. ALL RIGHTS RESERVED Henn-Pat, pp. A-18 CMPUT 229 - Computer Organization and Architecture I

When to use Assembly Language? When you don’t have the tools to program in higher level: new embedded processors compilers that check deadlines for real time system do not exist yet When the tools fail: Compilers still generate sub-optimal code When you are building the tools: Compiler designer/builders must know assembly well CMPUT 229 - Computer Organization and Architecture I

Anatomy of an Object File References that must change if the program is moved in memory. Compilation information to allow mapping of addresses to source code. Machine Code Size and position of other pieces. Binary Data Representation. Associate addresses with external label. Unresolved references. COPYRIGHT 1998 MORGAN KAUFMANN PUBLISHERS, INC. ALL RIGHTS RESERVED Henn-Pat, pp. A-13 CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I Assembler Features Data Layout Directives string directives Macros Pseudo Instructions Conditional Assembling Henn-Pat, pp. A-14/A-17 CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I SPIM SPIM is a software simulator that runs programs written for MIPS R2000/R3000 processors. - available - self-contained - has a debugger - provides limited operating system-like services - at least 100 slower than hardware - implements pseudoinstructions - virtual machine: simulates non-delayed branches Features: Henn-Pat, pp. A-38/A-39 CMPUT 229 - Computer Organization and Architecture I

This is where SPIM error messages appear. CMPUT 229 - Computer Organization and Architecture I Pat-Hen. pp. A-41/A-47 COPYRIGHT 1998 MORGAN KAUFMANN PUBLISHERS, INC. ALL RIGHTS RESERVED

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

Register Usage Convention Patt-Hen., pp. A-23 CMPUT 229 - Computer Organization and Architecture I

CMPUT 229 - Computer Organization and Architecture I Assembler Syntax comments begin with a sharp sign (#) and run to the end of the line. identifiers are alphanumeric sequences, underbars (_), and dots (.) that do not begin with a number. labels are identifiers placed at the beginning of a line, and followed by a colon. .data item: .word 1 .text .globl main main: lw $s3, item Loop: add $t1, $s3, $s3 # $t1  2 * i add $t1, $t1, $t1 # $t1  4 * i add $t1, $t1, $s6 # $t1  Addr(save[i]) lw $t0, 0($t1) # $t0  MEM[save[i]] bne $t0, $s5, Exit # if save[I]  k goto Exit add $s3, $s3, $s4 # i  i + j j Loop # goto Loop Exit:: CMPUT 229 - Computer Organization and Architecture I Pat-Hen. pp. A-51

CMPUT 229 - Computer Organization and Architecture I Assembler Directives .data identifies the beginning of the data segment (in this example this segment contains a single word). .word 1 stores the decimal number 1 in 32-bits (4 bytes) .text identifies the beginning of the text segment (where the instructions of the program are stored). .globl main declares the label main global (so that it can be accessed from other files). .data item: .word 1 .text .globl main main: lw $s3, item Loop: add $t1, $s3, $s3 # $t1  2 * i add $t1, $t1, $t1 # $t1  4 * i add $t1, $t1, $s6 # $t1  Addr(save[i]) lw $t0, 0($t1) # $t0  MEM[save[i]] bne $t0, $s5, Exit # if save[I]  k goto Exit add $s3, $s3, $s4 # i  i + j j Loop # goto Loop Exit:: CMPUT 229 - Computer Organization and Architecture I Pat-Hen. pp. A-52

CMPUT 229 - Computer Organization and Architecture I What’s next? Loading Memory Layout But, before we talk about memory layout, we need to talk about number representation. CMPUT 229 - Computer Organization and Architecture I