Hello and welcome, everybody.
And in this lecture, we're going to carry on implementing scope offsets.
In this lecture, we're going to implement global scope offsets.
So this will be for things like global variables such as and it x equals 50, stuff like that, variables
outside of functions.
Okay, so head back to deposit RC and we're going to start writing that.
So this is a very simple lecture, so we're going to go in it.
Parsa Scope offset for global struck node struct history.
And all we're going to do is return to zero.
And that is it for our global offset function, because, of course, global variables don't have offsets.
You know, they're not offsetting on a stack.
They are actual global variables.
So there is no offset they haven't addressed in memory.
That said, they're not offsetting from any stack point or base point now.
So they're offset zero, simple as that.
So let's just scroll to the top of this file and we're going to make a new.
History flag.
History flag is global scope, and that's going to equal to 0100.
And now that we've done that, let's just scroll back down to parse the scope offset, because now we
need to put the if statement which will check for that flag, which will then call this function.
So we're going to say if history flags and percent history flag is global scope, then return pause
to scope offset for global note in history.
It's really as simple as that.
And of course, sorry, there shouldn't be a return keyword here.
It should just be calling that and in return like that.
So if the history flag is global scope is set, then essentially we call parse the scope of step for
global and we just return because then we're basically done, right?
There is no offset for global variables essentially, but it's still nice to have that function just
to make that clear.
Okay.
And that concludes this lecture.
Thanks for watching.
Part two of implementing the scope offsets.