Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the compilation toolchain can we avoid generating assembly? 19 It would be incredibly hard to go from C straight to machine code. While not
In the compilation toolchain can we avoid generating assembly? 19 It would be incredibly hard to go from C straight to machine code. While not O impossible, converting to C to assembly (or a variety of assembly languages) makes C very portable for different operating systems and platforms. O Yes, we always can--assembly is useless and not relevant to programmers today. 15 What are the best practices for disassembling a binary and reading the source code? (Check all that apply) Make sure you compiled with debugging symbols Typically, disable optimizations and other code transformations (though this is not required) When using objdump, make sure to pass in the disassemble (-d) flag. What are some features of a CISC Architecture? (Check all that apply) 15 Instructions do more per single operation. (Often multiple operations) Instructions do exactly one thing per operation. Typically the code is a smaller size because more operations are done at once. Typically a CISC architecture is for a more general purpose machine like a PC, versus a specific piece of hardware (like a gaming console) Is there a difference between the movq and movb instruction? 15 Yes, movq moves a Quad word of data (e.g. a long) and movb moves a byte of data. There is no difference. Can you use the 16 general purpose registers for whatever you want? 15 Yes and No. Some instructions reserve these general purpose registers in order to properly operate. Yes, do whatever you want whenever you want. What could go wrong? What is the job of the front end of the compiler? 15 Generate a valid intermediate representation of code to be later optimized and transformed to the target code for a specific architecture. Optimize the initial input Generate Target Machine Code for a final executable Check which of the reasons one would use a linker. 15 Space - Common files can be aggregated together Time - Code may be compiled separately to save time in really large builds. What does the linker actually do? 13 Symbol Resolution and Relocation Complicate the compilation process What does the linker actually do? 19 Symbol Resolution and Relocation Complicate the compilation process When can I Link in code? (Check all that apply) 1 At compile-time (Statically before the program runs) At run-time (While the program is running) What data structure is the symbol table implemented as? * 15 O Hashmap or Hashtable or dictionary What is a 'key' in a hashmap * 13 The unique key is associated with a value. We use the key to return a value in an average of constant time with hashmaps What is a 'hash function'* 19 A function which takes a 'key' and maps it to a value within a certain range. We use hash functions to convert keys to unsigned integers, so that they can 'map' to a bucket in a hashtable. O A function that multiples two integers. 19 Are arrays essentially the same as hashmaps/dictionaries? (i.e. you have a key/value pair with a unique key) * Yes, the key is typically an unsigned integer (0 - ARRAY_SIZE), and the value is whatever contents the array stores No, an array is not an associative container where we can lookup values in O(1)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started