ASM Instructions Flashcards

1
Q

ADD op1, op2

A

Adds op2 to op1 and stores in EAX

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

SUB op1, op2

A

Subtracts op2 from op1 and stores in EAX

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

XOR EAX, EAX

A

‘Exclusive or’ a register; clears contents of the register

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

INC op1

A

Increment op1 by 1

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

DEC op1

A

Decrement op1 by 1

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

CMP op1, op2

A

Compare (subtract) the value of op1 (register/memory address) with op2 (register/memory address/constant) and set EFLAGS; if op1 = op2 then ZF=1, CF=0; if op1 < op2 then ZF=0, CF=1; if op1 > op2 then ZF=0, CF=0

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

JMP location

A

Jumps to a new location and executes

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

JZ/JE location

A

Jumps to specified location if ZF=1 following a test; JZ usually used to test if something is explicitly 0; JE commonly found after CMP

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

JNZ/JLE location

A

Jumps to specified location if ZF=0 following a test; JNZ usually used to test if something is not set to 0; JNE commonly found after CMP

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

JECXZ location

A

Jumps to specified location if ECX=0

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

AND destination, value

A

Logical AND operation; equiv to & in python; can be used as modulo

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

CALL function_name

A

calls a function; pushes return address (address immediately after CALL) onto stack and changes EIP to destination

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

CLD

A

clears direction flag (DF=0); controls incrementing or decremeting counter

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

(I)DIV value

A

Performs division (dividend = EDX:EAX, divisor = value, following DIV EAX=quotient, EDX=remainder)

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

(I)MUL register, (EAX)

A

Signed multiplication; multiplies two registers (EAX if not specified) and stores product in EDX:EAX

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

LEA destination, source

A

Loads memory address into the destination

17
Q

LODS(B|D|W) register

A

Loads byte/word/doubleword at register address into EAX.

18
Q

LOOP arg

A

Decrements ECX and jumps to arg unless ECX becomes 0.