WEBVTT

00:00.570 --> 00:07.380
Now let's discuss some math instructions, so let's create a file called Math Dot Nazan.

00:09.750 --> 00:18.060
And let's once again use the global director of global space, underscore, stop and underscore, start

00:18.060 --> 00:26.730
here and let's surrender and let's right move instruction to move the value to into our register.

00:27.570 --> 00:33.830
Now we want to add eight to this value so we can use add instruction.

00:34.050 --> 00:38.220
So to do that at eight common eight.

00:38.690 --> 00:43.890
So we are adding the value eight to the value to which is stored in Addicks register.

00:44.370 --> 00:50.160
Now let's assume that we want to add the values that are stored in two different registers so we can

00:50.160 --> 00:55.430
do that by using at the first register and the second register.

00:55.800 --> 01:01.240
In this case, we are using 3X as the first register as well as the second register.

01:01.680 --> 01:11.040
So the value that is in X will be added with its own value and then it will be saved in array itself.

01:11.430 --> 01:18.390
So what this means is currently, after executing the second instruction, Arrigo's contains the value

01:18.420 --> 01:26.230
ten after executing this third instruction, ten plus ten 20 is going to be stored in the array register.

01:27.000 --> 01:30.180
Right now let's see how subtraction works.

01:30.720 --> 01:40.200
We can use the instruction sub and I'm going to use our comma five so the value of five will be subtracted

01:40.200 --> 01:46.710
from the value that is stored in the ATX register and the resulting value will also be stored in the

01:46.920 --> 01:47.760
text register.

01:48.150 --> 01:54.840
So in this case, the artifacts currently contains the value 20 and we are subtracting the value of

01:54.840 --> 01:55.260
five.

01:55.560 --> 01:59.730
So Orteig Register now contains value 15.

02:00.390 --> 02:07.920
Now let's see another important instruction, which is increment, as I mentioned, are currently contains

02:08.310 --> 02:08.910
15.

02:09.300 --> 02:11.790
Let's say you want to increment in by one.

02:11.950 --> 02:14.940
We can simply use increment on X..

02:15.280 --> 02:17.770
So now it is going to contain the value of sixteen.

02:18.330 --> 02:20.100
Let's say we want to do it once again.

02:20.280 --> 02:27.300
Increment at X now we can also use decrement instruction to determine the value by one.

02:27.720 --> 02:34.710
So for instance, decrement R X decrement are X, so we are using it twice.

02:34.950 --> 02:42.460
So ultimately, after completing the execution of this program, our idea X should contain 15.

02:43.110 --> 02:49.560
So let's save this program and assemble it and link it and then let's load it in July.

02:50.340 --> 03:05.160
So I'm using nazem math dot nazan bashful math dot o f l 64 and let's link it using early math.

03:05.160 --> 03:09.310
Not all bashful math hender.

03:10.110 --> 03:12.180
Now let's look at it using GDP.

03:15.020 --> 03:20.090
All right, once again, let's set up a break point and the entry point of the program.

03:22.020 --> 03:26.810
And we can clear the screen by using exclamation mark before the command.

03:27.090 --> 03:31.760
So it is going to execute the system command, not on the GDP ship.

03:32.340 --> 03:35.040
So if you hit enter, it is going to clear the screen.

03:35.400 --> 03:39.090
Another way of doing it is to take shelf space clear.

03:39.510 --> 03:45.100
So once again, it is going to execute the command on the system instead of on the Julie Bishop.

03:45.420 --> 03:46.290
So let's hit enter.

03:47.500 --> 03:48.020
Look at that.

03:48.100 --> 03:49.870
So now let's run.

03:51.550 --> 03:58.060
And these are the instructions that we have written in our assembly program, once again, if you notice,

03:58.060 --> 04:05.410
the attic's is replaced with IEX, this could be once again because of the optimisations smeared before

04:05.410 --> 04:07.530
starting to execute these instructions.

04:07.540 --> 04:10.600
Let's examine what we have in the ATX register.

04:15.090 --> 04:21.030
As you can see, the orange register currently contains the value zero, so it's type site.

04:22.880 --> 04:28.930
Now to check the value of attacks registered, you don't have to always go to the register section.

04:29.330 --> 04:34.250
Instead, we can also type the command info that registers.

04:35.780 --> 04:40.820
If you notice the info registers, come on is basically showing us all the registers.

04:41.240 --> 04:45.290
Now, let's assume that you don't want to see the output of all the registers.

04:45.290 --> 04:47.800
You want to see only the ATX register.

04:48.350 --> 04:49.130
You can do that.

04:49.340 --> 04:54.150
InfoSpace registers and Addicks.

04:55.120 --> 04:56.050
There you go.

04:56.360 --> 04:57.890
It can be further simplified.

04:58.130 --> 05:05.600
We can just use E-Space ah instead of typing the complete info registers and we can type that.

05:05.600 --> 05:09.860
I just remember looking back, we are still getting the same output now.

05:09.860 --> 05:11.870
This is another way to examine the registers.

05:12.410 --> 05:16.610
So I'm clearing the screen and I'm typing S.I.

05:16.850 --> 05:19.600
So the next instruction is going to be executed.

05:19.940 --> 05:22.370
What is the next instruction that is.

05:29.890 --> 05:38.110
Ad rates come up eight devaluate is going to be added to the value that is currently stored in Attic's

05:38.110 --> 05:38.630
register.

05:38.650 --> 05:40.790
So currently, too, is stored there.

05:41.020 --> 05:47.590
So it is going to become ten and ten is going to be stored in attics register after executing the next

05:47.590 --> 05:48.230
instruction.

05:48.610 --> 06:00.290
So let's take a aside and let's try MySpace are irex look at that hexa a which is decimal point.

06:01.120 --> 06:07.940
Now we want to add the value of registering with itself and we want to store in Artex again.

06:08.320 --> 06:14.520
So now after executing this instruction codecs is going to contain the value of twenty.

06:14.980 --> 06:16.180
So let's assign.

06:18.080 --> 06:24.020
And let's use in for registers once again and look at that, Hecks 14 is 20.

06:25.140 --> 06:32.430
I can quickly assure that using the calculator I'm using this calculator here, I'm just typing 14 and

06:32.430 --> 06:35.690
let's move to decimal and D'Arrigo, it is 20.

06:36.300 --> 06:44.310
Now the next instruction that we are going to execute is sub artex, comma, hex five, which means

06:44.310 --> 06:52.470
five is going to be subtracted from the value of ATX, which is 20 here, and the resulting value should

06:52.470 --> 06:53.280
be 15.

06:53.700 --> 06:58.380
So let's type aside and once again examine the register.

06:58.380 --> 07:01.190
Artex, look at that.

07:01.230 --> 07:10.740
We have zero x f once again, let's type zero x F here and let's check the decimal equivalent of it

07:11.430 --> 07:12.150
and look at that.

07:12.150 --> 07:13.040
It is 15.

07:13.650 --> 07:21.720
Now, the next instruction that we are going to execute is increment at X, so this is going to become

07:21.750 --> 07:22.410
sixteen.

07:23.010 --> 07:26.970
Let's take Essi and let's examine our X..

07:27.990 --> 07:28.590
Look at that.

07:28.590 --> 07:33.550
It is zero x 10 now, which is equal to decimal sixteen.

07:34.170 --> 07:35.940
So I'm just going to show that.

07:40.020 --> 07:40.600
Look at that.

07:40.650 --> 07:47.760
It is 16 now we have one more increment in structure, which is going to increment the value stored

07:47.760 --> 07:48.550
in this register.

07:48.960 --> 07:56.310
So let's step aside and let's examine the area for this and look at that in became Hecks 11.

07:56.820 --> 08:00.990
Now, the next instruction is going to diclemente the value by one.

08:01.440 --> 08:03.150
That means we are going backwards.

08:03.300 --> 08:08.150
Now, if I execute a site, it is going to become Heggs 10.

08:10.860 --> 08:11.460
Look at that.

08:12.150 --> 08:16.560
We are once again documenting this value of ADEX register.

08:16.890 --> 08:20.910
So let's try a site and examine the Register X.

08:22.380 --> 08:29.670
Look at that, we have gotten zero access into the ATX register once again, so this is how we can make

08:29.670 --> 08:37.380
use of add some increment and decrement instructions in 64 bit assembly language.
