Week1
Hello! Welcome to Week 1! This week was mainly an introduction to the course + a chance to make sure that you have all you need from COMP1511 to succeed in this course!
Course Structure
- First half of the course is in MIPS, second half is in C (but covering low level things)
C Recap
- Went over pointers, arrays and basic memory ideas
- Introduced recursion
- You call the function inside the function
- Normally used to replace loops (very convenient in some cases)
- To successfully do any of the recursions
- Find a base case, so in 1521, we normally start at the very end and go backwards - so this is the simplest possible case!
- Write a recursive case on top of that - just consider what the next most complicated case is after the first
- Don't be afraid to write an extra function! Normally, it'll look something like this:
int main (void) {
return 0;
}
int recurse(int input) {
if (input == basecase) {
return 0;
}
return recurse(basecase) + modification;
}
MIPS Quick Introduction
- MIPS is a low level assembly language
- Everything is in the the layout
instr $register1, $register2- note that
$register1is always the destination register
- note that