#3 Variables and Pointers

Quantum Leaps, LLC
Quantum Leaps, LLC
180.3 هزار بار بازدید - 12 سال پیش - This lesson shows how the
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/moder...

YouTube PLAYLIST of the whole course:
Modern Embedded Systems Programming C...
12 سال پیش در تاریخ 1391/11/01 منتشر شده است.
180,373 بـار بازدید شده
... بیشتر