How does stack work in a CPU? Why do we need it?

  Рет қаралды 9,414

Stable Mechanic

Stable Mechanic

Күн бұрын

Пікірлер: 18
@thegt
@thegt Жыл бұрын
One of the best explanations I've seen so far. Enough level of detalization, good level of visualization.
@darkmadarauchiha
@darkmadarauchiha 9 ай бұрын
Really useful video, watched a few others but they didn't help much. You started at the right level to help everything else fall into place! Keep it up!
@muhammedazoz
@muhammedazoz Ай бұрын
Awesome explanation 🔝
@egotraumatic
@egotraumatic 7 ай бұрын
Better to watch on x1.5. Great video! Thank you!
@joerit633
@joerit633 2 жыл бұрын
Excellent video!! Very interesting and informative!! Thank you!!!!
@abhijitbaruah2207
@abhijitbaruah2207 2 ай бұрын
one of the best video
@mikhailmikheev8043
@mikhailmikheev8043 2 жыл бұрын
youtube algorithm doing wonders
@aeleee
@aeleee 2 ай бұрын
best ever
@noa29Enib
@noa29Enib 2 жыл бұрын
Great explanations thanks :)
@TON-vz3pe
@TON-vz3pe 11 ай бұрын
Fantastic explanation. But where does the text segment fits in all this?
@0x20d
@0x20d 9 ай бұрын
I assume you mean the text segment in your assembly file? If so, the text segment holds your instructions. In case of this example that would be j=j+k (or EAX
@user-hk4cu5go9c
@user-hk4cu5go9c 3 ай бұрын
The text segment is a memory segment of a process which contains the instructions of that process. Thus, the IP points to instructions in the text segment which, when pointing to functions being called, invokes function stack frames to be created on the stack (and hence the increment/decrement of the stack pointer). Hope that makes sense, assuming I've understood your question correctly lol.
@krenilraj4180
@krenilraj4180 Жыл бұрын
can someone explain me , the foo() function in the white diagram is the instruction there and foo stack frame , a stack is created for foo function inside there variables are stored and after it is successfully loaded it will CPU will start executing foo function Am I right ? If wrong please explain me
@user-hk4cu5go9c
@user-hk4cu5go9c 3 ай бұрын
Yes, you are correct. Once the foo() function has finished executing on the CPU, the stack pointer is incremented to a higher memory address back to the top of main's stack frame and foo's stack frame is popped off. Remember, the stack pointer gets INCREMENTED because the stack grows downards towards lower memory addresses, hence any stack frames being popped cause the pointer to point to the previous stack frame's HIGHER memory address.
@Jkauppa
@Jkauppa 2 жыл бұрын
why not just direct in-memory computing
@yuriyfse6555
@yuriyfse6555 Жыл бұрын
))) how you imagine it?)
@tsunningwah3471
@tsunningwah3471 9 ай бұрын
zhina!!!!!
@yuriyfse6555
@yuriyfse6555 Жыл бұрын
ma-an, very slowly it's 2023 on yard, not 1960 - in youtube we can watch many different videos
Ep 081: Introduction to the Stack Pointer
16:09
Intermation
Рет қаралды 53 М.
CRAFTING A CPU TO RUN PROGRAMS
19:49
Core Dumped
Рет қаралды 116 М.
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,4 МЛН
Just enough C to have fun
39:29
Kay Lack
Рет қаралды 65 М.
HOW TRANSISTORS REMEMBER DATA
16:58
Core Dumped
Рет қаралды 371 М.
How a CPU Works
20:42
In One Lesson
Рет қаралды 8 МЛН
CPU Architecture
39:59
Lewis Baumstark
Рет қаралды 2 М.
WHY IS THE HEAP SO SLOW?
17:53
Core Dumped
Рет қаралды 272 М.
Compilers, How They Work, And Writing Them From Scratch
23:53
Adam McDaniel (kiwi)
Рет қаралды 221 М.
WHY IS THE STACK SO FAST?
13:46
Core Dumped
Рет қаралды 173 М.
How the Clock Tells the CPU to "Move Forward"
14:22
Core Dumped
Рет қаралды 90 М.
Memory Checking STOC Video
22:43
Neekon Vafa
Рет қаралды 32
How does Computer Memory Work? 💻🛠
35:33
Branch Education
Рет қаралды 4,1 МЛН