Translation step that begins with an A
What is assembly?
What is a lexeme
A meaningful sequence of characters.
Explain how #include works
#include takes a target file and pastes its contents into the current file.
What is another name for I/O connections?
What is one category of system calls?
Process control, file management, I/O
Input to the linker
What is ROM (object file)?
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.
What is wrong with #define mult(a) = ((a) * (a))?
There should not be an = sign.
What are the two types of I/O connections?
What does the write function return?
The number of bytes that were successfully written to the file.
What is the optional step in program translation?
What is preprocessing?
What are some characteristics of intermediate code?
Explain how the single # works
# will turn what it is given into a string.
Free space
wow what a great use ofthe block
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.
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)
Say I have the line int x = 4 + y. Which of these would be children in the syntax tree?
x, 4, and y
Explain how the double ## works
## concatenates two tokens into a single token
What file descriptors are pre opened?
When does a physical write occur?
A physical write occurs when the buffer is full.
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.
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.
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.
What is one way you can get a file descriptor?
Open a file, create a pipe, socket connection, inherit when a process is created
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.