Title: CSE 351 23au / LS13 Executables, Arrays

Q: When building an executable in C, what does CALL stand for?
A: Compiler
Assembler
Linker
Loader

Q: The translation of a text file (i.e., the bytes are meant to be interpreted as characters) of source code into a text file of assembly is done by the ___
A: Compiler

Q: The conversion of a text file of assembly code into a binary object file is done by the ___
A: Assembler

Q: Object files contain ___, which is incomplete machine code and information tables.
A: object code

Q: In the object file, what table holds the list of globally accessible labels (e.g., procedure names, global variables)?
A: symbol table

Q: In the object file, what table holds the list of addresses that need to be patched by this object code?
A: relocation table

Q: The phase that stitches together all the object and static library files needed to produce the final executable is the ___
A: Linker

Q: True or false: We cannot interpret object or machine code from a binary file as assembly instructions because they are stripped of all human-readability
A: False, despite being stripped of all human-readability, we can still use the machine code encoding rules defined by the ISA to try and read/interpret it as instructions

Q: Reading the binary files of object files and executables is known as ___
A: disassembling

Q: The phase that takes an executable file and starts a running process from it (including setting up memory sections and initialization register values) is the ___
A: loader

Q: True or false: Separate array declarations are always guaranteed to be adjacent in memory.
A: False, separate array declarations (even if declared right after each other) may not be contiguous in memory. It's ultimately up to the compiler. The only guarantee is that each individual array will be contiguous.

Q: True or false: Declaring an array `T A[N]` is guaranteed to allocate enough contiguous space to hold `N` elements of size `sizeof(T )`
A: True, in C, individual arrays are stored as contiguous chunks of memory

Q: In C, because array accesses are done via memory operands (i.e., (Rb,Ri,s) and D(,Ri,S)), what is one consequence of this?
A: Lack of bounds checking
Neither memory operand encodes the array size or bounds, therefore, our computer will blindly arry out the memory access without any notion of the programmer's data allocations.

Q: True or false: Declaring a pointer allocates space for an address and also allocates space for the data you want to refer to
A: False

Q: True or false: Declaring an array allocates space for your array data but does not allocate space to store the array’s address
A: True

Q: For a multidimensional arrays in C, what type of ordering is used?
A: row-major ordering

Q: Using row-major ordering, if you created a 2-D array of type int with 4 rows and 5 columns, how many bytes of contiguous memory are allocated for your array?
A: 80 bytes
Rows * columns * sizeof(type)

Q: True or false: Multidimensional arrays are still allocated as one contiguous chunk of memory, regardless of the number of dimensions.
A: True

Q: An array of pointers where each element references an array is known as a ___
A: multilevel array