Hello everyone.
I'm Typhoon and welcome back to another awesome lecture here.
So today we are going to start our journey into the world of low level programming by understanding
something called a r m assembly language.
Now if you have heard of it, you might already know it is critical for analyzing how software works
on ARM based systems like your smartphone, tablet, or even many embedded systems.
But what exactly is assembly language and why should we care about it?
So if we.
Like high level.
And low level.
Right.
Low level.
So most programmers today write code in high level languages like Python.
C plus plus C even C here.
And these are easier to read and understand.
They look a bit like English and are designed for humans to work with.
And even Java or JavaScript.
Not exactly JavaScript, but like C sharp.
And so on and so forth.
However, in your computer's brain, the CPU.
Doesn't understand these high level codes.
So it only understands machine code, which is made up of long sequences of zeros and ones.
And to bridge this gap, high level code is compiled into a binary machine code, which is actually
what runs on the hardware.
Now here's where assembly comes in.
So assembly language is human readable version of machine code.
Which is made up of long sequences of zeros and ones.
Now to bridge this gap, high level code is compiled into a binary.
Machine code, which is what actually runs on the hardware.
But in this phase here we have lots of, um, things like linking libraries and which you will learn
that, but basically high level code.
This final destination is binary, which is a low level code.
Now here's where assembly comes in.
So assembly language is human readable version of machine code.
And each assembly The instruction corresponds to a single operation that CPU can execute.
So while the CPU doesn't run assembly directly, it's a critical step between high level code and this
binary here.
So why learn assembly for reverse engineering?
So imagine trying to understand a book written in a strange language without any spaces or punctuation.
That's what raw code looks like.
And now assembly gives us structure and readability.
And in reverse engineering, we often work with binaries or programs where the source code is unavailable.
Now, by learning assembly, especially in the R or X 8664.
We can analyze how these programs work and even find bugs or security Vulnerabilities.
Now, to better appreciate this, let's rewind and talk about how computers started here.
So at the most basic level, computers doesn't understand language like we do.
Instead they deal with electrical signals.
Now these signals are either on or or now on is actually one as computer understand.
But you have learned that in previous lectures in computer architecture.
So it is either 0 or 1 which is on or off.
On corresponds to one and zero corresponds to off.
Now these are represented by the voltage levels.
Now to represent this in a way we can store and manipulate we use this binary system.
Now each bit this is a short for binary digit.
So This is actually means what binary digit.
So one bit can only hold two values.
Not much.
One bit can only hold either 1 or 0.
So let's take an example here.
The number that I will write some random number here to
84334537.
This number in decimal looks in binary are
100010, and so on.
So this is just a random binary number right.
So that is basically what that is basically.
35 bits long.
So you need 35 bits in binary to represent this large number.
Now this is pretty powerful right.
But there's a catch here.
We do.
We know.
How we do know where one number ends and the next begins.
And this is where the concept of byte comes into place.
So early computer designers faced this problem.
Now their solution was to create a fixed size groups of bits.
And these groups are called what bytes?
So how many bits should a byte have now?
Surprisingly, it wasn't always eight bits.
Like we are used to, early systems had either four bit or.
Six bit bytes for instance.
So one byte is either.
In old computers it is one byte was in the four bits or six bits.
For instance, in IBM's early computers used a six bit system called b.
C, d, I, c in the 1950s.
But eventually, with the IBM system
360 and the E, b, c the IC format in the 1960s.
The eight bit, the eight bit here, eight bit byte became the standard.
So today.
Today basically one byte.
One byte equals eight bits.
So you may ask here why eight bits.
The first reason to this question we have three reasons.
Three basic reasons.
The first reason you can represent 256 unique values.
From 0 to 255.
So basically 256 and it is large enough.
So it is large enough to represent every standard letter number or a symbol in a single byte.
And it is efficient.
It is efficient for memory and the storage.
And here's the cool part a byte is just a series of bits.
But how do you interpret those bits?
Depends on the software.
So if you tried to treat it as an unsigned number, we get values from zero inside.
Let's actually write it in a way that.
So in unsigned we have two two types of bytes.
Or numbers on?
Yeah.
On.
Signed and signed.
Let's draw the eight boxes here.
Two.
Three.
Four.
Five.
Six.
Eight.
123.
Four.
Five.
Six.
Eight.
Now remember, these are bits.
Eight bits, both unsigned and signed numbers.
Has eight bits, of course.
Basically, bite is a bite means eight bits.
So.
If we trade a bite as an unsigned number, we get values from 0 to 255.
If we use two's complement, we can get signed values from -128 to.
Plus 127.
So we will go into more detail.
In binary arithmetic and two's complement later.
Uh, but the key takeaway is everything in computers starts from binary which is ones and zeros.
How we organize and interpret them while explaining and uh, this lectures I have, I remember that
uh, in our previous lectures, uh, like, um, probably ten lectures from now on in a section named
Boolean.
Boolean algebra.
We have a lecture named Boolean Algebra for low level computing.
So I highly recommend you watch this lecture.
And in this lecture I have explained how unsigned and signed bits and bytes work.
So how we how we represent from 0 to 255 and how we represent the negative numbers using this signed
numbers.
So thank you for watching.
I'm Tayfun and I'm waiting you in the next lecture.