Hello and welcome to a new section.
In this section, we are going to study the 64-bit instructions.
So let's take a look at the introduction to x64 instructions.
The Intel CPU is capable of two modes: the compatibility mode and the 64-bit mode.
The compatibility mode is also known as 32-bit mode.
In the compatibility mode, which we have been doing, it is capable of running 32-bit programs.
It has got eight general-purpose registers: -, -, -, -, -, -, -, and -.
It is also capable of 32-bit addressing.
It has got 32-bit flags and 32-bit - registers.
On the other hand, in the 64-bit mode, it can run 64-bit programs.
It has got 16 general-purpose registers, denoted as -, -, -, -, -, -, -, and also it
has got new registers -, - -, all the way to -, and also it has got - and - which refers to the
- and - in 32-bit mode.
It is capable of addressing 48-bit addresses. Although it has got 64-bit address space, the higher
16 bits are not being used for addressing.
It has also got 64-bit flags and 64-bit - instruction register.
To address the various parts of the register, we can study this table.
The first column is the quad word, which refers to the 64-bit registers.
Each register is a quad word.
In the second column, we have the D word.
The last two rows refer to the stack pointer and stack frame.
If we are going to address part of the 64-bit addresses, then we can use -, -, -, - all the way to -
-.
Note that for - to -, we have to add the "d" suffix at the back. - refers to the D word,
the lower half of the quad word. - refers to the lower half of -, - refers to the lower half
of -, and so on.
Similarly, for the stack pointer, top of stack pointer, we will use - for the D word and - for
the stack frame pointer. And if we are going to address the lower half of -, we will use -, -,
-, -, -, -, -, and so on.
And then for the - to -, we will put -. "w" stands for word: -, -, -, and so on.
And for the stack pointer, we will denote it as - and -.
If we are going to address the bytes, the lower half of the lowermost byte, it will be addressed as
-. "l" refers to the lower half of - register.
"h" refers to the higher upper half of - register.
Similarly, we have -, -, -, -, and so on. And for the -, we will use - and - for the -.
For - to -, we will put a "b" suffix at the back: - for the lowermost byte of the - register,
- for - and all the way to - for the stack pointer.
We will put - and -.
Take a look at this example.
Now, - here refers to quad word, the entire 64-bit.
This is the quad word: eight bytes.
Half of it will be -, which is a D word, which is four bytes or 32 bits.
And half of - will be -.
The lower half will be -.
- is a word, also known as two bytes or 16 bits. And half of - will be the lower half, -, eight bits,
"l," and "h" is the upper half of -.
Let's take a look at x64dbg now.
We have two debuggers: x32 and x64.
We need to use x64dbg to study 64-bit programs.
So open x64dbg.
And let's take a look at an example of a 64-bit program.
And here on the right, you will see the registers: -, -, and so on.
They are all now eight bytes.
F0 is one byte, 14 is another byte, 40 is the third byte,
and so on, all the way. There are eight bytes or 64 bits.
And on the address as well, you will see the same thing happening.
There are eight bytes here.
F0 is one byte, F14 is another byte, 40 is another byte, and so on.
All together, eight bytes.
And you can see -, -, -, all the way to -,
and then we have the new registers: -, -, -, all the way to -, and the instruction pointer,
-, is also eight bytes or quad word.
And the instruction flags are also eight bytes or 64 bits.
So this is what it looks like for the 64-bit address and also registers.
That's all for this video.
Thank you for watching.