title: understanding uart registers indexing
body: <p>The function below prints out the contents of a UART register. This is the register map. </p>
  
  <p><a href="https://i.stack.imgur.com/wnoWA.png" rel="nofollow noreferrer">uart registers</a> </p>
  
  <p>Could somebody explain why, the for loop goes up in <code>+=4</code>?</p>
  
  <p>Thank you</p>
  
  <pre><code>#define UART0_BASE 0x21000
  
  void print_uart(unsigned int base) {
  int i;
  int val;
  unsigned int adr;
  
    for (i=0; i&lt; 0x18; i+=4) {
      adr = base + i;
      printf("Uart %s [0x%x] -&gt; 0x%x\n",uart_reg[i&gt;&gt;2],adr,val);
    }
  }
  </code></pre>