Comparing C to machine language
YouTube transcript, YouTube translate
A quick preview of the first subtitles so you know what the video covers.
So, I have a program here that prints out Fibonacci numbers. And I want to walk through how we get this program compiled to machine code and running on the computer. Uh, but first of all, just to see kind of what the output of this looks like when we run it is it prints out Fibonacci numbers up to uh 255. And actually 233 is the largest Fibonacci number that's less than 255. And then it just starts over and it just does this. It just does this forever and ever. And so, uh, just as a reminder, Fibonacci number, you start with zero and one. And then the next number is just the sum of the last two numbers. So 0 plus 1 is 1. 1 plus 1 is 2. 1 plus 2 is 3. 2 plus 3 is 5. 3+ 5 is 8. So on and so forth all the way down. Uh and so just to walk through this program to uh make sure we understand how it works. We've got three variables x, y, and z. And we have this loop that just continues forever and ever. Um but then inside that we set x to zero and y to one. So x starts out as zero. Uh x starts out as zero. Y starts out as one. Um and then we have this loop here where we print out um the value of x. So x is zero. So we print that out. Uh and then we calculate z as being x + y. So 0 + 1 is 1. Um and then what we do is basically kind of shift all these these numbers over. So x it gets equal to y. So x becomes one. Um y is equal to z. So when y becomes one as well, of course it already was one.