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
Q

Acceptance state

A

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
Q

How do you simplify a regular expression

A

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
Q

What does CFA stand for?

A

Context free grammar

28
Q

What is a CFG?

A

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
Q

When is a grammar ambiguous

A

If a string of terminal symbols can be reached by two different derivation sequences

30
Q

An object file contains what things?

A

A header, text segment, data segment, relocation table, symbol table, and possibly debugging info

31
Q

What does a header contain

A

Says where the files in the section below are located

32
Q

Text segment contains…

A

All source code

33
Q

Data segment contains….

A

All variables and global variables

34
Q

The relocation table defines

A

Lines of code that need to be fixed

35
Q

Symbol table contains

A

List of referenceble tables

36
Q

What does the linker do?

A

Combine several object files into an executable> concatenation text segment than has segments then resolves references using the relocation and symbol tables

37
Q

What does the loader do?

A

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
Q

What is static debugging?

A

Visual inspection of using print statements

39
Q

What is dynamic debugging?

A

Using an actual debugger to observe a program as it runs and to control its execution (adding breakpoints, etc.)