寄存器值从 0x20000000 到 0x20000FFC

Register values from 0x20000000 to 0x20000FFC

我想读取从0x20000000到0x20000FFC的寄存器的值。

架构:ARM
寄存器宽度:32位

我做了以下操作:

#define REG      0x20000000

unsigned int volatile * const port = (unsigned int *) REG;

for(int i=0; i<4093; i++)
{
    printf("%d", *(port+i));
}

这是正确的方法吗?

#define REG      0x20000000

unsigned int volatile const* port = (unsigned int *) REG;

for(; port < (unsigned int *) REG+0x1000; port++)
    printf("%u", *port);