Lecture 2 Flashcards

1
Q

Is assembly considered low level?

A

Due to the one-to-one correspondence with machine instructions, it is seen as low-level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Is assembly portable?

A

No. different processors have different instruction sets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some advantages of higher-level languages.

A

One HLL statement can correspond to many machine instructions.
They are also machine-agnostic, making them much more portable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the operating system do?

A

As the name implies, it controls the entire operation of the computer. It is a resource manager and allocator.

All I/O operations performed on a computer system pass through the OS via a standardized interface.

It manages H/W resources and handles the execution of programs/processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Linux is _____-based.

A

Unix

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Mac OS X is ______-based.

A

Unix.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a big reason for the success of Unix?

A

It was written primarily in C and made very few assumptions about the architecture of the computer.
This let it port to many different computers with relatively little effort.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Windows runs on…

A

Intel or intel compatible processors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Compilers…

A

Translate a program in a high-level language into an executable for your operating system.

This involves many stages, and is not to be confused with compiling. Compiling is only one of the stages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Compiler steps:

A

Source code
Preprocessor makes it into expanded code.
Compiler makes it into assembly code.
Assembler makes it into object code.
The linker takes the object code, libraries, and other object files, and makes it into executable code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are two popular text editors used on Unix?

A

vim/Emacs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is gcc?

A

Uses the GNU C compiler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Preprocessor

A

Takes symbol definitions and expands them. Inserts head file text to make a complete program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Compiler

A

A syntactically correct program is translated into a “lower” form. Each statement is translated by the compiler into equivalent assembly statements. This is a .s file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Assembler.

A

Translated assembly language into actual machine instructions. Object code or .o files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Linkers.

A

All object files linked together with system libraries to make an executable file.

17
Q

What is building?

A

Compiling/Linking a program.

18
Q

Typing the name of an executable file…

A

creates a process that runs the program. Loads the program into memory and initiates execution. Starts at entry point (usually main).

19
Q

What do interpreters do?

A

They analyze and execute statements at the same time. This is typically slower because it has to convert as it runs.

20
Q

Makefile.

A

myprog: myprog.o
gcc myprog.o -o myprog
myprog.o: myprog.c
gcc -c myprog.c

first line defines a target, myprog and the dependencies.
second line is the recipe to make the target.
second pair of lines makes the .o file for the target.

This can then just be run with $make

21
Q

More Makefile details.

A

all: myprog
all target should build entire project conventionally.

22
Q

.PHONY

A

With. it’s dependencies are not real targets and do not produce files.

23
Q
A