Hi all, When i try to run the program below ,i got the two warnings below. I didnt add stratup.s in my project. I am geting the error whenever i include the line *(int *)0x40003456L = fact; I would like to know the cause of the problem and the way to get rid of it. looking for ur help. t.senthil
#include <LPC21xx.H> #include <stdio.h> void main (void) { int i,fact,j=1,value=6; for (i=1; i<=value; ++i) j=j*i; printf("The factorial of %d is %d\n",value,j); fact=j; *(int *)0x40003456L = fact; }
Hi, I am not using any _at keyword currently. to the above program (program in my first thread) ,if I include startup.s then i am not getting those memory overlapping error. Instead I am getting another error Non-aligned Access: Thumb Instruction at 00000196H, Memory Access at 40003456H when the third line STR R1,[R0,#0x00] in the disassembled window is getting executed
12: *(int *)0x40003456L = j; 13: 0x00000192 1C21 ADD R1,R4,#0 0x00000194 4808 LDR R0,[PC,#0x0020] 0x00000196 6001 STR R1,[R0,#0x00]
What happens if you change the following:
12: *(int *)0x40003456L = j;
12: *(int *)0x40003458L = j;
Hi Jon Thanks for your inforation.It works after changing the memory location.....Thanks a lot... t.senthil