Machine Language Instructions: Program Control - Branching, Function Calls and the Stack

Published: 11 October 2020
on channel: Coding Coach
356
5

In our previous videos and explorations creating machine level programs we focused on program control using branching to produce programs that could perform conditional operations and iteration. Now we are going to find out how to "Jump" from a location in our code to another in such a way that we can return. This is how we call a function in our high level programs. The locations that we jump from when calling a function are retained in a stack data structure. Each time we perform a function call, the calling location is pushed into the stack to be popped out when the function call completes. This same method allows our programs to preform recursion as well.

This video also has a guest appearance from the kitten Belle who is so excited to learn how function calls are managed at the lowest level, she jumps up at the end of the video, sorry!

Please like this video and subscribe and would like to see more like it!    / @codingcoach  

It is part of my Computer Organization and Architecture course which you can find here:    • Computer Organization and Architecture  

If you have not seen the Little Man Computer (LMC) series of videos, they are highly recommended before this one you can find them here:
A recommended introduction to Little Man computer video here:    • Little Man Computer Explained: Introd...  
A "Hello LMC" video where we do a smaller program and talk more in-depth about the instruction cycle and basic instructions:    • Little Man Computer (LMC) Explained: ...  
And an intermediate step where we introduce branching and explore recreating conditional statements with LMC:    • Little Man Computer (LMC) Explained: ...  
Finally we explore iteration, labels and advanced LMC:    • Little Man Computer (LMC): Assembler ...  

Here are presentation slides that can be used as a supplement to follow along and as a future reference for this content: https://drive.google.com/file/d/1ArN_...


On this page of the site you can watch the video online Machine Language Instructions: Program Control - Branching, Function Calls and the Stack with a duration of hours minute second in good quality, which was uploaded by the user Coding Coach 11 October 2020, share the link with friends and acquaintances, this video has already been watched 356 times on youtube and it was liked by 5 viewers. Enjoy your viewing!