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r "f     8-/!.R?_)   4(3 mJ v-   )p 60>!.+/ N] 7"f5 04vD6mC@0d:(W   +xK7 $ %"!L1O 6C#"L <6@Ek7}(      O$$$b$ 2#]u8ŴY 0AA fff@8PTʚ;ʚ;g4ddddPD  0rppp@ <4dddd@w 0tHDD  0___PPT10 ''b___PPT9D<`?  %O  =}iX"MIPS Assembly Language Programming #",COE 308 Computer Architecture Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum and MineralsB4Z-0Zd/Z ,\Presentation OutlineAssembly Language Statements Assembly Language Program Template Defining Data Memory Alignment and Byte Ordering System Calls Procedures Parameter Passing and the Runtime Stack  FAssembly Language StatementsThree types of statements in assembly language Typically, one statement should appear on a line Executable Instructions Generate machine code for the processor to execute at runtime Instructions tell the processor what to do Pseudo-Instructions and Macros Translated by the assembler into real instructions Simplify the programmer task Assembler Directives Provide information to the assembler while translating a program Used to define segments, allocate memory variables, etc. Non-executable: directives are not part of the instruction set/ 1  vi  vQ  v /1i Q InstructionsAssembly language instructions have the format: [label:] mnemonic [operands] [#comment] Label: (optional) Marks the address of a memory location, must have a colon Typically appear in data and text segments Mnemonic Identifies the operation (e.g. add, sub, etc.) Operands Specify the data required by the operation Operands can be registers, memory variables, or constants Most instructions have three operands L1: addiu $t0, $t0, 1 #increment $t0h0 0  f  /   & 0gf.gg9,  aa  $a$%$g$CommentsComments are very important! Explain the program's purpose When it was written, revised, and by whom Explain data used in the program, input, and output Explain instruction sequences and algorithms used Comments are also required at the beginning of every procedure Indicate input parameters and results of a procedure Describe what the procedure does Single-line comment Begins with a hash symbol # and terminates at end of line F FV F F: FV a Next . . .Assembly Language Statements Assembly Language Program Template Defining Data Memory Alignment and Byte Ordering System Calls Procedures Parameter Passing and the Runtime Stack ( F#rProgram Template# Title: Filename: # Author: Date: # Description: # Input: # Output: ################# Data segment ##################### .data . . . ################# Code segment ##################### .text .globl main main: # main program entry . . . li $v0, 10 # Exit program syscall   c>(!.DATA, .TEXT, & .GLOBL Directives.DATA directive Defines the data segment of a program containing data The program's variables should be defined under this directive Assembler will allocate and initialize the storage of variables .TEXT directive Defines the code segment of a program containing instructions .GLOBL directive Declares a symbol as global Global symbols can be referenced from other files We use this directive to declare main procedure of a program < < <> < < <    &    S    Layout of a Program in Memory  Next . . .Assembly Language Statements Assembly Language Program Template Defining Data Memory Alignment and Byte Ordering System Calls Procedures Parameter Passing and the Runtime Stack ( F@dData Definition StatementSets aside storage in memory for a variable May optionally assign a name (label) to the data Syntax: [name:] directive initializer [, initializer] . . . var1: .WORD 10 All initializers become binary data in memorye 29 2 2. 2e  3 3 3.Data Directiveso.BYTE Directive Stores the list of values as 8-bit bytes .HALF Directive Stores the list as 16-bit values aligned on half-word boundary .WORD Directive Stores the list as 32-bit values aligned on a word boundary .FLOAT Directive Stores the listed values as single-precision floating point .DOUBLE Directive Stores the listed values as double-precision floating point 2) 2 2@ 2 2< 2 2< 2 2< 2 ) @ <  <  <String Directives .ASCII Directive Allocates a sequence of bytes for an ASCII string .ASCIIZ Directive Same as .ASCII directive, but adds a NULL char at end of string Strings are null-terminated, as in the C programming language .SPACE Directive Allocates space of n uninitialized bytes in the data segment P2 P P~ P P= P 2 p    ) Examples of Data Definitions !MARS Assembler and Simulator Tool  Next . . .Assembly Language Statements Assembly Language Program Template Defining Data Memory Alignment and Byte Ordering System Calls Procedures Parameter Passing and the Runtime Stack ( FN#AMemory AlignmentMemory is viewed as an array of bytes with addresses Byte Addressing: address points to a byte in memory Words occupy 4 consecutive bytes in memory MIPS instructions and integers occupy 4 bytes Alignment: address is a multiple of size Word address should be a multiple of 4 Least significant 2 bits of address should be 00 Halfword address should be a multiple of 2 .ALIGN n directive Aligns the next data definition on a 2n byte boundaryl5 <4 <+ <. <) <' <1 <+ < <6 <%+.(%   .   )e &Cl Symbol TableAssembler builds a symbol table for labels (variables) Assembler computes the address of each label in data segment Example Symbol Table .DATA var1: .BYTE 1, 2,'Z' str1: .ASCIIZ "My String\n" var2: .WORD 0x12345678 .ALIGN 3 var3: .HALF 10007= 2 2r  = pByte Ordering and Endianness2Processors can order bytes within a word in two ways Little Endian Byte Ordering Memory address = Address of least significant byte Example: Intel IA-32, Alpha Big Endian Byte Ordering Memory address = Address of most significant byte Example: SPARC, PA-RISC MIPS can operate with both byte orderings Q P  K , 5    ,,bd_ Next . . .Assembly Language Statements Assembly Language Program Template Defining Data Memory Alignment and Byte Ordering System Calls Procedures Parameter Passing and the Runtime Stack ( Fq 4 System CallsPrograms do input/output through system calls MIPS provides a special syscall instruction To obtain services from the operating system Many services are provided in the SPIM and MARS simulators Using the syscall system services Load the service number in register $v0 Load argument values, if any, in registers $a0, $a1, etc. Issue the syscall instruction Retrieve return values, if any, from result registersZ <h <" < <Fe h e$+eC >F}CSyscall Services  Reading and Printing an Integer################# Code segment ##################### .text .globl main main: # main program entry li $v0, 5 # Read integer syscall # $v0 = value read move $a0, $v0 # $a0 = value to print li $v0, 1 # Print integer syscall li $v0, 10 # Exit program syscall" 0n c<#<Reading and Printing a Stringz################# Data segment ##################### .data str: .space 10 # array of 10 bytes ################# Code segment ##################### .text .globl main main: # main program entry la $a0, str # $a0 = address of str li $a1, 10 # $a1 = max string length li $v0, 8 # read string syscall li $v0, 4 # Print string str syscall li $v0, 10 # Exit program syscall"{0n{c<]+$ Program 1: Sum of Three Integers# Sum of three integers # # Objective: Computes the sum of three integers. # Input: Requests three numbers. # Output: Outputs the sum. ################### Data segment ################### .data prompt: .asciiz "Please enter three numbers: \n" sum_msg: .asciiz "The sum is: " ################### Code segment ################### .text .globl main main: la $a0,prompt # display prompt string li $v0,4 syscall li $v0,5 # read 1st integer into $t0 syscall move $t0,$v0"0nc&PA,HSum of Three Integers  Slide 2 of 2 li $v0,5 # read 2nd integer into $t1 syscall move $t1,$v0 li $v0,5 # read 3rd integer into $t2 syscall move $t2,$v0 addu $t0,$t0,$t1 # accumulate the sum addu $t0,$t0,$t2 la $a0,sum_msg # write sum message li $v0,4 syscall move $a0,$t0 # output sum li $v0,1 syscall li $v0,10 # exit syscallP0n.0n2"0n.0n20n,0n2 0n!0n2 0n0n20nc,,*@(Program 2: Case Conversion# Objective: Convert lowercase letters to uppercase # Input: Requests a character string from the user. # Output: Prints the input string in uppercase. ################### Data segment ##################### .data name_prompt: .asciiz "Please type your name: " out_msg: .asciiz "Your name in capitals is: " in_name: .space 31 # space for input string ################### Code segment ##################### .text .globl main main: la $a0,name_prompt # print prompt string li $v0,4 syscall la $a0,in_name # read the input string li $a1,31 # at most 30 chars + 1 null char li $v0,8 syscall"0nc cD72<Case Conversion  Slide 2 of 20 la $a0,out_msg # write output message li $v0,4 syscall la $t0,in_name loop: lb $t1,($t0) beqz $t1,exit_loop # if NULL, we are done blt $t1,'a',no_change bgt $t1,'z',no_change addiu $t1,$t1,-32 # convert to uppercase: 'A'-'a'=-32 sb $t1,($t0) no_change: addiu $t0,$t0,1 # increment pointer j loop exit_loop: la $a0,in_name # output converted string li $v0,4 syscall li $v0,10 # exit syscallR40P80n0P0n1c:;0< 8 ?" Next . . .Assembly Language Statements Assembly Language Program Template Defining Data Memory Alignment and Byte Ordering System Calls Procedures Parameter Passing and the Runtime Stack ( F~ ) ProceduresgConsider the following swap procedure (written in C) Translate this procedure to MIPS assembly language&hMCall / Return SequenceSuppose we call procedure swap as: swap(a,10) Pass address of array a and 10 as arguments Call the procedure swap saving return address in $31 = $ra Execute procedure swap Return control to the point of origin (return address).# e  e e- NODetails of JAL and JRAddress Instructions Assembly Language 00400020 lui $1, 0x1001 la $a0, a 00400024 ori $4, $1, 0 00400028 ori $5, $0, 10 ori $a1,$0,10 0040002C jal 0x10000f jal swap 00400030 . . . # return here swap: 0040003C sll $8, $5, 2 sll $t0,$a1,2 00400040 add $8, $8, $4 add $t0,$t0,$a0 00400044 lw $9, 0($8) lw $t1,0($t0) 00400048 lw $10,4($8) lw $t2,4($t0) 0040004C sw $10,0($8) sw $t2,0($t0) 00400050 sw $9, 4($8) sw $t1,4($t0) 00400054 jr $31 jr $ra/ % "   " .c C c  C0cCcgc G  C  G $g$$c$(C(,c,0C00G00C00G0^8"  8 >    Instructions for Procedures Next . . .Assembly Language Statements Assembly Language Program Template Defining Data Memory Alignment and Byte Ordering System Calls Procedures Parameter Passing and the Runtime Stack  F)Parameter PassingParameter passing in assembly language is different More complicated than that used in a high-level language In assembly language Place all required parameters in an accessible storage area Then call the procedure Two types of storage areas used Registers: general-purpose registers are used (register method) Memory: stack is used (stack method) Two common mechanisms of parameter passing Pass-by-value: parameter value is passed Pass-by-reference: address of parameter is passed49U e+[49U / + 4Parameter Passing  cont'dDBy convention, register are used for parameter passing $a0 = $4 .. $a3 = $7 are used for passing arguments $v0 = $2 .. $v1 = $3 are used for result values Additional arguments/results can be placed on the stack Runtime stack is also needed to & Store variables / data structures when they cannot fit in registers Save and restore registers across procedure calls Implement recursion Runtime stack is implemented via software convention The stack pointer $sp = $29 (points to top of stack) The frame pointer $fp = $30 (points to a procedure frame)7dZ5o7eee e Z5  e   e $$$$% Stack FrameStack frame is the segment of the stack containing & Saved arguments, registers, and local data structures (if any) Called also the activation frame or activation record Frames are pushed and popped by adjusting & Stack pointer $sp = $29 and Frame pointer $fp = R30 Decrement $sp to allocate stack frame, and increment to free5?bq *?,   e  e e0 DPreserving RegistersNeed to preserve registers across a procedure call Stack can be used to preserve register values Which registers should be saved? Registers modified by the called procedure, and Still used by the calling procedure Who should preserve the registers? Called Procedure: preferred method for modular code Register preservation is done inside the called procedure By convention, registers $s0, $s1, & , $s7 should be preserved Also, registers $sp, $fp, and $ra should also be preservedJ3 <. <! <T <# <4 <: <y <3.!T#  $ :          %          ,Selection SortExample" Selection Sort Proceduree# Objective: Sort array using selection sort algorithm # Input: $a0 = pointer to first, $a1 = pointer to last # Output: array is sorted in place ########################################################## sort: addiu $sp, $sp, -4 # allocate one word on stack sw $ra, 0($sp) # save return address on stack top: jal max # call max procedure lw $t0, 0($a1) # $t0 = last value sw $t0, 0($v0) # swap last and max values sw $v1, 0($a1) addiu $a1, $a1, -4 # decrement pointer to last bne $a0, $a1, top # more elements to sort lw $ra, 0($sp) # pop return address addiu $sp, $sp, 4 jr $ra # return to caller"f0xfc,-!)+( Max Procedure# Objective: Find the address and value of maximum element # Input: $a0 = pointer to first, $a1 = pointer to last # Output: $v0 = pointer to max, $v1 = value of max ########################################################## max: move $v0, $a0 # max pointer = first pointer lw $v1, 0($v0) # $v1 = first value beq $a0, $a1, ret # if (first == last) return move $t0, $a0 # $t0 = array pointer loop: addi $t0, $t0, 4 # point to next array element lw $t1, 0($t0) # $t1 = value of A[i] ble $t1, $v1, skip # if (A[i] <= max) then skip move $v0, $t0 # found new maximum move $v1, $t1 skip: bne $t0, $a1, loop # loop back if more elements ret: jr $ra "0xc"V,L2 Example of a Recursive Procedureint fact(int n) { if (n<2) return 1; else return (n*fact(n-1)); } fact: slti $t0,$a0,2 # (n<2)? beq $t0,$0,else # if false branch to else li $v0,1 # $v0 = 1 jr $ra # return to caller else: addiu $sp,$sp,-8 # allocate 2 words on stack sw $a0,4($sp) # save argument n sw $ra,0($sp) # save return address addiu $a0,$a0,-1 # argument = n-1 jal fact # call fact(n-1) lw $a0,4($sp) # restore argument lw $ra,0($sp) # restore return address mul $v0,$a0,$v0 # $v0 = n*fact(n-1) addi $sp,$sp,8 # free stack frame jr $ra # return to callerpB  0n<Z0n3n10nBCgD<()# &"/8"Shl   0` 33` Sf3f` 33g` f` www3PP` ZXdbmo` \ғ3y`Ӣ` 3f3ff` 3f3FKf` hk]wwwfܹ` ff>>\`Y{ff` R>&- {p_/̴>?" dd@$?vdd(@#?  n?" dd@   @@``PR    ?  ` p>>   D< (    6PD   ` D  T Click to edit Master title style! !  0YD   `x D  RClick to edit Master text styles Second level Third level Fourth level Fifth level!     S  0 _D " `* 6MIPS Assembly Language Programming COE 308 Computer Architecture  KFUPM Muhamed Mudawar  slide *0e 2Ic c c H  0޽h ? 3380___PPT10.И@r Default Design  0 QI`(    6    `   T Click to edit Master title style! !  0   `b   W#Click to edit Master subtitle style$ $H  0޽h ? 3380___PPT10.88/k& 0 zr  (    0  B  D  P*    0   wB   R*  d  c $ ?qU     0$   K   RClick to edit Master text styles Second level Third level Fourth level Fifth level!     S  6  .    P*    6   w.   R*  H  0rllC ? 3380___PPT10.J F  h((  h h N tt B    \* p88pp h NtI tt  wB   ^* p88pp h TlS tt .    \* p88pp h TN tt  w.   ^* p88ppH h 0rllC ? 3380___PPT10.Jp: 0  06(  0~ 0 s *(  `r   x 0 c $hl  `   H 0 0޽h ? 33___PPT10i.И0+D='  = @B +  0 0T<(  T~ T s *e`  `  `  ~ T s *[`  v > `  H T 0޽h ? f3fy___PPT10Y+D='  = @B +l  0 p l(   x   c $`  `  `      < ` "` `x `  " H   0޽h ? 3380___PPT10.  0 $R(  $~ $ s *03  `  3   $ s *q`  `x 3  " H $ 0޽h ? ̙33  0 H\(  H~ H s *D  `  D   H  <D "`0P D  H H 0޽h ? f3f  0  <(  ~  s * D  H  0޽h ? f3fy___PPT10Y+D='  = @B +  0  Lj(  Lr L S `  `  `   L s *di`  S"  `l `   L| H L 0޽h ? 33___PPT10i.\@r+D='  = @B +  0 PX0(  Xx X c $  `   x X c $h  `   H X 0޽h ? 33___PPT10i.jB+D='  = @B +@  0 WO(  r  S L  `   )8 0 0  T$^ "` A Stack Segment(2  Nd S"`?ny > 0x7FFFFFFF (2   T@h "`  @ Dynamic Area (2   T(l "` "  ? Static Area (2   T@p "`"   @ Text Segment (2    Ts "` b <Reserved (2    T`w "` ,(2   N S"`? n  > 0x04000000 (2    N S"`? nE  > 0x10000000 (2    N} S"`?n 50(2r  BGjJ8!   T S"`?  @ Data Segment (2 rB  BDjJ  rB  BDjJ  rB  BDjJH   T S"`?0v QMemory Addresses in Hexx  Tx S"`?~ - OStack Grows DownwardsxH  0޽h ? 33___PPT10i.d@tr+D='  = @B +  0  <(  ~  s *<  `   ~  s *  v >   H  0޽h ? f3fy___PPT10Y+D='  = @B +  0  p`(  `~ ` s *  `   x ` c $h 0P   ^2 ` 6jJ, ^2 ` 6jJ 2 ` BT& 3jJ d  (H ` 0޽h ? f3fy___PPT10Y+D='  = @B +}  0 `\$(  \r \ S +  `   r \ S ,  `x   H \ 0޽h ? 33___PPT10i.]S@+D='  = @B +}  0 @T$(  Tr T S 4  `   r T S 5 1 `x   H T 0޽h ? 33___PPT10i.\@+D='  = @B +  0 d(  dr d S (;  `    d B< "`0P> O.DATA var1: .BYTE 'A', 'E', 127, -1, '\n' var2: .HALF -10, 0xffff var3: .WORD 0x12345678 var4: .FLOAT 12.3, -0.1 var5: .DOUBLE 1.5e-10 str1: .ASCII "A String\n" str2: .ASCIIZ "NULL Terminated String" array: .SPACE 100 0 2  H d 0޽h ? 33___PPT10i. c+D='  = @B +   0 zr!  (   r  S ē  `    X  0A?  H  0޽h ? 3380___PPT10.s   0  <(  ~  s *O  `   ~  s *pO  v >   H  0޽h ? f3fy___PPT10Y+D='  = @B +*  0L0  5  l(  l" l  f@ xaxaG  ? `l   ~ l s *A  `   %F n'P  l nP  l T 1?(P  l  `C ?"`r (  i0  XF $::W::WWtt l  `o ?"`r; (  i4  XF $::W::WWtt l  `n ?"`r (<  i8  XF $::W::WWtt  l  `t| ?"`n %  l12" XF $::W::WWtt  l  f ?"`o  oaddress  XF $::W::WWtt  l  `$" ?"`( F  s not aligned   F $::W::WWtt  l  `@+ ?"`(P7  m. . .  F$::W::WWtt  l  `X6 3?"`(6 P  t aligned word   F $::W::WWtt l T 1?( <=  l T 1?<= P  l T 1?F P=  l T 1?(= 2  l  `@A ?"`2 P  s not aligned   F $::W::WWtt l  `L ?"`4'P lMemory XD$::W::WWttH l 0޽h ? U>=UU(___PPT10i.L`g+D='  = @B +Q  0 '++:jhD k*(  h h  <0 "`0`     x h c $?3  `  3  Y h H 1S"`? L ,$@ 0 Label var1 str1 var2 var3R(2(((gcs  h H\ 1S"`?L ,$D 0 3Address 0x10010000 0x10010003 0x10010010 0x10010018R(2 ((!(g,cr8  |  h ~ f  h 6 | ZB  h s *DZZ| ZB  h s *D l  "  ^h " ,$D 06@  B  Mh B  ;h Z 1S"`?   >var1(2F Eh # BHCIDE FAHHI@S"  B T B "  Vh#  B "  h Z 1 "`B o  51(2@ h Z 1 "`nB H  52(2@ h Z` 1 "`HB "  7'Z'(2@ h Z 1 S"`?B p  D 0x10010000 (2 a l !D }  _hD !} ,$D 0T !   Ch#  !D B  str1(2FZB ?h s *Dg   @ "B }  Yh"B }  h Z8 f1 "`"B   7'M'(2@ h Zܵ f1 "`B  7'y'(2@ h Z f1 "` B  8' '(2@ h Z f1 "` B  7'S'(2@ h Z f1 "` B b  7't'(2@ h Z f1 "`b B <  7'r'(2@  h Z f1 "`< B   7'i'(2@ !h Z f1 "`B   7'n'(2@ $h Z f1 "`B   7'g'(2@ %h Z f1 "`B   8'\n'(2@ 8h Z f1 "`B }  50(2@l  b ]h b,$@ 0 h Z  1 "`  > 0x12345678 (2 @ )h ZP 1 S"`? p D 0x10010010 (2 aL@ b Thb =h Z 1S"`?b Hvar2 (aligned)(2F Hh C BHCIDE FHHI@S" il b b ih b b,$D  0 9h Z4 f1"`b  81000(2@ Ih Z 1S"`?  b Yvar3 (address is multiple of 8) (2 F Jh C BHCIDE FHHI@S"   l }B ,  ZhB }, ,$D  0 Fh Z$ 1 "`}B W  50(2@ Gh Z 1 "`WB 1  50(2@@ }B ,  Sh}B ,  Ph Z 1S"`?TB ,  @Unused(2Ff Rh 6jJ}B 0 l  c b hh c b,$@  0@   ah c  *h Z # 1"`b <  50(2@ +h Z' 1"`<  50(2@ 6h Z+ 1"`  50(2@ 7h ZD/ 1"` b  50(2@ fh Z2 1S"`?  b @Unused(2Fl gh <jJ b H h 0޽h ? ̙33&%___PPT10%+BD%'  = @B D{%' = @BA?%,( < +O%,( < +D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*^h%(D' =-o6Bdissolve*<3<*^hD' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*h %(D' =-o6Bdissolve*<3<*h D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<* h%(D' =-o6Bdissolve*<3<* hD' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*_h%(D' =-o6Bdissolve*<3<*_hD' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*h %(D' =-o6Bdissolve*<3<*h D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<* h%(D' =-o6Bdissolve*<3<* hD' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*]h%(D' =-o6Bdissolve*<3<*]hD3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*Zh%(D' =-o6Bdissolve*<3<*ZhD' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*h%(D' =-o6Bdissolve*<3<*hD3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<* h)%(D' =-o6Bdissolve*<3<* h)D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*hh%(D' =-o6Bdissolve*<3<*hhD3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*ih%(D' =-o6Bdissolve*<3<*ihD' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*h%(D' =-o6Bdissolve*<3<*hD3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<* h)4%(D' =-o6Bdissolve*<3<* h)4+/  0  //66t.(  t~ t s *C  `x   ~ t s *D  `   L t P t# 0 vR@N   t t  LT U9  t# B  t # lI 1?"`Q9  BByte 0 0( 2 t # l N 1?"`9 Q  BByte 1 0( 2  t # l8R f1?"`9   BByte 2 0( 2  t # lU f1?"`U9   BByte 3 0( 2  t # lY 1?S"`?L  K32-bit Register 0( 2  t # l$] 1?S"`? 9  KMSB,0( 2  t # l\a 1?S"`? 9  KLSB,0( 2 N   t b P t # le 1?S"`? B  M. . .,0( 2 t # li 1?S"`?B   M. . .,0( 2 t # ln 1?"`B   BByte 0 0( 2 t # lq 1?"`IB   BByte 1 0( 2 t # lLu f1?"`B I  BByte 2 0( 2 t # l} f1?"` B   BByte 3 0( 2 t # l- 1?S"`? J  Ia,0( 2 t # l0 1?S"`? J  Ka+3,0( 2 t # l4 1?S"`?D J  Ka+2,0( 2 t # l|9 1?S"`? 9J  Ka+1,0( 2ZB t s *D1 B B ZB t s *D1   t # lL> 1?S"`? NMemory,0( 2 t # lB 1?S"`? U9  Oaddress,0( 2lR t <G HS B |L vR  t# vR  t # lG f1?"`K_ BByte 3 0( 2T    t# v  LT U9  !t# B  "t # lK 1?"`Q9  BByte 0 0( 2 #t # lO 1?"`9 Q  BByte 1 0( 2 $t # lN f1?"`9   BByte 2 0( 2 %t # lV f1?"`U9   BByte 3 0( 2 &t # li 1?S"`?L  K32-bit Register 0( 2 't # ll 1?S"`? 9  KMSB,0( 2 (t # l$n 1?S"`? 9  KLSB,0( 2 )t # l 1?S"`?  ; M. . .,0( 2 *t # l\W 1?S"`?TR; M. . .,0( 2 +t # l( 1?"` T_ BByte 0 0( 2 ,t # l@ 1?"`Q_ BByte 1 0( 2 -t # lD f1?"`_ BByte 2 0( 2 .t # lt 1?S"`? Y Ia,0( 2 /t # l 1?S"`?T Ka+3,0( 2 0t # l 1?S"`? Ka+2,0( 2 1t # l! 1?S"`?I Ka+1,0( 2ZB 2t s *D1 RZB 3t s *D1 _R_ 4t # l^ 1?S"`?h|  NMemory,0( 2 5t # l,b 1?S"`?d   Oaddress,0( 2lR 6t <G HS  `H t 0޽h ? a(___PPT10i. 8%+D='  = @B +  0  <(  ~  s *c[  `  [  ~  s *d[  v > [  H  0޽h ? f3fy___PPT10Y+D='  = @B +}  0 0P$(  Pr P S  "[  `  [  r P S "[  `x [  H P 0޽h ? 33___PPT10i.\+D='  = @B +C'  0 Z&R&9|x%(  xr x S pZ  `    $ TPh zx #"B6 rr0Pb xx <  ?"`H} Pv  >#? vx <  ?"`} Hv  J10#? tx <  ?"`T} v  R Exit Program  #? hx <؎ ?HoPh Z$a0 = character read#? fx <0 ?oHh J12#? dx <0 ?Toh O Read Char  #? ax <ܨ ?Hv Po ^$a0 = character to print#? _x <5 ?v Ho J11#? ]x <= ?Tv o P Print Char  #? Yx <0H ?H P}  H$a0 = address of input buffer $a1 = maximum number of characters to read"+  I#? Wx <P ? H}  I8#? Ux <PZ ?T }  Q Read String  #? Rx < c ?H P  W$f0 = double read#? Px <k ? H  I7#? Nx <m ?T   Q Read Double  #? Bx <D ?HP  V$f0 = float read#? @x < ?H  I6#? >x <' ?T  P Read Float  #? 9x <0 ?HP X$v0 = integer read#? 7x <H ?H I5#? 5x <$ ?T R Read Integer  #? 0x < ?HP m'$a0 = address of null-terminated string((#? .x < ?H I4#? ,x < ?T R Print String  #? !x < ?HP b$f12 = double value to print#? x <p  ?HP b$f12 = float value to print#? x < ?HP b$a0 = integer value to print#? x < ?HP XArguments / Result#? x <x` ?H I3#? x <`` ?T R Print Double  #?  x <ܐ` ?H I2#?  x <ܒ` ?T Q Print Float  #?  x <@` ?H I1#? x <L` ?T S Print Integer#? x <ȳ` ?H K$v0#? x <D` ?T MService#?`B x 0o ?TPZB x s *1 ?TPZB x s *1 ?TPZB x s *1 ?TP`B x 0o ?ThPh`B x 0o ?TThZB x s *1 ?hZB x s *1 ?HHh`B x 0o ?PPhZB -x s *1 ?TPZB 6x s *1 ?TPZB ?x s *1 ?TPZB Ox s *1 ?T P ZB Vx s *1 ?T P ZB ^x s *1 ?T} P} ZB ex s *1 ?ToPoZB ux s *1 ?Tv Pv  |x 6` jJ  ASupported by MARS 2H x 0޽h ? 33___PPT10i.d0n+D='  = @B +  0 |(  |r | S $[  `  [   | B [  S"  `b [  $L H | 0޽h ? 33___PPT10i.dpeU+D='  = @B +  0 (  x  c $S[  `  [    B0[  S"  `b [  $L H  0޽h ? 33___PPT10i.dpeU+D='  = @B +  0 0(  x  c $4[  `  [    B=[  S"  ` [  $L H  0޽h ? 33___PPT10i.dpeU+D='  = @B +  0 P(  x  c $A[  `  [    Nl[  c"$`  `> [  $L H  0޽h ? 33___PPT10i.dpeU+D='  = @B +  0 `(  x  c $)  `  )    B[  S"  ` )  (L4H  0޽h ? 33___PPT10i.dpeU+D='  = @B +  0 ( p(  x  c $Z  `  Z     `0)  c"$`  ` Z  ,L4 H  0޽h ? 33___PPT10i.dpeU+D='  = @B +  0  <(  ~  s *tO  `  Z  ~  s *O  v > O  H  0޽h ? f3fy___PPT10Y+D='  = @B +%  0L0  5 (    BE jJ?S"`?j D >,$D  0 HParameters: $a0 = Address of v[] $a1 = k, and Return address is in $ra  n0 n' n FgB g BgFBFg B $g$$g$F$::W::WWtt"   f& xaxaG  ? `x     TX7 0e0ejJ?"`b !  Uvoid swap(int v[], int k) { int temp; temp = v[k] v[k] = v[k+1]; v[k+1] = temp; }.T  PV>6$::W::WWttI  H jJ?"` >,$@ 0 swap: sll $t0,$a1,2 # $t0=k*4 add $t0,$t0,$a0 # $t0=v+k*4 lw $t1,0($t0) # $t1=v[k] lw $t2,4($t0) # $t2=v[k+1] sw $t2,0($t0) # v[k]=$t2 sw $t1,4($t0) # v[k+1]=$t1 jr $ra # return b,1) $:H:x::WWtt~  s *   `   H  0޽h ? U>=UU(___PPT10.L`g+5D' ( = @B D' = @BA?%,( < +O%,( < +D{' =%(D#' =%(D' =A@BBBB0B%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =+4 8?\CB#ppt_xBCB#ppt_xB*Y3>B ppt_x<*D' =+4 8?dCB1+#ppt_h/2BCB#ppt_yB*Y3>B ppt_y<*D' =%(D-' =%(Dp' =A@BB BB0B%()))D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*Dp' =A@BB BB0B%()))D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*Dc' =4@BB BB%()))D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*Dc' =4@BB BB%()))D' =1:Bvisible*o3>+B#style.visibility<*<%(D' =-o6Bdissolve*<3<*<Dc' =4@BB BB%()))D' =1:Bvisible*o3>+B#style.visibility<*<W%(D' =-o6Bdissolve*<3<*<WDc' =4@BB BB%()))D' =1:Bvisible*o3>+B#style.visibility<*Wt%(D' =-o6Bdissolve*<3<*WtDc' =4@BB BB%()))D' =1:Bvisible*o3>+B#style.visibility<*t%(D' =-o6Bdissolve*<3<*tDc' =4@BB BB%()))D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*Dc' =4@BB BB%()))D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*+p+0+0 ++0+0 +;  0   n(   ~   s *  `   ~   s *4  `x      H 1?"`eP, nswap: sll $t0,$a1,2 add $t0,$t0,$a0 lw $t1,0($t0) lw $t2,4($t0) sw $t2,0($t0) sw $t1,4($t0) jr $ra o o,b$:H:x::WWtt   Hp 1?"` $ >,$@ 0 : la $a0, a li $a1, 10 jal swap # return here . . . ; ;, $::x::WWtt   Bx jJ?S"`? U  pCaller"(  F$::x::WWttL   Z) pGpGjJ?"`  ,$D 0 addr a (  :x::WWtt    `d4 pGpGjJ?S"`?   b$a0=$4(  :x::WWtt.   Z= pGpGjJ?"`  ,$D 0 b10 (  :x::WWtt    `F pGpGjJ?S"`?   b$a1=$5(  :x::WWttV   ZQ pGpGjJ?"`_0,$@ 0 ret addr (   :x::WWtt;    `Z pGpGjJ?S"`?d> $ra=$31(  :x::WWtt    ``e pGpGjJ?"` _ a. . .(  :x::WWtt    `0o pGpGjJ?"`   a. . .(  :x::WWtt     #   ,$D 0B   T Do?  ~B   N Do? B  @ T Do?B ,$D 0   Ny jJ?S"`?  s Registers" (   F$::x::WWttH   0޽h ? a(((___PPT10(.N@m+LFDf(' = @B D!(' = @BA?%,( < +O%,( < +D' =%(D' =%(DV' =4@BBBB%()))D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<*  D' =0l9 BBBB*<3<*  )?D4' =%(D' =%(D' =4@BBBB%(D' =1:Bvisible*o3>+B#style.visibility<* %(D' =%(D' =%(DV' =4@BBBB%()))D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<*  D' =0l9 BBBB*<3<*  )?D4' =%(D' =%(D' =4@BBBB%(D' =1:Bvisible*o3>+B#style.visibility<* %(D' =%(D' =%(DV' =4@BBBB%()))D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<* &D' =0l9 BBBB*<3<* &)?D' =%(Dh' =%(D' =4@BBBB%(D' =1:Bvisible*o3>+B#style.visibility<*  %(D' =4@BBBB%(D' =1:Bvisible*o3>+B#style.visibility<* %(D ' =%(Dd ' =%(D&' =4@BBBB%(D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<* D' =0l9 BBBB*<3<* )?D&' =4@BBBB%(D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<* &D' =0l9 BBBB*<3<* &)?D&' =4@BBBB%(D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<* &6D' =0l9 BBBB*<3<* &6)?D&' =4@BBBB%(D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<* 6FD' =0l9 BBBB*<3<* 6F)?D&' =4@BBBB%(D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<* FVD' =0l9 BBBB*<3<* FV)?D&' =4@BBBB%(D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<* VfD' =0l9 BBBB*<3<* Vf)?D' =%(D~' =%(D&' =4@BBBB%(D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<* foD' =0l9 BBBB*<3<* fo)?DL' =%(D' =%(D' =4@BBBB%(D' =1:Bvisible*o3>+B#style.visibility<* &4%(D' =4@BBBB%(D' =1:Bvisible*o3>+B#style.visibility<* 4;%(D' =4@BBBB%(D' =1:Bvisible*o3>+B#style.visibility<* %(+e$  0   'p (    B( "` , ,$D 0 [+Register $31 is the return address register,,x  c $8  `     <`  0}   ( H k  BT3 "`7PL,$ 0 APseudo-Direct Addressing PC = imm26<<2 0x10000f << 2 = 0x0040003CZx 8x(x)el 08J  '08J ,$D  02   `jJ?"0@NNN?N0NB  ZDjJ?"0@NNN?NN8J  l 0  %0 ,$D 02   `jJ?"0@NNN?N0 N B  # lDjJ?"0@NNN?NP  B   fDjJ?"0@NNN?N d,$@ 0Ql \-n  &\- ,$@ 0  T') "`-n  D 0x00400030  c   T8*) S"`?\n  =$31cH  0޽h ? 33___PPT10.DV+ VD.' 3 = @B D' = @BA?%,( < +O%,( < +D' =%(D' =%(DV' =4@BBBB%()))D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<*D' =0l9 BBBB*<3<*)?D' =%(D' =%(D@' =A@BB BB0B%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*%%(D' =-o6Bdissolve*<3<*%D+' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*&%(D' =-o6Bdissolve*<3<*&D@' =A@BB BB0B%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D' =%(D~' =%(D&' =4@BBBB%(D' =?B70, 0; .2, .5; .8, .5; 1, 0-g6B fade*<3<*D' =0l9 BBBB*<3<*)?D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*'%(D' =-o6Bdissolve*<3<*'+p+0+0 ++0+0 +V'  0 m&e&+;%(  ~  s *ؼ  `   8! G C: ; #""rrrrG C:     ` ## 1?"`TC: ]9$ x$$``   `X ## 1?"`T: ]0$ x$$``   ` ## 1?"`T C ]8$ x$$``   ` ## 1?"` T ]0$ x$$``   ` ## 1?"`6  ]0$ x$$``    ` ## 1?"` 6 ]0$ x$$``    `T ## 1?"`  _rs5$ x$$``    ` ## 1?"`f  mop6 = 0. x$$``#    `4 ## 1?"`L f  }PC = Rsx$$``/    `x ## 1?"` L jr Rs$|$$``   `, ## 1?"`6: _rd5$ x$$``   `e ## 1?"`6: ]0$ x$$``   `@S ## 1?"` : _rs5$ x$$``   `Z ## 1?"`f  : mop6 = 0. x$$``*   `V ## 1?"`Lf : Rd=PC+4, PC=Rs x$$``5   ``5 ## 1?"`L:  jalr Rd, Rs  $|$$``   `X ## 1?"`  C  aimm26$ x$$``   `\ ## 1?"`f   mop6 = 3. x$$``   `( ## 1?"`L f  r$31=PC+4, jump,x$$``1   ` ## 1?"` L   jal label*  |$$``   `x ##1?f G C  XFormatx$$``   `` ##1?LG f   YMeaningx$$``   `% ##1?G L  [ Instruction  x$$``xB  H 1 ?G CG xB  H 1 ?:C:rB  B 1 ?LG L rB  B 1 ?f G f  rB  B 1 ?L L:rB   B 1 ?f  f :xB ! H 1 ?G :xB " H 1 ? C xB # H 1 ?CG C:rB $ B 1 ?  :rB % B 1 ? C rB & B 1 ? :rB ' B 1 ?6 6:rB ( B 1 ?CrB ) B 1 ? :rB * B 1 ?T T: + T+ gֳgֳ ?0P  {JAL (Jump-and-Link) used as the call instruction Save return address in $ra = PC+4 and jump to procedure Register $ra = $31 is used by JAL as the return address JR (Jump Register) used to return from a procedure Jump to instruction whose address is in register Rs (PC = Rs) JALR (Jump-and-Link Register) Save return address in Rd = PC+4, and Jump to procedure whose address is in register Rs (PC = Rs) Can be used to call methods (addresses known only at runtime)1 p 3 >        "> tI(u@H  0޽h ? a(___PPT10i.+D='  = @B +  0  <(  ~  s *  `   ~  s *h  v >   H  0޽h ? f3fy___PPT10Y+D='  = @B +  0 <(  ~  s *  `   ~  s *  `x   H  0޽h ? ̙33y___PPT10Y+D='  = @B +  0 0<(  ~  s *z  `   ~  s *z  `x   H  0޽h ? a(___PPT10i.T'+D='  = @B +B7  0 $$@/5`$(  ~  s *胺  `   ~  s * 0PJ    zl  j 2 =pj,$D 0   f 1?"`  '  C Frame f() 0( 2    f< 1?"`    ?Stack0( 2>   3 r$ 0e1?"` ' j 0! stack grows downwards:0( BT J Mv   # v # B   T D1? M    Z 1?"`J v  c$fp"0( 2 T J M   #  ` B  T D1?\ M\   Z 1?"`J   C$sp$0( 2B l  j 3  j,$D 0   f蠺 1?"` '  C Frame f() 0( 2    f 1?"`  ?Stack0( 2  3 r 0e0e1?"` j Nallocate stack frame0    f f1?"`'  C Frame g() 0( 2 B  Z D1?O O !   `\ 1?S"`? m  c$fp"0( 2 B  Z D1?n n    ` 1?S"`? m  A$sp"0( 2 G  # l' 1?"` . ,$ 0 i f calls gD 0 7  # lȺ 1?"` m ,$ 0 Y g returns4 0  Jl  j 4 j,$D 0  Z̺ 1?"` '  C Frame f() 0( 2   ZϺ 1?"`   ?Stack0( 2(    fXº 0e1?"` ' j |&! free stack frame:0( BT J Mv  !#  v # B " T D1? M  # Z 1?"`J v  c$fp"0( 2 T J M  $#  ` B % T D1?\ M\  & Z| 1?"`J   A$sp"0( 2  l s  5s ,$D 0B  T D1?& B  T D1?  T J Mv  (# s  B ) T D1? M  * Zh 1?"`J v  c$fp"0( 2  + 3 r 1?"`   C arguments 0   , 3 r 1?"`   e saved $ra 0   - 3 r  1?"`   Isaved registers0  . 3 rD 1?"` j \"local data structures or variables#0 #T J M  /# B 0 T D1?\ M\  1 ZS 1?"`J   A$sp"0( 2 H  0޽h ? a(H@___PPT10 .T'+.FD'  = @B D?' = @BA?%,( < +O%,( < +D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*2%(D' =-o6Bdissolve*<3<*2D' =%(D)' =%(D' =A@BBBB0B%())))?D' =1:Bvisible*o3>+B#style.visibility<*%(D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*3%(D' =-o6Bdissolve*<3<*3DA' =%(D' =%(D' =A@BBBB0B%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*4%(D' =-o6Bdissolve*<3<*4D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*5%(D' =-o6Bdissolve*<3<*5+p+0+0 ++0+0 +  0 <(  ~  s *"  `   ~  s *" 0P   H  0޽h ? ̙33y___PPT10Y+D='  = @B +}  0 ]YUY, X(  x  c $-  `     c $A J m <$ 0   & 8 0  0 f  6 {(  T  "`0{.  9first(2`B  0D R  T  "`0.( 8last(2`B  0D R  TT  "`,(V 9Array(2 D Tt  "`p  >Unsorted n Fl n  In ,$D 0T   d ;# n L`  0D  d  N "` H  9first(2ZB  s *D D   NT "` d 8last(2ZB   s *DD  ! N\ "`   9Array(2 " N f"`D    = max value (2  # N "`D  d > last value (2  $ N|| "`   7max(2ZB % s *D D  E Nξ "`  @ Locate Max n Nl    J  ,$D 0T   d <#  L` & 08 d ' NѾ "` H  9first(2ZB ( s *D 8  ) NL־ "` d 8last(2ZB * s *D8 + N|Ծ "`   9Array(2 , N W f"`8 d = max value (2  - NTZ "`8   > last value (2  . N^ "`   7max(2ZB / s *D 8  F N\ "`<   HSwap Max with Lastnel P  KP ,$D 0 T  P @# PLf 0 6zm P 1 T\f "`m   9first(2`B 2 0D  z  3 Tj "`  8last(2`B 4 0D ?z? 5 T$o "` H  9Array(2 6 T(m f"`zP = max value (2  G Nu "`zP  DDecrement Lastnl  =  =,$D 0 L Ty  "`   33 Q T~  "`   31 R T|  "`   75 S T  "` c 32 T T  "`c< 74 U TH  S"`?d = :last V T  S"`?   9max W T  S"`?   7first`B X 0D .j j `B Y 0D .  `B Z 0D .l  <  <,$D 0[@  F< f < [ N "` F  33 \ N "` F  31 ] N "` F  74 ^ N "` Fc 72 _ NT "`cF< 35 ` NL S"`? $c :last a N S"`? $  9max b N S"`? $  7firstZB c s *DIj j ZB d s *DI  ZB e s *DI  l  <  <,$D 0oT  F< g#   < h NĶ "` F  33 i N( "` F  31 j N@ "` F  74 k N "` Fc 32 l N "`cF< 75ZB m s *D  ZB n s *D  l   <   <,$D  0iN  F< o   < p N "` F  33 q Nh "` F  31 r N "` F  72 s N "` Fc 74 t NT "`cF< 35TB u c $D TB v c $D q l  <   <,$D  0iN  F< z  < { N "` F  73 | N4 "` F  31 } N "` F  72 ~ N| "` Fc 34  N "`cF< 35  N S"`? >  :last@ <      NH S"`?< ^  7firstZB  s *Dj j @ < F      N S"`?< F ^  9maxZB  s *D  ZB  s *Dc   l  6<  6<,$D  0iN  F<   6<  Nh "` F  72  N` "` F  31  N "` F  73  N8 "` Fc 34  Nx "`cF< 35TB  c $Dj  TB  c $Dj   l 6 0<  60<,$D  0iN  F<   0<  N! "` F  72  N\& "` F  71  Nt* "` F  33  N. "` Fc 34  N1 "`cF< 35  N`5 S"`?6 X  :lastN <    6    N9 S"`?< ^  7firstZB  s *Dj j N < F    6    N< S"`?< F ^  9maxZB  s *D  ZB  s *D}E E l 0 P<  0P<,$D  0iN  F<    P<  NJ "` F  71  NtL "` F  72  N "` F  33  N "` Fc 34  Nx "`cF< 35TB  c $D0j C TB  c $D0j C H  0޽h ? 33##___PPT10#.G+Dg#'  = @B D"#' = @BA?%,( < +O%,( < +D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*I%(D' =-o6Bdissolve*<3<*ID' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*J%(D' =-o6Bdissolve*<3<*JD' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*K%(D' =-o6Bdissolve*<3<*KD+' =%(D' =%(D@' =A@BB BB0B%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*D' =%(D' =%(D3' =4@BB BB%(D' =1:Bvisible*o3>+B#style.visibility<*%(D' =-o6Bdissolve*<3<*+8+0+0 +  0 p (  x  c $  `     BT  S"  `   6"LH CoFCGH  0޽h ? 33___PPT10i.dpeU+D='  = @B +  0 ` (  x  c $  `     B<  S"  `   6"LH CoFCGH  0޽h ? 33___PPT10i.dpeU+D='  = @B +  0 `d(  ~  s *)  `     s *  `x   4 ~ 4SzW4H  0޽h ? a(___PPT10i.PѺD+D='  = @B + 0  (     `| ~~ ? T$K       T1 ?vQ   H  0rllC ? a(80___PPT10.L`g 0  p(  p p  `. ~~ ? T$K     p  T1 ?vQ   H p 0rllC ? a(80___PPT10.L`gr   P+uRXZPt9)h`g3K4i0ĭ00mU9Ɣuvۥ d8Sz] 1Oh+'0 `h   $$MIPS Assembly Language ProgrammingDr. Muhamed MudawarMuhamed Mudawar486Microsoft Office PowerPoint@A @ И@PsH Gg  oL  y--$xx--'--$<<--'@BComic Sans MS-. *2 !MIPS Assembly Language ."System8-@BComic Sans MS-. 2 43 Programmingn.-@"Arial-. 2 FBCOE 308.-@"Arial-. '2 O2Computer Architecturee.-@"Arial-. '2 Y.Prof. Muhamed Mudaware.-@"Arial-. I2 e,College of Computer Sciences and Engineering.-@"Arial-. L2 m.King Fahd University of Petroleum and Minerals.-P՜.+,00    On-screen ShowKFUPM* 1ArialComic Sans MS WingdingsTimes New Roman Courier NewDefault Design#MIPS Assembly Language ProgrammingPresentation OutlineAssembly Language Statements Instructions Comments Next . . .Program Template".DATA, .TEXT, & .GLOBL DirectivesLayout of a Program in Memory Next . . .Data Definition StatementData DirectivesString DirectivesExamples of Data Definitions"MARS Assembler and Simulator Tool Next . . .Memory Alignment Symbol TableByte Ordering and Endianness Next . . . System CallsSyscall Services Reading and Printing an IntegerReading and Printing a String!Program 1: Sum of Three Integers%Sum of Three Integers Slide 2 of 2Program 2: Case ConversionCase Conversion Slide 2 of 2 Next . . . ProceduresCall / Return SequenceDetails of JAL and JRInstructions for Procedures Next . . .Parameter PassingParameter Passing cont'd Stack FramePreserving RegistersSelection SortSelection Sort ProcedureMax Procedure!Example of a Recursive ProcedureShl  Fonts UsedDesign Template Slide Titles* Custom Shows'_]!0Muhamed MudawarMuhamed Mudawar  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     Root EntrydO)PicturesYCurrent UserSummaryInformation(PowerPoint Document(f!DocumentSummaryInformation8