WEBVTT

00:01.080 --> 00:04.410
Now let's discuss how we can use some registries.

00:05.280 --> 00:09.990
Let's begin by creating a new file called Sub Registers Got Nazim.

00:16.890 --> 00:27.720
And as usual, let's start with our global director of Global Space and let's start and let's specify

00:27.720 --> 00:28.810
our entry point here.

00:29.850 --> 00:33.480
Now, once again, we are going to use the move instructions.

00:33.750 --> 00:42.060
But instead of using a register like Oryx and RDX, we are going to try to use the sobre histories of

00:42.060 --> 00:43.050
those registers.

00:43.440 --> 00:44.820
So let's get started.

00:45.330 --> 00:50.910
The first let's use move el chromatin.

00:52.020 --> 00:54.480
This is one of the protesters from Artex.

00:55.920 --> 01:00.390
Let's also use more Aage Qamar, 20.

01:02.010 --> 01:05.660
Let's also use move AICS.

01:06.880 --> 01:21.090
Come on, 30, let's use more eggs, comma 100, finally, let's use more our eggs, comma 200.

01:21.760 --> 01:27.520
If you notice, we have used pretty much every register from the area register.

01:28.180 --> 01:34.810
This is just to demonstrate that we do not have to use the full 64 bit register if you just want to

01:34.810 --> 01:37.220
store some smaller value into a register.

01:37.600 --> 01:43.180
So let's save the file and let's use Nazem to assemble this program.

01:43.660 --> 01:50.090
Nazem SPACEHAB registers not Nazan Dash for some registers darte.

01:50.120 --> 01:54.670
Oh once again the format is going to be ELV 64.

01:55.090 --> 01:55.930
Let's render.

01:58.400 --> 02:08.000
Now, let's link it using Ellie and leastways, sub registers that all space dash for sub registers.

02:08.450 --> 02:11.740
Let's enter now like we did earlier.

02:11.870 --> 02:14.230
Let's open up this program using Jollibee.

02:14.710 --> 02:17.960
So I'm typing GDP space sub registers.

02:19.220 --> 02:26.570
And let's once again set up a breakpoint at the beginning of the program, which is underscore start

02:27.530 --> 02:31.870
and let us run the program once again.

02:31.970 --> 02:37.490
If you notice, we have zero eight, which is being moved into L Register.

02:37.850 --> 02:44.600
Ultimately, even if you are moving it into L register, it is going to be saved in order to register

02:45.020 --> 02:48.770
because L is a sub register from Addicks.

02:49.100 --> 02:54.250
So let's quickly check what we have in Attic's register before executing this instruction.

02:54.950 --> 03:02.930
If you notice, currently Attic's register contains the value of zero, so let's type inside and let's

03:02.930 --> 03:04.430
see what happens.

03:05.780 --> 03:10.250
Dirigo IREX register now contains the value zero x a.

03:11.690 --> 03:19.070
Now let's try to execute the next instruction which is moving Heggs 14 into the register h.

03:20.060 --> 03:21.440
I'm hitting enter once again.

03:24.170 --> 03:24.740
And.

03:26.560 --> 03:34.480
Look at that now, age condemns the value 14 and L contains the value zero error, and both of them

03:34.480 --> 03:36.640
together are forming this value.

03:37.240 --> 03:42.330
Now let's move zero x one E into X register.

03:42.880 --> 03:49.390
So I'm typing aside once again, if the previous command that you have typed is a site you don't have

03:49.390 --> 03:52.210
to assign, once again, you can just hit enter.

03:52.360 --> 03:55.410
It is just going to take, say, from the previous command.

03:55.690 --> 04:01.360
So I'm hitting enter without typing anything so that it will do a single step automatically for me.

04:01.690 --> 04:02.560
I'm hitting enter.

04:04.070 --> 04:11.840
Now, the value Hecks money should have been moved into the Register X. Let's go at once again.

04:13.830 --> 04:22.530
Look at that zero one, he's now moved into the Register X. Now the next instruction to be executed

04:22.530 --> 04:29.750
is move the value hex 64 into X, which is the same 100.

04:30.180 --> 04:36.990
So let's go and let's observe IREX once again.

04:37.020 --> 04:39.800
As you can see, we have x 64.

04:41.460 --> 04:46.530
Finally, we are moving a decimal 200 into X register once again.

04:46.530 --> 04:50.610
If you notice, when we were writing this program, we used our X register.

04:50.880 --> 04:56.890
But Assembler has made some optimizations and the auto register is not used.

04:57.340 --> 05:00.780
Instead, the sample register X is used here.

05:01.200 --> 05:08.450
So let's say once again and let's examine how to register.

05:08.460 --> 05:13.780
As you can see, the value Heggs C8 is morphed into an X register.

05:14.250 --> 05:16.900
So this is how we can use some registers.

05:17.310 --> 05:21.750
Now, there is one interesting thing to note about when we are using some registers.

05:22.200 --> 05:33.330
Let me quit GDP and let type object down and let's dump the disassembly of the program that we have

05:33.330 --> 05:41.040
just written, which is some registers and let type dash m in there so that the instructions will be

05:41.040 --> 05:42.900
shown in internal syntax.

05:43.350 --> 05:46.740
OK, so let's hit enter and look at that.

05:47.350 --> 05:55.140
If you notice the instructions which are having the registers like X and are X with smaller values are

05:55.140 --> 05:57.850
having null bytes in the disassembly.

05:58.510 --> 06:03.840
However, when we used a sub registers, they did not produce any null bytes.

06:04.380 --> 06:09.480
So making use of some registers is a great way to avoid null bytes.

06:09.480 --> 06:14.750
When writing Schenkkan, we are going to discuss these concepts once again when we write code.

06:15.060 --> 06:20.930
But since we came across the concepts of using some registers, I just wanted to quickly show you this.

06:21.360 --> 06:21.760
All right.

06:21.870 --> 06:23.400
So that's all for this video.

06:23.610 --> 06:24.720
See you in the next one.
