Assembly language instruction.
JB signifying jump.
If below is a vital tool for controlling program flow based on a specific comparison condition.
It is commonly employed for signed and unsigned integer comparisons.
The JB instruction dictates program execution by prompting a jump if one value is less than another
value.
So here's a brief rundown of this comparisons here.
At first we are comparison process.
So we are comparing two values which can be sourced from registers, memory or immediate values.
Condition.
Check if the first value is less than the second.
The jump takes place.
Jump or sequential execution.
If the condition holds true, the program jumps to a designated location or label, and if not, it
continues executing.
And now what we're going to do is we will just see a basic example here.
So.
CMP.
A x.
B.
X.
And JB below.
Below.
And here, as you can see, here we are.
Compare the values in registers A x and b x.
And here jump.
We are telling the assembly to jump.
If a x is less than b x.
And in this example, a jump to below label occurs if the value in register a x is less than the value
in register b, x and JB Blanc alongside other conditional jumps like a jump off, a jump above or equal
g jump if equal constitutes the fundamental basis of control flow, these instructions empower programmers
to devise intricate algorithms and logical constructions at a low level of abstraction and essential
for effective assembly language programming.
As I tell you always.
And now we always do.
Um, here we will create another sample application here.
And this is so after this lecture, there's just one more lecture that we will discuss the JB jump if
lesser or equal in next lecture.
And after that we are done with this, uh, logical conditions here and in next lectures.
In the next section, we will use that knowledge and create a big assembly program here.
So here we will create a section.
Uh, data value one.
Value.
Value one DB.
15.
And value to DB.
Uh, value to DB 20 and here we will create a section text.
Also, we will create a global global start.
And here in this start we will start.
They will move all.
Well, you won, so.
Value one and move.
L.
Value to.
And here we are allocating memory for value one and initializing it with 15.
And in the third line we are allocating memory for value two and initializing it with 20.
And here we are loading the value stored at memory address value one into the Al register and we are
doing the same here.
We are loading the value stored in memory address value two into the Belle Register and here we will
compare the value in Al and Belle CMP Al.
An P, a L and P, l, and after that we will use this j P and.
Hello.
So if Al is below.
Uh, Bell.
Here we are jumping, uh, to Yellow label.
And so we are using GB here, which means jump if below.
And here we will create a node below label.
And here you will create this your coding expertise takes.
X spotlight here.
And this here you are addressing scenarios where value one is not below value two.
Right.
So let's make it in parenthesis.
Value one is not below.
Value two.
And we will create another label.
But before this we will call this non label.
So GNP done.
So here we are executing jump to the done label, marking the completion of this section and here we
will also create this below label.
This is for.
Uh.
We are.
This is for the.
A chord here for cases where value one is indeed below value two.
So.
According.
Holding.
Or.
Court cases where value of one is below.
Value one is below.
Value two.
And after that we will also create our own label.
Lon.
Um, and this is our gateway for exit related instructions.
Related court.
And here we will, as we always do.
We will.
Analyze it from beginning.
And in this data section at the second line here, as you can see.
A memory location is designated for value one.
Initialized with 15.
And here, similarly, memory is allocated for value.
Two is initialized with 20.
And here our exploration begins with the Move instruction which transfers the value stored at the memory
address value of one into the Al register and Parallelly.
The Move instruction performs the same action for value two.
Um, where uh, moving its contents into the register and this is a pivotal juncture arrives as the
CMP instruction engages in a meticulous comparison between the contents of Al and b l, and here this
is a direction of our journey hinges on the outcome.
So if Al is determined to be below b l the JB jump if below instruction propels us to the below label.
And here in note below within this space here, your technical technical expertise takes center stage.
Um, paving the way for inventive solution tailored to scenarios where value one is not below value
to.
And in this here we are leap to the.
Now this is a leap to down label signals, the culmination of this segment.
And here below here you are coding, uh, finds expression shaping code specifically catered to scenarios
where value one is indeed below value two and this is the final stages of our journey unfolded at the
down label.
Uh, so your canvas for exit related instructions that conclude this program's execution here.
And as we traverse this assembly code, we plunge deeper into the realm of conditional branching and
comparisons, uncovering the nuances of scenarios where value one is below, value two and armed with
the sound of understanding of this integrate mechanisms, you are well equipped to navigate the complexities
of assembly programming with confidence.
So your ongoing pursuit of assembly, uh, programming knowledge will undoubtedly prove to be both enlightening
and transformative.
Continuing to explore the applications of assembly programming with enthusiasm and determination and
happy learning.
And in next lecture.
In next lecture, it will be our last lecture about this.
So.
And I'm waiting you in next lecture.