CS 47 Final Study Guide
This material is designed to get you to think about the
kinds of facts that are important in this class. I make no claim that it is
comprehensive. There are topics that may not be mentioned in this guide that are
on the final because they appear in the textbook or in my notes.
Start by looking at the study guides for the two midterms:
Ch 10. Linking and Loading
- What does a linker do? What is the difference between a .mas file and a .mob file
and a .mac file?
- What is relocation and what are relocatable fields?
- How does sim know which values have to be adjusted if a program is relocated?
- What is the role of the header file in a .mac file?
- There are various types of entries in a header file, e.g. R entries, s entries,
E entries, P entries, a T entry. What do they represent and how are they used?
- Do you understand the role of the extern and public assembler directives?
- What kinds of files make up a an assembly language library?
- What is start-up code? Why is it even necessary?
- In a C++ main function, what are stored in the variables whose names are
conventionally argc and argv?
Ch 12. Optimal Instruction Set
- What is the problem with "running out" of 4-bit op codes?
- How do we get around the problem?
- Can you use the shll and shrl instructions to get at individual bits or
parts of words?
- What are masks and how are they used?
- What is the purpose of the addy command? How would you use it to perform
32-bit additions in our 16-bit machine?
- Can you use the or, xor, and instructions together with masks to
extract information about subsets of a word?
- Make sure you understand the use of other instructions such as cali, sect, dect,
sodd
- What do the esba and reba instructions actually do to help
you as an assembly language programmer?
- What does having the cora instruction do to make life easier for
the assembly language programmer?
- What is the heap and how do we set one up in assembly languague?
- What determines if data is allocated on the stack or in the heap?
Ch 13. Using the Optimal and Stack Instruction Sets
- Can you use two-dimensional arrays? Can you locate an item in such an array?
Can you store a value into such an array?
- Why would it have been much harder to work with 2D arrays in the earlier
version of the assembly language?
- Are you comfortable with the use of reference parameters and pointers in C++?
- If p is a pointer to a struct or an object,
what does p -> x = b mean?
How do you translate that into assembly code?
- How do you allocate space for a struct or an object of a class?
- Name mangling plays a much more important role here in this chapter. How
do we distinguish a function of a class from the function of the same signature
in a subclass?
- What is an implicit parameter? What is its role in object-oriented programming?
- If you are using pointers to objects and the classes you are using have several
functions that are overridden in subclasses, what determines which function gets
called at run time? What is the difference between virtual and non-virtual functions?
- Do you understand the distinction between computer organization and computer
architecture?
- Do you understand how to use the stack-oriented architecture version of the H1
computer?
- Be prepared to write some assembly code that uses the stack instructions.
- Why do we get more 4-bit op codes with the stack instructions?
- How do we return values in a stack-oriented architecture? How is this different
from the way we do it in a register-based architecture?