Hello, this is Dr. Miller, and this
is Episode 12, that 12 of assembly.
Today, we're going to again talk
about conditional execution, but
we're going to talk about it Bloks.
So, Thelma, it conditional
execution, so
Thum two does not have the bits
for standalone conditional
instructions, but
in order to compensate for that a
little bit, it does have it blocks.
And so these are going to be
available for both Thum, too,
and armed mode.
And then when you get into ALM
version eight, it actually deprecate
this functionality and removes it.
So what are it? Blocks.
So it blocks are if then
blocks and they allow up to
four different instructions to be
conditionally executed
and they run in armed thumb to mode.
So we have this set of instructions
i t t e q
and then we have three instructions
that follow this particular example.
So an I.T.
block, so it's I.T.
and then it's followed then by
X, Y and Z and then
some flag that we care about.
And so X, Y and Z can
be either T or E.
So they are one of the two letters,
T or E, and then
the number of them is optional.
So we can have zero, one, two
or three
and then the conditionals must be
ordered correctly based on
what you're doing with them.
So the T is then.
So that must match our condition,
the E is else and it must
be the opposite of our condition.
And then the flag is one of those
conditional suffixes that we have
seen.
So again, we've seen the suffixes
like equal, not equal,
greater than or equal to less than
greater than less than equal are
typically the ones that you're going
to see.
So here are some example it blocks,
and so one of the things that you're
going to see is that if I have two
T's, then those
will have to match this condition.
So IQ, IQ, IQ
and then our else is something that
is not IQ or the opposite of IQ
is not equal.
So this it block
has I t t
e and so we got it then
then and then unless or
if then else.
So I got it then.
So we got a negative.
Am I as negative
and post positive.
And so these conditions have to
match what's in our IQ block
or we can have an it.
So we got three thens,
right, so if negative
here, I got three different negative
instructions that I can use for
that.
Or it and then.
So I got one then
and two ELSS, so
one then
GTI and then we got
less than equal to less than equal
to in that one.
So here's an example using the
if then blocks so we can see
that we have a function here and it
says be a line too.
So we're relying on to buy
boundaries. And then this is a thumb
function and then
our function bar is going to
move our zero into our one
and then compare our zero to the
number ten.
And then it's got it.
If then that
if then then
else.
So we've got to thens
two equals and then a not equal
so we can move in to our zero the
number one, and then subtract
the number one from R zero
or we do move
R zero one hundred.
And so this one, if you type
10 it'll give you the number zero
and if you
type something that's not equal to
ten, it'll give you the value one
hundred.
And so this is a roundabout
way of doing it. I could have just
done the move zero for
it, but I wanted to show that if
then block inside of their.
Oh, and again, you're doing
a branch of Lincoln Exchange Rate,
so I'm setting the link register and
then I'm also exchanging instruction
sets to jump into a bar because this
is a regular arm function
and this is a thumb function.
But we can see that this is
also useful for not doing Thomond,
so it works both ways.
So all I did in this is
I just did a branch and a link and I
didn't do an exchange.
And then I removed the header from
my thumb code and I can use the
exact same code
if this is an arm block or if this
is a thumb block.
So today, we talked about some
conditional execution using
it Bloks.
Looking forward, we will give an
I.T. block example.
And then here's our quiz, so for an
IT block, what does the T and the E
stand for?
So stands answer then and E
stands for else.
If you have questions, you can email
me, Miller, MJ at you, keda, edu,
and you can find me on Twitter at in
the House 30.