Assembly Language Flashcards

1
Q

Mnemonics

A

Opcodes, like mov, add and inc

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

Registers

A

Given names like eax, ebx for example.

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

Labels

A

Used to represent memory addresses, like num1 for eaxmple

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

Give an example of a line of assembly code that uses a mnemonic, register and memory address

A

mov eax, num

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

EAX

A

Accumulator register - store calculations

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

EBX

A

Base register - store a location

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

ECX

A

Counter register - for loops purposes

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

EDX

A

Data register - for random data

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

How can you transfer data from one memory location to another?

A

You cannot move something directly from memory to memory -> has to be through registers.

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

CF

A

Carry flag -> previous operation had a carry from the most significant bit.

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

ZF

A

Zero flag -> previous operation had zero results.

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

SF

A

Sign flag -> previous operation was positive (0) or negative (1)

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

OF

A

Overflow flag -> previous operation was too big to fit in memory

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

Jumps

A

Essentially calling a certain part of the code; allows loops (obsidian for examples).

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

Mutual Recursion

A

-> sub1 calls sub2, sub2 calls sub1

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

General case

A

-> bit that calls itself

17
Q

Terminating case

A

-> the bit that causes it to stop

18
Q

Nested Calls

A

-> tree structure of recursion
Factorial and fib can also be examples.

19
Q

Tail recursion

A

-> recursive call is the last statement that is executed by the function.

20
Q

Iterative v Non-Iterative

A

A function which calls itself, compared to a piece of code which doesn’t.

21
Q

scanf and printf

A

Both take arguments from the stack, given in the order which they are pushed onto the stack (FIFO). The format specifier normally has to be first, then the remaining information.
Scanf takes exactly 2, printf takes 1 or more.

22
Q

ESP

A

Stack pointer (points to top of stack).
In certain examples, we increase by 4 bytes to get next instruction, since stacks grow downwards.

23
Q

EIP

A

Instruction Pointer (points at programs next instruction).
In certain examples, we decrease by 4 bytes to get next instruction since it grows upwards.

24
Q

Calling Convention

A

Calling convention is an implementation-level scheme for how subroutines or functions receive parameters from their caller (via the stack).

25
Q

ret

A

Return value for subroutine.

26
Q

PROC and ENDP

A

Labels given at the start and end of a subroutine.

27
Q

call

A

Calls function.

28
Q

xchg eax, ebx

A

Swaps the data in these two registers around.

29
Q

movzx

A

Used to transfer the first character somewhere:
movzx eax, byte ptr [ebx]
Moves the first character of ebx into eax.