Skip to content

Instantly share code, notes, and snippets.

@evanlimanto
Created May 26, 2017 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evanlimanto/8cf6d652e6f2293c0e6baf25cd819be9 to your computer and use it in GitHub Desktop.
Save evanlimanto/8cf6d652e6f2293c0e6baf25cd819be9 to your computer and use it in GitHub Desktop.
# MT1-1: Potpourri – Good for the beginning... (8 points)
a. **True/False:**
i. The compiler turns C code into instructions ready to be run by a processor **True** **False**
ii. The instruction addiu $t0 $t1 100000 is a TAL instruction **True** **False**
iii. The linker computes the offset of all branch instructions **True** **False**
b. **Memory Management**
int global = 0;
int* func() {
int* arr = malloc(10 * sizeof(int));
return arr;
}
int main() {
char* str = "hello world";
char str2[100] = "cs61c";
int* a = func();
return 0;
}
In what part of memory are each of the following values stored?
*str: str2[0]:
a: arr:
arr[0]:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment