Summary
Keywords
Full Transcript
This lesson shows how the ARM processor accesses variables in memory and introduces POINTERs in C. The lesson starts by moving the counter variable out of the main function to the top of the file. This makes the variable no longer local, but rather allocated in memory. Next, you see the huge difference this causes in the compiled code. You learn about the load and store instructions and the difference between the RISC (Reduced Instruction Set Computer) architecture and the CISC (Complex Instruction Set Compturer) architecture. Next, you see how the fundamental concept of a memory address is represented in the C language by means of a POINTER. You will learn how to declare and initialize a pointer. You will learn how to obtain the address of a variable with the & operator and how to de-reference a pointer with the * operator. Next, you will see how to create an alias of a variable with a pointer and you see how the compiled code gets simplified by using a pointer. You will use your first breakpoint to quickly get to the interesting part of the code. Finally, the lesson shows a powerful technique of assigning an arbitrary address to a pointer by casting a number, which is very useful in embedded systems. You will also see how this technique could be dangerous if used carelessly. In the next lesson will apply the knowledge from all lessons all the previous lessons to blink an LED on the Stellaris Launchpad board. ------ Resources: Companion web page for this video course: https://www.state-machine.com/quickstart GitHub repository for projects for this video course: https://github.com/QuantumLeaps/modern-embedded-programming-course YouTube PLAYLIST of the whole course: https://www.youtube.com/playlist?list=PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM
