1
H th ng nhúng
Th c sĩ Lê M nh H i
Embedded Systems
2
Lesson 5 : Taking a look under the
hood
Motivation:
Memory space allocation
Program space visibility
Investigating memory allocation
Looking at the MAP
Pointers
The heap
MPLAB® C30 memory models
3
Flight plan
In this lesson we will review the basics of
string declaration as an excuse to introduce
the memory allocation techniques used by
the MPLAB C30 compiler.
The RISC architecture of the PIC24 poses
some interesting challenges and offers
innovative solutions.
4
Preflight checklist
This lesson will be performed exclusively
with software tools including the MPLAB
IDE, MPLAB C30 compiler and the
MPLAB SIM simulator.
Use the “New Project Set-up” checklist to
create a new project called “Strings” and a
new source file similarly called “strings.c”.
5
The flight
1. char s[5] = { 'H', 'E', 'L', 'L', 'O'};
2. char s[5] = "HELLO";
3. char s[] = "HELLO";
4. char s[6] = { 'H', 'E', 'L', 'L', 'O', '\0' };