Lecture 4: Intro to Embedded Programming Flashcards

1
Q

What is step 1 in the C compilation over view?

A

C preprocessor. This creates a pre processed file by substituting anything like “#include” with its actual value. It then goes on to expand macros.

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

What is step 2 in the C compilation overview?

A

The compiler, it will translate the preprocessor file into assembly code for the target architecture.

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

What is step 3 in the C compiler overview?

A

The assembler, this will translate the assembly language into machine code.

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

What is step 4 in the C compiler overview?

A

Linker. This will combine object files and libraries into a single executable.

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

What is step 5 in the C compiler Overview?

A

Object Copy. This will generate a new binary file for the specific device.

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

Why do we run an infinite loop in our embedded program?

A

To stop the program doing unpredictable things. Usually we will use it to run background processes.

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

What is in line assembly?

A

This allows us to insert hand machine code into the program for better efficiency.
asm(‘NOP’)

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

What is asm(“NOP”)

A

This is a no operation instruction that will introduce a 1 cycle delay in a system. We often use in low level programs to help save the state of registers.

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

What does the size of data types depend on?>

A

The size of the processor

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

What is the sizeof operator?

A

It is an operator that will create a constant value telling the user the size of a data object in bytes.

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

What does the volatile keyword do?

A

It will let the compiler know that the value of the variable may change at any time so don’t try optimize it.

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

What does a switch case statement do?

A

It lets us test a variable for equality against a range of values. Each value is called a case and there is no limit to how many we can have.

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

In a switch case statement, what happens if a value is equal to a case?

A

The statements following that case will execute until a break statement occurs. If there is not a break in that case, then it will continue into the following cases until it hits one.

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