Example: Clearing and Array
{"Image DocumentName": "Example: Clearing and Array", "Image ImageDescription": "The University of Adelaide, School of Computer Science. 11 April Example: Clearing and Array. clear1(int array[], int size) { int i; for (i = 0; i < size; i += 1) array[i] = 0; } clear2(int  array, int size) { int  p; for (p = &array[0]; p < &array[size]; p = p + 1)  p = 0; add  t0, t0, zero # i = 0. loop1: sll  t1, t0,2 #  t1 = i   4. add  t2, a0, t1 #  t2 = # &array[i] sw  zero, 0( t2) # array[i] = 0. addi  t0, t0,1 # i = i + 1. slt  t3, t0, a1 #  t3 = # (i < size) bne  t3, zero,loop1 # if (\u2026) # goto loop1. add  t0, a0, zero # p=&array[0] sll  t1, a1,2 #  t1 = size   4. add  t2, a0, t1 # t2=&array[size] loop2: sw  zero,0( t0) # memory[p] = 0. addi  t0, t0,4 # p = p + 4. slt  t3, t0, t2# t3=(p<&array[size]) bne  t3, zero,loop2 # if (\u2026) # goto loop2. i =  t0. array \uf0e0 base  a0. size \uf0e0  a1. Chapter 2 \u2014 Instructions: Language of the Computer \u2014 5. Chapter 2 \u2014 Instructions: Language of the Computer.", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}