Digital Signal Processing Reference
In-Depth Information
The program stops at the
breakpoint
and the
watch window
shows the
value of point before the pointer is set. To advance the program or move
through the
breakpoint
, hit the shortcut button
step over a line
or select
Debug
>
Step Over
. The pointer is now set, and you can see the value of
the pointer is
0x80000000
.
To watch the variable
i
as the program progresses:
•
Hit the shortcut button
animate
or select
Debug
>
animate
or hit
the shortcut button
step over the line
over and over to see the
variable
i
change.
•
After using
animate
, you need to
halt
the system. You can do this
with
Debug
>
Halt
.
•
If you want to do this exercise over again, go to
Debug
>
Restart
,
Run
,
Step Over
, etc. Remove the
breakpoints
before continuing by
hitting the shortcut button
Remove All Breakpoints
.
•
Double click on
main.c
in the project window and modify the C
program so that it matches the program below. This C program will
sum the values.
//main.c C program -Modification 2
#include <stdio.h>
void main()
{
int i, ret;
short *point;
point= (short *) 0x80000000;
printf(“Begin\n”);
for (i=0;i<10;i++)
{
printf(“[%d]%d\n,”i, point[i]);
}
ret = ret_sum(point,10);
printf(“Sum =%d\n,”ret);
printf(“End\n”);
}
int ret_sum(const short* array, int N)
{
int count, sum;
sum=0;