uint8_t num_byte[4];
uint32_t num_word;
const uint32_t num_word_const = 0x1234;
uint32_t *point_heap;
int main(void)
{
uint8_t num_byte_stack;
static uint8_t num_byte_static;
point_heap = (uint32_t *)malloc(4);
*point_heap = 0x3421;
free(point_heap);
num_byte_stack = 0x11;
char *pbeginstk = __section_begin("CSTACK");
char *pbeginheap = __section_begin("HEAP");
printf("CSTACK addr is 0x%x\r\n",pbeginstk);
printf("HEAP addr is 0x%x\r\n",pbeginheap);
printf("num_byte addr is 0x%x\r\n",&num_byte);
printf("num_word addr is 0x%x\r\n",&num_word);
printf("num_word_const addr is 0x%x\r\n",&num_word_const);
printf("point_heap addr is 0x%x\r\n",&point_heap);
printf("point_heap is 0x%x\r\n",point_heap);
printf("num_byte_stack addr is 0x%x\r\n",&num_byte_stack);
printf("num_byte_static addr is 0x%x\r\n",&num_byte_static);
}
STACK addr is 0x20000320
HEAP addr is 0x20000720
num_byte addr is 0x20000308
num_word addr is 0x2000030c
num_word_const addr is 0x8002a44
point_heap addr is 0x20000310
point_heap is 0x20000728
num_byte_stack addr is 0x200006f8
num_byte_static addr is 0x20000318
char *pbeginstk = __section_begin("CSTACK");
char *pbeginheap = __section_begin("HEAP");
STACK addr is 0x20000320
HEAP addr is 0x20000720
num_byte_stack addr is 0x200006f8
point_heap is 0x20000728
声明:本文经作者授权,转载自“知晓编程”公众号。转载仅为学习参考,不代表本号认同其观点,本号亦不对其内容、文字、图片承担任何侵权责任。如有版权问题,请联系删除!
IIC深圳,扫码报名
▼