Miderm2StudyTopics

advertisement
Midterm 2 Topics
You will get: This Handout
Test-taking tips:
 Read the question completely before you start it.
 If you get completely stumped on a question, finish the test and come back to it.
This list is not necessarily exhaustive, but gives an idea of the concepts from which Midterm 2
will be designed. Examples of some of the things I expect you to know are listed, but the
questions will certainly not be identical. The exam is not designed to be comprehensive;
however, some material is based on knowledge from the previous midterm.
Most of the topics below are covered by:
 HW problems
o Make sure you understand and know how to do them.
 Assignments
o Make sure you could repeat any part of the assignments (up through asgn7).
Chapter 10 – The Stack
What is a stack? What are the stack operations? LC-3 code for Push and Pop.
What is an interrupt?
What is an interrupt service routine? Know how to write one for the LC-3.
What is the interrupt service routine vector table? Where in LC-3 memory is it located?
How is a stack used for the interrupt routines? Why?
What is the Processor Status Register? What does it contain? Where is it stored during an
interrupt?
Know the detailed execution of an interrupt from start to finish.
What is an RTI instruction? How is it different from an RET?
Know how to write instructions for a stack-based machine. How many times does each
instruction access RAM?
Chapters 11, 12, 13 – C Programming
Know how to write a complete program in C.
Know how to write a program in C that has multiple files.
What are the useful preprocessor directives we have learned?
What do the preprocessor, compiler, linker do?
What does an interpreter do? How is it different from a compiler? What is an advantage of
each? Name a compiled language. Name an interpreted language.
Know how the bitwise and logical operators in C work.
What is a global variable? How do you declare one? Where in memory is it stored?
What is a local variable? Where in memory is it stored?
How do these constructs translate into LC-3 code?
Chapter 14 Function Calls
What is the syntax for functions? For prototypes?
What belongs in the .h file?
What does an activation record look like? Where is it stored? When is an activation record
created? When does it go away?
Which LC-3 Registers are used for keeping track of activation records?
How are parameters pushed onto the RT stack?
How are locals pushed onto the RT stack?
How are globals pushed onto the RT stack?
What is the caller/callee responsible for pushing on and popping off the stack?
Know how to write LC-3 code for: Caller setup, callee setup, callee teardown, and caller
teardown.
How is RET different from a C return statement?
Chapter 16 and Beyond - Pointers
How do you declare and use pointers?
Know how to write and call a function that takes pointers as input parameters.
What is the difference between an array and a pointer?
Where is an array stored in memory? In which direction?
How is an array passed to a function?
What happens when we go outside the bounds of an array?
Given a memory construct, be able to write the code that allocates it.
Given an allocation and initialization, be able to draw the memory it produces.
Be able to do a problem like one of these (including drawing the pictures).
Download