Again reached home at midnight after another 15 day hour workday. Really tired but looking forward for the weekend to dedicate some hours to speed things up!
Still managed to pull through and learn some little new things:
- “At any point in a program, the instruction pointer contains the address in memory of the next instruction to execute”
- From wiki: “In most processors, the PC is incremented after fetching an instruction, and holds the memory address of (“points to”) the next instruction that would be executed. (In a processor where the incrementation precedes the fetch, the PC points to the current instruction being executed.)”
- Instruction pointer could actually jump from a list to another , in essence “You can create as many programs as you want, each program starting at its own unique address in memory”. These smaller programs are called “function”.
- Every programing language gives you a way to give plain English names to functions (Also called routines, methods).
- This is not hard to understand. There can be for instance a function: addition (x,y) = x + y. Then you can say for example “addition(2,3)” and the output will be 5.
- Every program will be useless if it didn’t have a way to display something to the screen. There is always a function that is some sort of ability to print text to the screen.
- Extra info you give to a function is called a “parameter” or an “argument”. In the function before, the parameters are x and y.
- After a function is done it returns to the line of code after the line where it was called. However it can also return extra information like for instance information with regards if whatever it is that is meant to do worked or not etc.
- A “return value” is information that is returned from a function back to the program that called it, and you can use that information after that.
- Some programing languages require you to create a function for your main program. Your program is actually a function in iself! 🙂
Today a bit more theoric concepts. At least those concepts I understand! Too tired to do more really. More this weekend.