Now let's discuss how we can use some registries.
Let's begin by creating a new file called Sub Registers Got Nazim.
And as usual, let's start with our global director of Global Space and let's start and let's specify
our entry point here.
Now, once again, we are going to use the move instructions.
But instead of using a register like Oryx and RDX, we are going to try to use the sobre histories of
those registers.
So let's get started.
The first let's use move el chromatin.
This is one of the protesters from Artex.
Let's also use more Aage Qamar, 20.
Let's also use move AICS.
Come on, 30, let's use more eggs, comma 100, finally, let's use more our eggs, comma 200.
If you notice, we have used pretty much every register from the area register.
This is just to demonstrate that we do not have to use the full 64 bit register if you just want to
store some smaller value into a register.
So let's save the file and let's use Nazem to assemble this program.
Nazem SPACEHAB registers not Nazan Dash for some registers darte.
Oh once again the format is going to be ELV 64.
Let's render.
Now, let's link it using Ellie and leastways, sub registers that all space dash for sub registers.
Let's enter now like we did earlier.
Let's open up this program using Jollibee.
So I'm typing GDP space sub registers.
And let's once again set up a breakpoint at the beginning of the program, which is underscore start
and let us run the program once again.
If you notice, we have zero eight, which is being moved into L Register.
Ultimately, even if you are moving it into L register, it is going to be saved in order to register
because L is a sub register from Addicks.
So let's quickly check what we have in Attic's register before executing this instruction.
If you notice, currently Attic's register contains the value of zero, so let's type inside and let's
see what happens.
Dirigo IREX register now contains the value zero x a.
Now let's try to execute the next instruction which is moving Heggs 14 into the register h.
I'm hitting enter once again.
And.
Look at that now, age condemns the value 14 and L contains the value zero error, and both of them
together are forming this value.
Now let's move zero x one E into X register.
So I'm typing aside once again, if the previous command that you have typed is a site you don't have
to assign, once again, you can just hit enter.
It is just going to take, say, from the previous command.
So I'm hitting enter without typing anything so that it will do a single step automatically for me.
I'm hitting enter.
Now, the value Hecks money should have been moved into the Register X. Let's go at once again.
Look at that zero one, he's now moved into the Register X. Now the next instruction to be executed
is move the value hex 64 into X, which is the same 100.
So let's go and let's observe IREX once again.
As you can see, we have x 64.
Finally, we are moving a decimal 200 into X register once again.
If you notice, when we were writing this program, we used our X register.
But Assembler has made some optimizations and the auto register is not used.
Instead, the sample register X is used here.
So let's say once again and let's examine how to register.
As you can see, the value Heggs C8 is morphed into an X register.
So this is how we can use some registers.
Now, there is one interesting thing to note about when we are using some registers.
Let me quit GDP and let type object down and let's dump the disassembly of the program that we have
just written, which is some registers and let type dash m in there so that the instructions will be
shown in internal syntax.
OK, so let's hit enter and look at that.
If you notice the instructions which are having the registers like X and are X with smaller values are
having null bytes in the disassembly.
However, when we used a sub registers, they did not produce any null bytes.
So making use of some registers is a great way to avoid null bytes.
When writing Schenkkan, we are going to discuss these concepts once again when we write code.
But since we came across the concepts of using some registers, I just wanted to quickly show you this.
All right.
So that's all for this video.
See you in the next one.