WEBVTT

00:00.560 --> 00:08.300
In the realm of computer systems, memory serves as a crucial component that acts as a storage repository

00:08.300 --> 00:11.060
for both data and instructions.

00:11.480 --> 00:18.860
As we have previously previously explored, there exists specialized storage elements called registers

00:18.860 --> 00:23.420
that enable high speed access to critical information.

00:23.420 --> 00:30.470
So while registers provide rapid data retrieval, it's important to acknowledge that memory access operates

00:30.470 --> 00:33.290
at a comparably slower pace.

00:33.290 --> 00:41.540
So this discrepancy in access speed necessitates a careful balance between the usage of registers and

00:41.540 --> 00:45.590
memory to optimize overall system performance.

00:45.590 --> 00:53.300
So registers represent the pinnacle of the memory hierarchy due to the their immediate accessibility

00:53.300 --> 00:54.560
by the processor.

00:54.560 --> 01:02.460
So they facilitate rapid execution of instructions by providing quick access to frequently used data.

01:02.490 --> 01:10.480
However, the abundance of registers is inherently limited due to the physical and design considerations.

01:10.500 --> 01:20.010
This limitation prompts the integration of various memory levels, each with distinct access speeds,

01:20.160 --> 01:21.720
capacities and costs.

01:21.720 --> 01:32.970
So diving deeper, we we encounter the theoretical limit of memory size, which boasts around 264 addresses.

01:33.450 --> 01:35.820
Let's actually open the grommet.

01:37.280 --> 01:40.100
And as always, throw things on the screen.

01:40.520 --> 01:41.540
So.

01:43.670 --> 01:45.710
Uh, 264 addresses.

01:45.710 --> 01:54.440
So to put this into perspective, this limit translates at staggering, like 16 exabytes.

01:54.950 --> 01:56.660
Exabytes.

01:57.820 --> 01:59.030
Which is a lot.

01:59.050 --> 02:01.280
It's 6000 exabytes of memory.

02:01.300 --> 02:09.520
While this figure appears remarkably large, it is vital to note that practical implementation constraints

02:09.520 --> 02:14.980
prevent the utilization of such a colossal memory capacity.

02:14.980 --> 02:22.060
And while the theoretical memory capacity seems virtually boundless or the real world, design considerations

02:22.060 --> 02:27.340
inevitably impose limitations on its effective utilization.

02:27.340 --> 02:33.230
So various factors contribute to these constraints.

02:33.250 --> 02:39.280
Physical space requirements, manufacturing capabilities, power consumption and cost considerations

02:39.280 --> 02:46.300
collectively influence the decision making process when determining memory sizes for a given system.

02:46.330 --> 02:53.200
Thus, the pursuit of an ideal balance between memory capacity and practicality becomes an intricate

02:53.200 --> 02:54.110
endeavor.

02:54.130 --> 02:58.810
So now what we're going to do is we will open the our.

02:59.850 --> 03:02.160
Chrome and see.

03:13.260 --> 03:17.640
What a 16 exabytes equals here.

03:23.290 --> 03:24.190
16.

03:26.570 --> 03:28.130
Bites here.

03:53.230 --> 04:00.270
Let's actually turn the exabytes to gigabytes and 116 exabytes to gigabytes.

04:00.280 --> 04:04.600
And as you can see here, this is something like this gigabytes here.

04:05.840 --> 04:13.490
And realizing the memory subsystem that harnesses the full potential of the theoretical memory limit

04:13.490 --> 04:15.080
is a formidable challenge.

04:15.080 --> 04:23.270
So as the memory capacities increase, new architectural innovations must emerge to address the associated

04:23.270 --> 04:24.260
complexities.

04:24.260 --> 04:31.760
So these challenges encompass efficient memory, addressing data integrity, error correction mechanisms

04:31.760 --> 04:36.620
and ensuring uniform access speeds across the memory hierarchy.

04:36.650 --> 04:42.500
Overcoming these obstacles is vital to harnessing memories to potential.

04:42.530 --> 04:50.750
So in conclusion, memory emerged as a cornerstone of modern computing systems functioning as a repository

04:50.750 --> 04:56.040
for data and instructions vital to processor operations.

04:56.060 --> 05:04.070
And while registers offer expedited access, the memory hierarchy accommodates the need for scalable

05:04.070 --> 05:05.610
storage solutions.

05:05.610 --> 05:13.440
Memory access governed by the addressing mechanisms navigates through different memory types, each

05:13.440 --> 05:16.830
tailored to specific access requirements.

05:16.830 --> 05:30.060
So the theoretical memory limit presents an A1 sparring figure of 604 sorry for this 264 addresses showcasing

05:30.060 --> 05:33.290
the man's potential for memory capacity.

05:33.300 --> 05:38.400
However, practical design factors such as physical limitations, manufacturing capabilities and economic

05:38.400 --> 05:44.180
considerations steer memory capacities towards more manageable levels.

05:44.190 --> 05:52.200
As we push the boundaries of computing, the pursuit of optimal memory architecture becomes a dynamic

05:52.200 --> 06:00.000
process requiring innovative solutions to address challenges associated with expanding memory capacities.

06:00.030 --> 06:06.830
By understanding the intricate interplay of memory, technical intricacies and practical constraints,

06:06.830 --> 06:13.580
we pave the way for enhanced computing experiences that leverage the true power of memory.

06:13.700 --> 06:23.300
Now we will develop an application again here 64 bit and an Nasm application here.

06:23.300 --> 06:24.530
Let's create a new project.

06:24.530 --> 06:27.980
Delete this this We will name this project as.

06:29.620 --> 06:37.240
Uh, memory or actually, let's make me name it our the 16 exabyte.

06:37.270 --> 06:39.430
Let's actually name it x a byte here.

06:39.460 --> 06:45.990
X a byte so we can remember it takes a byte more how much it, how big is it?

06:46.000 --> 06:51.610
So we will create a section data section data here.

06:51.610 --> 06:53.500
So we will define numbers.

06:53.500 --> 06:57.130
We will define byte size variable, be num with the value.

06:57.160 --> 06:58.390
One, two, three.

06:58.420 --> 07:05.730
We num db one, two, three and we will define a word size variable w num with value.

07:05.740 --> 07:07.960
One, two, three, four five.

07:07.990 --> 07:14.200
We num w one, two, three, two, one, two, three, four, five.

07:14.350 --> 07:23.620
And we will define an array of five words and initialized to zero w array.

07:24.600 --> 07:28.830
Times and 5W0.

07:29.900 --> 07:31.370
And dinam.

07:32.900 --> 07:36.050
ID one, two, three, four, five.

07:36.230 --> 07:38.300
Here we define the.

07:39.880 --> 07:42.910
Let's actually make it an uppercase.

07:42.910 --> 07:48.670
So the D this is a double word size variable name with value.

07:48.700 --> 07:51.130
One, two, three, four, five.

07:51.160 --> 07:56.110
We will define the num one to num one.

07:56.380 --> 07:58.960
The Q here as well.

07:58.960 --> 08:00.730
One, two, three, four, five.

08:00.760 --> 08:01.510
We are here.

08:01.510 --> 08:06.460
We are defining the quadword size variable q num one with value.

08:06.460 --> 08:12.310
One, two, three, four, five and text one db.

08:13.680 --> 08:14.110
A, B.

08:14.130 --> 08:15.540
C here.

08:15.570 --> 08:16.260
Zero.

08:16.470 --> 08:22.110
Here we are defining a null terminated string variable text one with value.

08:22.140 --> 08:22.950
A, b, c.

08:26.370 --> 08:29.340
And the num to.

08:30.110 --> 08:31.370
The queue here.

08:31.400 --> 08:37.190
Here we will define a quadword size variable name with the value of P.

08:37.640 --> 08:44.180
It's actually 3.14 and 1592.

08:44.900 --> 08:45.470
60 for.

08:46.540 --> 08:46.960
Uh, no.

08:46.960 --> 08:47.290
Yeah.

08:47.980 --> 08:52.210
Uh, 92, 65 four.

08:52.360 --> 08:57.880
And after that, we will define a null terminated string variable text to with the value.

08:57.910 --> 09:01.450
See the E here.

09:03.870 --> 09:05.280
At the null termination as well.

09:05.280 --> 09:06.240
And that's it.

09:06.540 --> 09:08.290
We will go to section B here.

09:08.310 --> 09:09.450
Section.

09:10.620 --> 09:11.400
Action.

09:12.480 --> 09:16.140
And now what we're going to do is we will define four variables.

09:16.680 --> 09:18.600
We will reserve four variables here.

09:19.110 --> 09:20.130
We defined already.

09:20.160 --> 09:22.200
We are defining variables in data section.

09:22.470 --> 09:27.210
So now we will reserve one byte of space for variable.

09:27.240 --> 09:33.030
Be var in this section, be var rest be.

09:36.580 --> 09:37.240
Recipe.

09:38.620 --> 09:39.550
And one.

09:40.330 --> 09:43.450
And we will also define not defined.

09:43.480 --> 09:47.110
We will reserve the four bytes of space.

09:51.770 --> 10:00.710
We will reserve four bytes of space variable for base for variable D, var in the base section.

10:02.620 --> 10:03.820
And W.

10:05.870 --> 10:08.900
We will reserve space for an array of.

10:10.070 --> 10:11.540
Uh, ten words.

10:12.700 --> 10:17.380
Named W4 in the S section.

10:18.370 --> 10:18.700
As well.

10:18.700 --> 10:22.020
We will define a reserve keyword.

10:22.450 --> 10:23.440
A rest.

10:24.200 --> 10:25.790
Q three.

10:25.940 --> 10:33.800
Here we are reserving space for an array of three quad words named Q R in the spaces section as well.

10:33.800 --> 10:38.400
And this is the last reserve that we defined in this section.

10:38.420 --> 10:42.440
Now we will continue to the section text.

10:44.090 --> 10:47.240
And here we will define the.

10:48.310 --> 10:48.820
Global.

10:48.850 --> 10:49.450
Maine.

10:49.480 --> 10:50.530
Global.

10:50.920 --> 10:51.700
Maine.

10:54.600 --> 10:55.140
Main.

10:55.780 --> 10:57.580
And in this main here.

10:59.450 --> 11:00.350
RPM.

11:00.740 --> 11:04.940
We are pushing the value of P onto the stack.

11:04.970 --> 11:14.830
We will move the value of RSP into P, which is also setting up the stack frame.

11:15.200 --> 11:15.440
P.

11:17.500 --> 11:27.850
RWP rsp and we will load the memory of address this binom into rax.

11:28.900 --> 11:29.440
Leah.

11:31.040 --> 11:31.720
Racks.

11:34.890 --> 11:36.770
To be numb.

11:38.690 --> 11:42.080
And we will move the racks.

11:43.190 --> 11:46.970
So we will load the value stored at Benham.

11:47.900 --> 11:48.740
Interacts.

11:48.740 --> 11:58.880
But here we load the memory address of p'num interacts and now we are loading the value stored at p'num

11:58.880 --> 12:01.220
into Rax here.

12:05.700 --> 12:06.180
Venom.

12:08.510 --> 12:15.080
And here we will again load the value stored at memory, address stored and Bynum interacts.

12:15.080 --> 12:16.460
I will explain this further.

12:17.420 --> 12:19.730
This is new to us.

12:25.250 --> 12:26.630
So move.

12:27.860 --> 12:28.710
Bois.

12:30.600 --> 12:31.380
PVR.

12:32.820 --> 12:33.660
Racks.

12:36.550 --> 12:37.870
No, actually, yeah, we.

12:38.840 --> 12:40.280
We need to move the.

12:41.670 --> 12:43.860
Move the racks to.

12:47.390 --> 12:48.530
Leah move.

12:48.680 --> 12:49.190
And now.

12:49.340 --> 12:50.810
Yes, this is true.

12:52.220 --> 12:53.580
So what we did here, we.

12:53.640 --> 13:01.400
We loaded the value stored at memory address, which is stored in Benham into racks here again.

13:01.430 --> 13:06.080
Now, what we're going to do is we will move the PVR.

13:09.620 --> 13:09.970
We were.

13:09.980 --> 13:14.990
As you can see, we are using this section which we reserved in previous year in this section.

13:15.470 --> 13:16.060
Section.

13:16.070 --> 13:23.740
Now we will store the value in rax at the memory address of Bois.

13:25.070 --> 13:27.380
Rags and.

13:28.720 --> 13:30.550
We completed three move instruction here.

13:30.550 --> 13:35.670
Now we will use the Lia here to rax.

13:36.190 --> 13:41.950
We are loading the memory address of bvar into rax here.

13:43.980 --> 13:44.730
Racks.

13:45.660 --> 13:46.530
PVR.

13:46.560 --> 13:52.310
But remember, here we store the value in racks at the memory address before.

13:52.350 --> 13:58.740
Actually, if we write this command, if I write the comments here to this code, you will understand

13:58.740 --> 13:59.700
it better.

14:00.810 --> 14:03.960
Posh, the less actually it will be quicker.

14:03.990 --> 14:10.380
Don't worry posh the value of RVP onto the stack and.

14:13.250 --> 14:14.900
And here we are.

14:15.340 --> 14:16.430
Uh, let's see.

14:17.000 --> 14:19.160
We are moving the move.

14:19.630 --> 14:23.180
Move the value of RSP.

14:23.990 --> 14:26.280
Let's make it uppercase, RVP.

14:26.600 --> 14:32.000
So move the value of RSP into RVP, which is.

14:32.000 --> 14:34.790
This is the setting up the stack frame.

14:35.270 --> 14:37.160
And here.

14:38.300 --> 14:40.640
We are not.

14:41.810 --> 14:47.990
The memory address of numb into.

14:48.870 --> 14:49.710
Racks.

14:52.260 --> 15:00.890
And here we are telling the assembly to load the load, the value stored.

15:02.280 --> 15:06.180
Add venom into racks.

15:10.820 --> 15:14.930
Here we are telling the assembler to load.

15:15.820 --> 15:18.310
The value stored.

15:19.780 --> 15:20.260
At.

15:22.240 --> 15:24.070
Saw that on here and.

15:24.070 --> 15:24.460
Yeah.

15:24.490 --> 15:29.120
Load the value stored at the memory address.

15:29.140 --> 15:37.060
Memory address stored in penam into rax.

15:39.880 --> 15:48.010
And after that we we are telling the assembly to store the value in racks.

15:50.350 --> 15:55.780
Racks at the memory Address of Beaver.

15:58.400 --> 16:01.310
And after that we are telling.

16:02.020 --> 16:06.850
The assembly to load the load the memory address.

16:06.880 --> 16:15.160
Load the memory address of PVR, PVR into Rax.

16:15.340 --> 16:19.210
And now we will continue our code writing here.

16:19.210 --> 16:21.670
So we will use another instruction.

16:22.870 --> 16:23.770
Now we are.

16:25.670 --> 16:30.110
Julia here the racks to w numb.

16:32.460 --> 16:41.820
This is for load the memory load the memory address of w num into rax.

16:42.930 --> 16:44.820
Again, we will know not.

16:44.880 --> 16:48.900
Yes, we will load the value stored at w num into rax.

16:52.860 --> 16:53.730
Racks.

16:55.000 --> 16:56.380
W nam.

17:00.830 --> 17:01.910
The load.

17:01.920 --> 17:03.920
The value.

17:05.570 --> 17:10.460
Or load the so here rax w num we wrote here.

17:10.460 --> 17:15.050
So we loaded the memory address of the num into rax.

17:15.050 --> 17:19.640
But now what we're going to do is we are going to load the value.

17:21.250 --> 17:23.740
Go to the value part.

17:25.120 --> 17:33.700
In w num into rax and here we will use the Lia again because we need to tell the Assembly to load the

17:33.700 --> 17:37.000
memory address of text one.

17:38.100 --> 17:39.390
In two racks.

17:39.390 --> 17:39.980
Right.

17:39.990 --> 17:42.180
So racks.

17:44.160 --> 17:45.200
Text one.

17:45.840 --> 17:57.190
I will also add the comments load the memory memory address of text one into Rax and now we will tell

17:57.190 --> 18:01.440
the assembly to load the memory address of text one into.

18:02.480 --> 18:03.410
Racks.

18:16.880 --> 18:18.110
Thanks one.

18:20.110 --> 18:23.440
Load the memory address.

18:30.020 --> 18:31.910
Of text one.

18:34.560 --> 18:36.060
Interacts.

18:39.470 --> 18:43.760
And here you might be asking why the comments here is same.

18:44.300 --> 18:49.070
So you will learn that in when we get the output from this program.

18:50.140 --> 18:51.820
So don't worry about it.

18:54.430 --> 19:03.090
And after that we will need to load the value as the second character of Text one into Rax.

19:03.100 --> 19:06.610
In this case, the second character is here.

19:07.570 --> 19:07.930
So.

19:08.910 --> 19:09.640
Move there.

19:09.710 --> 19:10.260
Move.

19:14.020 --> 19:15.640
Now we will use the Mu again.

19:16.560 --> 19:17.550
Two racks.

19:21.340 --> 19:23.410
Text one plus one.

19:23.410 --> 19:25.720
Here we are telling the.

19:27.180 --> 19:30.870
The memory address of text.

19:31.500 --> 19:38.250
Now load the value at the second character of text.

19:38.280 --> 19:42.060
One one interacts.

19:44.710 --> 19:46.570
And we will use again.

19:47.650 --> 19:50.470
La Rocks here.

19:51.130 --> 19:56.110
And now, as we always do now, we will need to load the memory address of the second character of Text

19:56.110 --> 19:57.340
one into Rax.

19:57.430 --> 19:59.560
In order to do that, we will use this braces here.

19:59.610 --> 20:02.290
So text one plus one.

20:03.100 --> 20:04.030
What's the price?

20:04.150 --> 20:06.690
Now we are telling the Lord the.

20:08.020 --> 20:09.170
Load the memory.

20:09.180 --> 20:11.730
Memory address.

20:12.820 --> 20:14.560
Of text one.

20:17.180 --> 20:24.090
Memory address of text one plus one into Rax.

20:24.110 --> 20:25.970
Now we need to just write.

20:28.110 --> 20:29.520
Actually not here.

20:29.520 --> 20:30.960
So he wrote.

20:30.990 --> 20:32.160
MOV rax text one.

20:32.160 --> 20:36.240
So we've done this right and we use the Leah here.

20:38.320 --> 20:45.790
Although the memory address of the second character memory address of now loads the memory address of.

20:50.800 --> 20:58.570
The of the second character of text one interacts.

21:01.390 --> 21:05.320
And now we just need to write five more instructions.

21:05.320 --> 21:11.230
And we are done with this code here and in, in next lecture, we will analyze it, debug it and so

21:11.230 --> 21:19.660
on because the you will learn a lot from this code here about, uh, manipulating and using memories

21:19.660 --> 21:21.730
in assembly language.

21:21.730 --> 21:27.670
So after here we will need to use, uh, move here.

21:27.670 --> 21:29.650
So move rax.

21:32.240 --> 21:33.230
Next one.

21:33.260 --> 21:36.500
Here we are telling the assembler to load.

21:37.740 --> 21:40.410
The value stored.

21:41.790 --> 21:47.040
At the memory address of text one.

21:48.190 --> 21:51.100
Text one interacts.

21:52.120 --> 21:57.820
And after that we will use the move again to racks to load the value stored at the memory address of

21:57.820 --> 22:00.190
text one plus one into rax.

22:00.430 --> 22:01.300
So.

22:02.380 --> 22:03.580
Uh, text.

22:05.040 --> 22:07.350
X one plus one.

22:09.040 --> 22:12.100
You're telling the Lord the value.

22:13.040 --> 22:13.730
Thought.

22:14.970 --> 22:18.270
At the memory Memory address.

22:21.610 --> 22:24.520
Of text one plus.

22:27.480 --> 22:30.870
Text one plus one interacts.

22:33.890 --> 22:38.270
And now we just we will need to restore create the exit codes here.

22:38.270 --> 22:42.200
So RSP rbp.

22:42.860 --> 22:45.050
This is for restore.

22:46.590 --> 22:47.790
Restore.

22:48.750 --> 22:57.180
The value of RSP from which we need to do this for cleaning clean.

22:58.660 --> 23:01.330
Clean up the stack frame.

23:02.110 --> 23:04.720
And after that we will.

23:05.820 --> 23:06.390
Pop.

23:08.410 --> 23:10.390
Value of from the stack.

23:11.890 --> 23:14.860
Up the value of rb P from the stack.

23:16.370 --> 23:17.720
Write it up.

23:17.740 --> 23:22.240
The value of P from the stack.

23:23.420 --> 23:26.180
And now we will return from the function.

23:28.260 --> 23:31.020
Return from the function.

23:32.100 --> 23:33.210
So that's it.

23:34.440 --> 23:40.080
You need to develop this following program which exhibits a lack of discriminable output here.

23:40.080 --> 23:45.180
But we will employ a debugger to meticulously traverse each program instruction.

23:45.210 --> 23:51.630
This is a favorable option in the context of this employment of CSM.

23:51.810 --> 23:56.490
So I will explain this code in next lecture and meeting you in the next lecture.
