Hello, my name is Typhoon and in this lecture you will learn about the jump if less or equal.
So jump if less or equal j l e is a conditional jump instruction in assembly language programming that
directs the flow of execution based on a comparison condition.
This instruction is commonly used to make decisions within programs by evaluating whether one value
is less than or equal to another value.
It's particularly relevant in scenarios where signed integer comparison is involved.
So the first stage here, the instruction follows this general process.
The comparison.
The instruction begins by performing a comparison between two values.
So these values would be stored in registers, memory locations or immediate values.
The instruction itself.
The second is conditional check.
The result of the comparison is then used to determine whether the jump should occur in the case of
the jump will take place if either of two.
Matt.
So the first is the first condition is the zero flag is there.
Zero flag is set to one.
This indicating that the values are equal or the sign flag is F sign flag and the and overflow flag.
Like have have the same value, so indicating that the result is negative or equal.
So.
Equal.
And.
There are negative.
And or negative or equal.
And the last is if either of the conditions mentioned above is satisfied, the program's execution flow
is altered and it jumps to a new location specified by a label or memory address.
If the conditions are not met, the program continues executing the subsequent instruction sequentially
without any alteration to its flow.
Now we will, as we always do in this section, we will write another code.
Uh, considering.
This.
Um, and we will build project something like jump if less or we will use this, uh, jelly here.
So now.
Let's get started with this here.
Of course, as we always do, we will.
Uh, firstly.
So let's in this lecture, let's actually write our.
Port with using.
Yeah, we can also use this print f so we make it more functional in this lecture.
But it might take a long time, but you will understand it better.
Or instead of writing print f uh, which is not required at all.
Uh, the in this lecture you will learn the logic and.
Usage of this jar and indents.
In next sections, we will develop our programs according to the, according to this, uh, logical
conditions here and now.
We will as always do.
Uh, we will firstly define the section data.
Uh, here in this data we will allocate memory for value one and initialize it with 15 value.
Value of one DB and 15.
And again, we will allocate memory for value two and initialize it to 15 again.
And here we will create a section text Global Start.
This is the starting point for our program and in start here.
Art.
We will.
Move, Al.
Uh, to value one.
So we are moved.
We are moving the value at memory address value one into the Al and we are doing the same for BL here.
So we are moving the value at memory address value two into the BL.
And here we are going to compare the result, compare the values in L and b, L, cmp, L and b, l.
And we will use the jump if less.
Or equal jelly.
Uh, less or equal equal here.
So here we will jump to less or equal if l is less than or equal to equal to b l, And here we will
write note we will first create a note less or.
Equal here.
So your code.
Here for the case when value one is not less than or equal to value two here.
Right?
So value two and we are going to jump to done done to conclude this section and we will also develop
done here.
Jump JMP done.
And.
We will create a less or equal.
So your code here for for the case when value one is less than or equal actually.
So.
Is not less and here is less than or equal to value.
One value one or value value two.
Let's make this not uppercase to make sure shown yes less than or equal to.
And we will create our exit code.
And this is your exit code here.
And in this session, we are about to embark on an in-depth journey through the assembly code here.
And our.
Goal is to meticulously analyze each line and unravel the logic behind the conditional branching and
comparisons.
So let's begin this and here.
Our journey commences with the declaration of the data section where, um, we allocate memory to store
two variables value one and value two.
Both variables are initialized to 15.
So setting the stage for our comparison again and transitioning to the text section where executable
instructions reside, the Start label serves as our global entry point, as I always say.
Um, and we start by employing this move again.
Uh, move instruction to load the value residing in memory at the address pointed to by value one into
the al register.
Similarly, move instruction transfers the value from the memory location pointed to value two into
the Belle Register.
Following this instruction undertakes a comparison between the value stored in Al and b l.
If the comparison determines that the value in Al is less than or equal to the value in b l, we proceed
to the less.
Or equal labor.
So in scenarios where the comparison result indicates that the value in Al is not less than or equal
to value on PL, we danced to the not less or equal section here.
You will typically insert your custom set of instructions to handle cases where value one is not less
than or equal to value.
Two.
Subsequently, GMP uh, done here.
Uh, instruction enables us to bypass the less or equal to actually.
Yeah, less.
Or equal to.
Uh section and head directly to done label.
And conversely, when the comparison, uh, confirms that the value in Al is indeed less than or equal
to the value in B, we proceed to the less or equal label.
So with this segment, you will typically insert instructions to be executed when value of one is less
than or equal to value.
Two.
And our journey culminates at the done label marking at the end of our program Logic.
So this is the ideal location to include instructions for program termination or any necessary cleanup
might involve system calls or resource management.
And that's it with our lecture.
Uh, jump if less or equal here.
So.
This, actually.
Like, almost.
The chord structure is almost the same as previous ones, but here the logic is different.
So I'm waiting you in next lecture.