All right, guys, welcome back.
In this section, we talk about the PC register.
This one is a special register that is holding our this object.
Therefore, we write a little piece of code and afterwards we analyze this code and then we switch back
to the slides and we will repeat this step, because by explaining this in two different ways, we will
learn this a lot faster.
All right, let's go.
Let's switch to our Ubuntu VM and then we write our year PC register code.
So therefore we go into the Android studio and tools Android studio bin bash studio dot as.
Okay.
The ID has finished loading.
Now we extend our player class with a set and get method.
We start with the get method so public and get power.
We do not have the parameter and we simply just return our power value.
Return this power.
That's all.
If you call this method, our power value will be returned.
All right, let's build this application and then we are going to analyze the smiley code on this.
The bid process has been already finished, but I missed the window.
Then I simply click into the event log and here we can see.
All right, locate a new terminal and we decompile this application.
No, not signing APK Tool D.
There we go.
Okay.
We go into app smiley.
Com app hacking smiley one.
And here we have our player dot smiley file.
Let's open this with the weather studio code editor, code player, dot smiley.
I'm also choosing the highlighting for the Java code.
Yes, it's not a Java code, but the highlighting match.
And there we go.
This is our power method.
Now I get out my graphic tablet and then we will take a look into this.
Okay, let's recap what we already know.
We've got a method public get power.
So we write this down next here, get power.
We do not have any parameters within this method, but this method is returning an integer value.
Okay.
I guess that's not bad.
Now we've got the local register and this one seems a little bit interesting.
We can also find this over here and here.
So we've gotten zero register, but we didn't have an local variable in this function, did we?
Let's have a look back into this.
So it does not have any local variables there.
Why is there this would be zero register.
Let's have a look back into this code.
Okay.
Let's have a close look into the next line.
This one over here, and I'm going to clean all these dots and this one.
Awesome.
So we do not know what this I can be 0p0.
And this value afterwards means we will learn about this in the next section where we have a look into
dalvik up codes.
For now I can tell you I get means we've got this, I get over here, then we've got to be zero.
Then we've got this P zero, which is by the way, the reason for the section our this and what I get
does it it takes this this value over here so this power and stores it into V zero and now it's clear
why we've got this V zero because if you take a look on to the right side, once again, we are returning
an integer value over here, but we cannot return.
For example, this one, we cannot write this statement.
Into the return value over here because if you take a look back into our CPU model.
So here's our CPU.
The pins are getting.
Not even better, but we do not care about this one.
But our CPU cannot understand this.
As it is this object our CPU needs to split up or the assembly code needs to split up this into single
instructions and therefore its generating and buffer for this value.
And this is what we zero is over here.
So our V0 is some kind of buffer that is holding or storing this value and then it's returning this
value in this register.
So this one is holding our this dodge power.
And afterwards, the CPU doesn't have to use this statement over here because it cannot understand this
one.
It can simply say, return we zero and this is now holding our power.
So registers are not always regarding to local variables.
Registers can also be some kind of placeholder for certain values or functions.
Return values, whatever.
Okay, this is really important.
If you see some locals, it doesn't always means we've got also a local variable here.
Like for example, in my power or things like this, it can also mean that the compiler has created
some kind of buffer in form of a register.
For example, be zero.
And this one is then holding the value for this.
This object over here and this register can be returned afterwards.
And this is a way that the assembly code understands afterwards.
So by returning back this value in this register, the code can move on on that point because it understands
what registers are.
All right, let me clear the screen real quick and then we take a look into this PC row object.
All right.
We know P zero is a special register that is holding over this object so we can replace this one or
yeah, rename this one to this.
So if you see P zero, you can rename this to this.
Then we've got this column and then we've got our type definition of class which is referenced by this
capital.
L What class do we have here?
We have com ab hacking smiley player.
So our class definition ends at this sign.
So we've got our player class.
This is player.
And then we've got this year a little bit strange looking arrow over here.
And this arrow, you can think of this as an dot, so you can replace this as an dot.
And then, you know, okay, play at dot power.
And at the end of this, you can also see the type definition of this one of this power level, what
is power variable?
And this one is an integer.
And to summarize this whole line, we can this make a little bit easier.
So we've got our this.
And then we can say thought power and that's it because we do not need this reference.
This is just regarding to the Somali object that it knows what this over here.
This.
It's really hard to.
I hope you can follow by explaining this in this way.
So this needs to be referenced or it needs to be clear to the Somali code what type of object this is.
And here we can see this one is player object, but we do not have to use it in this way.
We can simply say this and then treat this arrow as in dot, and afterwards there's this label or this
variable name, what's referenced.
Okay, so this is the first explanation.
Now let's have a look back onto the slides and explain it in a different way.
And maybe if you have questions regarding to this explanation, I hope they will be answered in the
next one.
And if not, then of course, if you do not understand this topic right now, then please write me some
messages.
Okay?
So I'm going to insert this one into my graphic template and then we have a look back onto the slides.
Let's switch back.
Okay.
Here we have this method once again.
We've got our local one, which is our V0 register, and we also got this P zero which is referencing
to the player class.
And after this arrow we can see the player class dot power value.
Why do we have this register right now?
Because if we use this expression, we get this power.
And if you are trying to return this statement, this is not working because we can only act on registers.
We cannot act on direct objects in this way.
Therefore, we are buffering the value of this object in a V0 register.
And by having this value in this V0 register, we can easily return this afterwards.
Therefore, we are having a local register, but we do not have local variable regarding to this register.
This one is some kind of buffer placeholder to store this value of this power.
And regarding to this power, we can separate this in this way.
P zero means this object.
So we translate p zero with this.
And after what we can simply look at the arrow and then we can say this dot and the label after this
arrow, in this case this dot power.
If you would only have this p zero power, we would not know which class we are referencing right here,
because this can be also a different class.
And in that class or things like this, therefore the smiley code is also appending this, that it's
crystal clear that we are using this, this object from the player class.
And yeah, it looks a little bit overwhelming at the beginning, but if we split it up in this way,
it will become, yeah, easier to read.
And if you do this a lot, you will get practice and then you immediately recognize, okay, this one
is this dot power reference and it gets thought into the v zero the storage with the I get this is what
we learn.
Next we'll have a look into dalvik of codes and then we can read our first programs where we add and
subtract some values and we can also start writing our own smiley code.
But we are not doing this for now.
We will yeah, we will have some time regarding to this topic.
Okay.
We do the step by step.
If you have any questions regarding to this this object or this code over here, then please write me
a message.
And regarding to the I get object, we will learn more about this in the next section.
So I see you there.
So registrars are not always regarding to local variables.
Registers can also be some kind of placeholder for certain values or functions return values, whatever.
Okay, this is really important.
If you see some locals, it doesn't always means we've got also a local variable here.
Like, for example, in my power or things like this, it can also mean the assembler code has to create.
It can also mean the compiler has to create a kind of buffer to store this value from this object.
It can also mean it can also mean that the assembler code has come.
It can also mean that the compiler has to create a kind of buffer which stores this value and then can
act on this.
It can also mean that the compiler has created some kind of buffer in the form of a register.
For example, be zero.
And this one is then holding the value for this object over here and this register can be returned afterwards.
And this is the way.
And by doing.
And by doing this in this way.
This is the code.
And by doing this in this way, we do not have to care about memory.
And this is a way that the assembly code understands afterwards.
So by returning back this value in this register, the code can move on on that point because it understands
what registers are.
All right.
Let me clear the screen real quick, and then we take a look into this PC row object.
So here we've got our P zero.
Let's have a look into this section.
This over here.
PC row is our this.
So if you see PC row like this, you can also translate it as in this.
So this is p zero.
And then you can imagine often dot afterwards, if you see this colon, you can imagine of this dot.
And now we've got our familiar type definition.
This capital L, this capital L over here means.
We've got a class in this class is referencing this this object.
So what do we have here?
We have comm app hacking, smart one player.
So this one is our player.
This is our player object.
And then we've got this one over here.
Okay.
Let's have a look into this p0a little bit more detail because this is what this section is about.
Let's have a look into this.
Okay.
Let's have a look into this PC row object because this is also what the section is about.
So I try to draw.
That's not a really good rectangle.
Hmm.
Okay, let's have a look into this PC row object, because this is what this section is about.
So we are now focusing on this part over here.
Okay.
So we've got P0, then we've got a colon and then we've got our L and this capital L means okay, we
have a class reference in this case.
We can see this class references com a pecking smiley player.
So we've got our player class over here.
Hmm.
Let me draw it this way.
After this player class, this got this strange arrow.
Okay.
Let's have a look.
Okay, let's have a look into this PC raw object.
More detail, because this is what the section is about.
Right.
Let me zoom in a little bit.
Not this way.
This way.
Okay.
So we are now focusing on this part over here.
Okay.
We know pieces on this one over here, over this object.
So you can replace PC Row with this.
Okay.
Now let's focus on this part over here.
All right.
We know P0 is a special register that is holding over this object so we can replace this one or yeah,
rename this one to this.
So if you see P zero, you can rename this to this.
Then we've got this column and then we've got our type definition of class which is referenced by this
capital.
L What class do we have here?
We have com app hacking, smiley player.
So our class definition ends at this sign.
So we've got our player class.
This is player.
And then we've got this year a little bit strange looking arrow over here.
And this arrow, you can think of this as a dot, so you can replace this as a dot and then, you know,
okay, play at dot power.
And at the end of this, you can also see the type definition of this one of this power level, what
is power variable?
And this one is an integer.
And to summarize this whole end, to summarize this whole line, we can this make a little bit easier.
So we've got our this.
And then we can say thought power and that's it because we do not need this reference.
This is just regarding to the smiley object that it knows what this over here, this, this.
It's really hard to.
I hope you can follow by explaining this in this way.
So this needs to be referenced or it needs to be clear to the Somali code what type of object this is.
And here we can see this one is in play object.
Okay, but we do not have to use it in this way.
We can simply say this and then treat this arrow as and dot.
And afterwards there's this label or this variable name, what's referenced.
Okay, so this is the first explanation.
Now let's have a look back onto the slides and explain it in a different way.
And maybe if you have questions regarding to this explanation, I hope they will be answered in the
next one.
And if not, then of course, if you do not understand this topic right now, even after, and if not
and if not, then please write me some messages.
Okay.
I have to adjust the.
Then please write me some messages.
Okay.
So I'm going to insert this one into my graphic template and then we have a look back onto the slides.
Let's switch back.
Okay.
Here we have this method once again, we've got our local one, which is our V serial register, and
we also got this P zero which is referencing to the player class.
And after this error we can see the player class dot power value.
Why do we have this register right now?
Because if we use this expression, we get this power.
And if we try to return this power, the assembly code cannot do anything with this argument or with
this instruction because at least this isn't cut.
And if we try to return this code and if you are trying to return this object, this is not working
because the registers.
Okay.
And if we are trying to return this.
And if you are trying to return this statement, this is not working because we can only act on registers.
We cannot act on direct objects in this way.
We have to store them.
We have to store these values into registers.
And therefore, we cannot return this whole object, and therefore we cannot simply return this p zero
object, this this object, and therefore we cannot simply return p zero colon l comma packing smiley
one player semicolon error power.
So this object cannot be returned in this way.
Therefore, we are buffering the value of this object in av0 register.
And by having this value in this v zero register, we can easily return this afterwards.
Therefore, we have a local register, but we do not have an local web.
Therefore we are having a local register.
But we are not.
Therefore we are having a local register.
But we are do not come.
Therefore we are having a local register.
But we do not have an.
Therefore we are having a local register.
But we do not have a local variable regarding to.
But we do not have.
But we do not have a local variable regarding to this register.
This one is some kind of buffer placeholder to store this value of this power.
And regarding to this power, we can separate this in this way.
P0 means this object.
So we translate p zero with this and afterwards we can simply look at the arrow and then we can say
this dot and the label after this error.
In this case, this dot power.
In case if you look at the smart record you have, if you would only have this p zero power, we would
not know which class we are referencing right here because this can be also a different class.
And in that class or things like this, therefore the smiley code is also appending this, that it's
crystal clear that we are using this, this object from the power class.
That we are using this, this object from the player class and yeah, it looks a little bit.
Yeah, it looks a little bit overwhelming at the beginning and yeah, it looks a little bit overwhelming
at the beginning.
But if we split it up in this way, it will become, yeah, easier to read.
And if you do this a lot, you will get practice and then you immediately recognize, okay, this one
is this dot power reference and it gets thought into the v zero the storage with the I get this is what
we learn.
Next we'll have a look into back up codes and then we can write our or and then we can read our first
programs where we add and subtract some values and we can also start writing our own approach and we
can also start writing our own smiley code.
But we are not doing this, but we are not doing this for now.
We will yeah, we will have some time regarding to this topic.
Okay.
We do the step by step.
All righty.
So.
So if you have any questions regarding to this this object, please write me some messages.
I will also I will, of course, get back in touch to cut.
All righty.
If you have any questions regarding to this this object, then feel free to come.
All righty.
If you have any questions to this this object, then, yeah.
Write me a message.
Of course.
All righty.
If you have any questions regarding to this this object, then write me a message.
Of course.
And.
Yeah.
And otherwise.
I'm looking forward to see you in the next section where we define cut and otherwise.
I'm looking forward to see you in the next section where we're going to learn a little bit more about
those type of codes.
And by having this table reference, it will become easier.
If you have any questions regarding.
Alrighty.
If you have any questions regarding to this, this object or this code over here then please write me
a message.
But I guess by doing this and practicing more and more, it will become it will be it will become more
clear to you what this whole instruction does.
And regarding to the I get object, we will learn more about this in the next section.
So I see you there.