Intro to Assembly Flashcards

Introduction to SLAE course on pentesteracademy.

1
Q

What is Assembly Language?

A

Assembly is a low level programming language which allows for direct communication with the microprocessor. This is specific to processor type, and has an almost one to one correspondence with machine language.

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

How is Assembly Language processed, compiled and executed?

A

The .c or .cpp source code file is initially passed through a preprocessing stage. Following this, the preprocessor directs the output through to the compiler; which outputs an assembly language file. The compiled output is then passed to the assembler, to generate an object file. The Linker then takes the object files / any other shared libraries required, and produces an executable. Finally, the executable is loaded into memory via the Loader, where it is run.

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

What is the CPU

A

The CPU is the area in computer architecture in which instructions are decoded and executed. The CPU consists of 4 main components: Control Unit, Execution Unit, Registers and Flags.

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

What is the Control Unit in CPU architecture?

A

The Control Unit is responsible for retrieving and decoding instructions, as well as retrieving and storing data in memory.

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

What is the Execution Unit in CPU architecture?

A

The Execution Unit performs the execution of CPU instructions.

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

What are the Registers in CPU architecture?

A

Internal memory locations used as variables.

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

What are the Flags in CPU architecture?

A

Used to indicate various “events” during execution.

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

What are the Segment Registers?

A
CS: Code Segment
DS: Data Segment 1
SS: Stack Segment
ES: Data Segment 2
FS: Data Segment 3
GS: Data Segment 4
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is SIMD?

A
Single Instruction Multiple Data is an instruction extension implemented by Intel. Extensions include:
- MMX
- SSE
- SSE2
- SSE3
Uses MMX and XMM registers.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the three IA 32 modes of operation?

A

Real Mode:

  • At power up or reset
  • Can only access up to 1 MB of memory
  • No memory protection
  • Privilege levels (Kernel vs User space) not possible

Protected Mode:

  • Up to 4 GB of memory
  • Memory protection / privilege level / multi-tasking
  • Supports virtual-8086 Mode

System Management Mode:
- Used for power management tasks

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

What are the three Memory Models?

A

How does the processor address the memory? There are three options - Flat Model, Segmented Model & Real-Address Mode Model.

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

What is the Flat Model?

A

Addresses are linear across an address space, and any address can be accessed directly.

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

What is the Segmented Model?

A

A segment selector and an offset in that segment are used to access specific locations in memory.

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

What is the Real-Address Mode Model?

A

A special case of the Segmented Model.

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

What Mode of Operation and Memory Model is used by 32-Bit Linux systems?

A

32-Bit Linux uses Protected Mode and Flat Memory Model. As such, there is:

  • 4 GB of addressable space (2^32)
  • Memory Protection
  • Privilege Levels of Code
  • Segment registers which point to segment descriptors (Global/Local/Interrupt Descriptor Tables)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are three commands that can be used to view memory mappings in 32-Bit Linux?

A
  1. pmap -d [PID]
  2. cat /proc/[PID]/maps
  3. gdb [filename], break main, info proc mappings