Final Flashcards

1
Q

Where is the first parameter on the stack held?

A

[EBP+8]

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

Where is the return @ held on the stack

A

[Ebp+4]

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

Where is saved ebp on the stack?

A

[ebp]

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

Where is the 1st local variable on the stack?

A

[ebp-4]

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

What needs to surround each sub program in a function?

A

Push ebp
Mov ebp,esp

…..

Pop ebp
Rey

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

Local variables on the stack are stored…

A

In order

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

Parameters in stack are stored in…

A

Reverse order

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

Pushing an element is…

A

Decrease ESP by 4

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

Popping an element is…

A

Increase by 4

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

When translating from C to Nasm, if there is a local variable, in addition to the code surrounding the sub program you must…

A

Sub esp (the amount of local variables)

….

Add ESP, (the amount of local variables)

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

Return @ main, saved ebp appears only after….

A

The parameters on the stack

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

After each function on the stack, the stack pushes…

A

Return @ main,

Saved ebp

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

The big picture of running code

A

(High level code) Compiler > (assembly code) assembler > (machine code) linker > machine code exec) loader > the program runs!

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

What does the compiler do?

A

Takes in source code and scans and parses the code to them generate machine code

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

The scanner identifies correct words using:

A

Regular expressions

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

The parser identifies correct sentences by using

A

Context-free grammar

17
Q

Elipson?

A

Empty pattern

18
Q

a?

A

One occurrence of a

19
Q

Ab?

A

Strings with pattern a followed.by pattern b

20
Q

A|b

A

Strings with pattern a or pattern b

21
Q

A*?

A

Zero or more occurrences of a

22
Q

A+?

A

One or more occurrences of pattern a

23
Q

A? ?

A

(A| elipson)

24
Q

What does NFA stand for?

A

Non deterministic finite automata

This is different than a deterministic finite automata because you can use elipson to better organize the flow graph so that less edges are needed

25
Acceptance state
An acceptance state in an NFA is a state that can be reached where the lexer can determine it's the end of a sentence
26
How do you simplify a regular expression
First you write out all possibilities depending on the NFA. Then you look for matching terms in the beginning, and put the rest in parenthesis . If there is another end condition you can put an elipson in it
27
What does CFA stand for?
Context free grammar
28
What is a CFG?
The process of writing out expanding on terminal rules so that they can be expanded into terminal ones through a set of production rules
29
When is a grammar ambiguous
If a string of terminal symbols can be reached by two different derivation sequences
30
An object file contains what things?
A header, text segment, data segment, relocation table, symbol table, and possibly debugging info
31
What does a header contain
Says where the files in the section below are located
32
Text segment contains...
All source code
33
Data segment contains....
All variables and global variables
34
The relocation table defines
Lines of code that need to be fixed
35
Symbol table contains
List of referenceble tables
36
What does the linker do?
Combine several object files into an executable> concatenation text segment than has segments then resolves references using the relocation and symbol tables
37
What does the loader do?
A loader is part of a OS and it creates new address space for the program that can hold the text and data segments along with stack, initializes the registers, starts the program
38
What is static debugging?
Visual inspection of using print statements
39
What is dynamic debugging?
Using an actual debugger to observe a program as it runs and to control its execution (adding breakpoints, etc.)