32-Bit Linux Assembly: Ep.2 – New Sections and File Manipulation Flashcards

1
Q

What are the three main types of operands?

A

Register operand

Memory operand

Immediate operand

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

What does [eax] mean?

A

Square brackets indicate “the value located at”, so [eax] would mean “the value contained in eax”

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

value = 0x00408000

0x00408000 contains “0x54”

If the instruction “mov ebx, [value]” is issued, what will the value entered into the ebx register be?

A

0x54.

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

What does 70q mean in assembly?

A

70 in “Octal” notation.

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

What does 20o mean in assembly?

A

20 in “Octal” notation.

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

What does 0b10011000 mean in assembly?

A

10011000 in binary notation.

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

What is .bss short for?

A

Block Started by Symbol (BSS).

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

What is stored in the .bss section?

A

Uninitialised variables.

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

What permissions should the .bss section have?

A

Writeable but not executable.

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

What permissions should the .data section have?

A

Writeable but not executable.

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

What does the .bss section in an object file contain?

A

The .bss section stores the length of the units of data that are to be stored there.

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

What happens to the .bss section when the executable is loaded into memory?

A

The operating system allocates the amount of memory dictated by the .bss section, to store the uninitialised variables in.

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

What does resw 2, in assembly mean?

A

“Reserve” 2 words: 2x 16-bit variables worth of space.

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

How would you reserve 2 bytes of memory using assembly?

A

resb 2

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

How would you reserve 3x32-bits of memory using assembly?

A

resd 3

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

Where are uninitialised variables stored?

A

The .bss section.

17
Q

Where are initialised variables stored?

A

The .data section.

18
Q

What advantage does storing uninitialised variables in the .bss section provide?

A

Disk space is saved when the executable is not loaded into memory, as only the length of an uninitialised variable is stored in the executable.

19
Q

What does resd stand for?

A

Reserve dword.

20
Q

What does resw stand for?

A

Reserve word.

21
Q

How many bits of memory would be reserved by the following line of assembly?

resw 6 ;

A

6 words = 6x16 bits = 96 bits

22
Q

How many bits of memory would be reserved by the following line of assembly?

resd 6 ;

A

6 d-words = 6x32 = 192 bits

23
Q

How many bits of memory would be reserved by the following line of assembly?

resb 6 ;

A

6 bytes = 6x8 bits = 48 bits

24
Q

How many bits of memory would be reserved by the following line of assembly?

resd 2 ;

A

2 d-words = 2x32 = 64 bits

25
Q

How many bits of memory would be reserved by the following line of assembly?

resw 3 ;

A

3 words 3x16 = 48 bits

26
Q

Which syscall is 3 in x86?

A

sys_read

27
Q

What is the call number for the sys_read syscall?

A

3

28
Q

How would you execute a sys_read call in x86 assembly?

A

mov eax, 3 ;

29
Q

Name one type of operand

A

The three types are:

  • Register operand
  • Memory operand
  • Immediate operand
30
Q

What is the third type of operand?

  • Register operand
  • Memory operand
A

Immediate operand

31
Q

What is the third type of operand?

  • Immediate operand
  • Register operand
A

Memory operand

32
Q

What is the third type of operand?

  • Immediate operand
  • Memory operand
A

Register operand

33
Q

What is syscall 8?

A

sys_create

34
Q

What is the syscall number for sys_open in 32-bit x86?

A

5

35
Q

What is syscall 6 in 32-bit x86?

A

sys_close

36
Q

value = 0x00408000

0x00408000 contains “0x54”

If the instruction “mov ebx, value” is issued, what will the value entered into the ebx register be?

A

0x00408000