Program Translation
Compilation
Preprocessing
File I/O
System Calls
100

Translation step that begins with an A

What is assembly?

100

What is a lexeme

A meaningful sequence of characters.

100

Explain how #include works

#include takes a target file and pastes its contents into the current file.

100

What is another name for I/O connections?

What is a stream?
100

What is one category of system calls?

Process control, file management, I/O

200

Input to the linker

What is ROM (object file)?

200

What is the difference between compilation and interpretation? What kind of language is C?

Compilation means that a program is translated into another target language before execution. Interpretation means that the lines of a program are individually executed by the interpreter. C is a compiled language.

200

What is wrong with #define mult(a) = ((a) * (a))?

There should not be an = sign.

200

What are the two types of I/O connections?

Binary and text streams.
200

What does the write function return?

The number of bytes that were successfully written to the file.

300

What is the optional step in program translation?

What is preprocessing?

300

What are some characteristics of intermediate code?

Intermediate code is easy to produce and should be easy to translate into the target language (assembly).
300

Explain how the single # works

# will turn what it is given into a string.

300

Free space

wow what a great use ofthe block

300

True or false: the physical read retrieves the same amount of data requested and places it into the buffer.

False; the physical read gets more information than requested in order for fewer physical reads to be made.

400

What does ROM stand for and why is the R important?

Relocatable Object Module: the objects can be put into different memory locations without the programmer needing to change code (like for initialized global variables, the memory locations can be changed when the objects are linked together)

400

Say I have the line int x = 4 + y. Which of these would be children in the syntax tree?

x, 4, and y

400

Explain how the double ## works

## concatenates two tokens into a single token

400

What file descriptors are pre opened?

stdin, stdout, stderr
400

When does a physical write occur?

A physical write occurs when the buffer is full.

500

Explain what the loader does.

The loader takes a load module/executable and places it into memory so that it can be executed. It will also handle memory allocation for the program as it gets loaded into memory.

500

Explain how the semantic analyzer works

The semantic analyzer checks for correct meaning in the syntax tree using the symbol table as well (which just contains info about each symbol). It also performs type checking to ensure that operations make sense.

500

Why does the preprocessor not yell at you if you write problematic code and then run it through the preprocessor

The preprocessor only does text replacement since the compiler is the step responsible for ensuring that the code is valid.

500

What is one way you can get a file descriptor?

Open a file, create a pipe, socket connection, inherit when a process is created

500

What is the relationship between the first logical and first physical read?

The first logical read causes the first physical read. This is because on the first logical read, there is no data to read from, so a physical read has to be made.