Hello everyone.
I'm Typhoon here again and in this lecture we are diving deeper into how assembly instructions are translated
into Opcode Bytes, which is the actual machine code.
Your CPU understands and executes.
Every instruction you write in assembly is ultimately turned into a series of hexadecimal bytes stored
in memory.
Now let's break down exactly how this happens.
First, let's answer this question here.
What are opcode bytes?
So each assembly instruction has an equivalent opcode or operation code.
Here this is a binary or hexadecimal code that tells the processor what operation to perform.
Now think of it as the machine level version of an instruction like move or move here.
And this preceding code, the move instruction is equivalent to the B opcode byte and the MOV move instruction
at the 008992 D81 address is equivalent to B nine.
So the difference between the two move instruction is the registers into which the Dword value is moved.
So there are a total of five five bytes consumed in move x uh eight and seven zeros.
And it consists of the opcode byte b eight.
And the operand value is uh eight and seven zeros, which is the same number of bytes is also used in
mov e.
Two and the mul e uh uses uh two bytes as well.
So mov eax So eight and seven zeros located at
00A, 9D7C.
C h.
Here is hexadecimal, uh, and we get to the address of the next instruction with this here.
So leaving the code in the memory, uh, would look like this.
Uh, so address is, uh, let's example, let's actually write this down.
So for example 00A92D7C
the bytes is going to be what be
800000080B9.
You see here B9 zero two.
And again 0000.
And lastly, the F7 and E one.
This is how, uh, the this, uh, operation codes would be looked in a memory.
A dump of memory is usually shown in, uh, memory dumps.
I will write, uh, here, uh, or paragraphs.
So these are the 16 bytes per line and address aligned to ten hexadecimal and assembly language instructions,
as you learned from our previous lecture, are categorized, uh, for the copying and accessing data
instructions.
For example, move uh, arithmetic instructions like add, uh, sop, mul, multiply and the diff here
binary logic instructions uh xor Or not is our role and flow of control.
Uh, example uh GMP call.
Uh cmp and int.
Now that's it with our lecture in summary.
Opcodes are the true form of your assembly instruction.
Uh, the actual bytes that the CPU reads and executes.
And each instruction has a specific byte pattern.
And then understanding how they are laid out helps you reverse engineer software with precision.
Next time we'll look at assembly window or memory dump, and you will be able to spot and interpret
the instruction bytes like a pro.
Stick around.
And this is just the beginning.
We are going to dive deeper.
Thank you for watching and I'm waiting for you in the next lecture.