Assembly OP codes Flashcards

1
Q

how does MOV work in intel arch?

A

remember with x86 Intel syntax it’s MOV [dst] [src])

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

XOR EAX, EAX

A

Performing an ‘exclusive or’ of a register with itself sets its value to zero; an easy way of clearing the contents of a register

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

INC/DEC op1

A

increment or decrement the value of the operand by one

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

ADD/SUB op1, op2

A

add or subtract two operands, storing the result in the first operand. These can be registers, memory locations (limit of one) or constants. For example, ADD EAX, 10 means add 10 to the value of EAX and store the result in EAX

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

CMP op1, op2

A

compare the value of two operands (register/memory address/constant) and set the appropriate EFLAGS value

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

Jump (JMP) and conditional jump (je, jz, etc)

A

as the name implies these instructions allow you to jump to another location in the execution flow/instruction set. The JMP instruction simply jumps to a location whereas the conditional jumps (je, jz, etc) are taken only if certain criteria are met (using the EFLAGS register values mentioned earlier). For example, you might compare the values of two registers and jump to a location if they are both equal (uses je instruction and zero flag (zf) = 1).

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

op code in [ ]

MOV eax, [ebx]

A

When you see a value in brackets such as ADD DWORD PTR [X] or MOV eax, [ebx] it is referring to the value stored at memory address X. In other words, EBX refers to the contents of EBX whereas [EBX] refers to the value stored at the memory address in EBX.

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

Relevant size keywords

A

BYTE = 1 byte, WORD = 2 bytes, DWORD = 4 bytes.

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

PUSH X (x=register)

A

Pushes “values” of register to the top of the stack

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

POP X (x=register)

A

POPs the values of the top of the stack and places them register X

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

how Stack Frames and Functions work

A

When a program function executes, a stack frame is created to store its local variables. Each function gets its own stack frame, which is put on top of the current stack and causes the stack to grow upwards to lower addresses

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

define Little Endian notation. “Endianness”

A

refers to the order in which bytes are stored in memory. Intel x86 based systems employ Little Endian notation which stores the least significant byte of a value at the smallest memory address (which is why the address is stored in reverse order)

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