Download presentation
Presentation is loading. Please wait.
Published byMerilyn Francis Modified over 9 years ago
1
1 MIPS Assembly Language Programming CDA 3101 Discussion Section 04
2
2 Problem1 int chico[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; int sum; void main() { int t1 = 0; int t2 = 10; int t3 = 0; do { int t5 = chico[t1]; t3 += t5; t1++; } while (t1 < t2); sum = t3; return 0; }
3
3 Problem1 > Exercises 5.1 Write a MIPS assembly language program to find the sum of the first 100 words of data in the memory data segment with the label “ chico ”. Store the resulting sum in the next memory location beyond the end of the array “ chico ”.
4
4 Problem2 int SRC[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; int DEST[10]; void main() { int t2 = 0; int t3 = 10; do { t7 = SRC[t2]; DEST[t2] = t7; t2++; } while (t2 < t3); return 0; }
5
5 Problem2 Exercises 5.2 Write a MIPS assembly language program to transfer a block of 100 words starting at memory location SRC to another area of memory beginning at memory location DEST.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.