Now let's discuss some math instructions, so let's create a file called Math Dot Nazan.
And let's once again use the global director of global space, underscore, stop and underscore, start
here and let's surrender and let's right move instruction to move the value to into our register.
Now we want to add eight to this value so we can use add instruction.
So to do that at eight common eight.
So we are adding the value eight to the value to which is stored in Addicks register.
Now let's assume that we want to add the values that are stored in two different registers so we can
do that by using at the first register and the second register.
In this case, we are using 3X as the first register as well as the second register.
So the value that is in X will be added with its own value and then it will be saved in array itself.
So what this means is currently, after executing the second instruction, Arrigo's contains the value
ten after executing this third instruction, ten plus ten 20 is going to be stored in the array register.
Right now let's see how subtraction works.
We can use the instruction sub and I'm going to use our comma five so the value of five will be subtracted
from the value that is stored in the ATX register and the resulting value will also be stored in the
text register.
So in this case, the artifacts currently contains the value 20 and we are subtracting the value of
five.
So Orteig Register now contains value 15.
Now let's see another important instruction, which is increment, as I mentioned, are currently contains
15.
Let's say you want to increment in by one.
We can simply use increment on X..
So now it is going to contain the value of sixteen.
Let's say we want to do it once again.
Increment at X now we can also use decrement instruction to determine the value by one.
So for instance, decrement R X decrement are X, so we are using it twice.
So ultimately, after completing the execution of this program, our idea X should contain 15.
So let's save this program and assemble it and link it and then let's load it in July.
So I'm using nazem math dot nazan bashful math dot o f l 64 and let's link it using early math.
Not all bashful math hender.
Now let's look at it using GDP.
All right, once again, let's set up a break point and the entry point of the program.
And we can clear the screen by using exclamation mark before the command.
So it is going to execute the system command, not on the GDP ship.
So if you hit enter, it is going to clear the screen.
Another way of doing it is to take shelf space clear.
So once again, it is going to execute the command on the system instead of on the Julie Bishop.
So let's hit enter.
Look at that.
So now let's run.
And these are the instructions that we have written in our assembly program, once again, if you notice,
the attic's is replaced with IEX, this could be once again because of the optimisations smeared before
starting to execute these instructions.
Let's examine what we have in the ATX register.
As you can see, the orange register currently contains the value zero, so it's type site.
Now to check the value of attacks registered, you don't have to always go to the register section.
Instead, we can also type the command info that registers.
If you notice the info registers, come on is basically showing us all the registers.
Now, let's assume that you don't want to see the output of all the registers.
You want to see only the ATX register.
You can do that.
InfoSpace registers and Addicks.
There you go.
It can be further simplified.
We can just use E-Space ah instead of typing the complete info registers and we can type that.
I just remember looking back, we are still getting the same output now.
This is another way to examine the registers.
So I'm clearing the screen and I'm typing S.I.
So the next instruction is going to be executed.
What is the next instruction that is.
Ad rates come up eight devaluate is going to be added to the value that is currently stored in Attic's
register.
So currently, too, is stored there.
So it is going to become ten and ten is going to be stored in attics register after executing the next
instruction.
So let's take a aside and let's try MySpace are irex look at that hexa a which is decimal point.
Now we want to add the value of registering with itself and we want to store in Artex again.
So now after executing this instruction codecs is going to contain the value of twenty.
So let's assign.
And let's use in for registers once again and look at that, Hecks 14 is 20.
I can quickly assure that using the calculator I'm using this calculator here, I'm just typing 14 and
let's move to decimal and D'Arrigo, it is 20.
Now the next instruction that we are going to execute is sub artex, comma, hex five, which means
five is going to be subtracted from the value of ATX, which is 20 here, and the resulting value should
be 15.
So let's type aside and once again examine the register.
Artex, look at that.
We have zero x f once again, let's type zero x F here and let's check the decimal equivalent of it
and look at that.
It is 15.
Now, the next instruction that we are going to execute is increment at X, so this is going to become
sixteen.
Let's take Essi and let's examine our X..
Look at that.
It is zero x 10 now, which is equal to decimal sixteen.
So I'm just going to show that.
Look at that.
It is 16 now we have one more increment in structure, which is going to increment the value stored
in this register.
So let's step aside and let's examine the area for this and look at that in became Hecks 11.
Now, the next instruction is going to diclemente the value by one.
That means we are going backwards.
Now, if I execute a site, it is going to become Heggs 10.
Look at that.
We are once again documenting this value of ADEX register.
So let's try a site and examine the Register X.
Look at that, we have gotten zero access into the ATX register once again, so this is how we can make
use of add some increment and decrement instructions in 64 bit assembly language.