I was reading through a C program which interfaces with hardware registers. The person has been using hexadecimal numbers as the index to an array such as :
app_base_add[0x30]
I know that a[i] means *(a+i) which is *(a+(i*sizeof(typeof(a)))) so a hexadecimal index is probably a offset of the desired memory location in the address space w.r.t app_base_add.
Is this right?
And also given , say :
#define mm2s_start_add 0xc0000000;
how would these assignments be different from each other in usage?
volatile unsigned int *app_base_add;
app_base_add[0x30>>2]=0x1;
app_base_add[0x30>>2]=1<<2;
app_base_add[0x30>>2]=((unsigned int)mm2s_start_add); //is this assignment valid??
app_base_add[0x30>>2]=((unsigned int *)mm2s_start_add);