How to define register address dynamically?

How to define register address dynamically?

Hello everyone,
I have to read event buffer from one device. It would be hell of a work to define all of the registers from buffer - so I wanted to define only 5 variables, all of the rest is the same. I mean, I have 500 registers - every event has one for event code and 4 for date and time.
So my question is: am I able to dynamically write register address? It would be really helpful

This is a migrated post! Originally posted on 13.11.2015 by user kuki. Please be aware that information can be outdated.