I have to do an emulation of a hardware and have a description of which registers they use in the hardware.
But in my emulation I only need some of the registers with addresses like for example
0x00
0x04
0x0C
0x10
0x1C
Ok, but it seems like you would want to actually provide some space as well so it's more than just a bunch of addresses and it might act like actual RAM.
I was thinking maybe:
Code:
struct mem {
const unsigned int address;
unsigned int space;
}
my_map[] =
{
{ 0x00, 0},
{ 0x04, 0},
{ 0x08, 0},
{ 0x0C, 0},
{ 0x10, 0},
/* ad naseum */
};
After you've set up the addressing then you also actually have a space member to work with (to store whatever).
You're not going to really get away from arrays or lists if what you're really "emulating" is RAM.