rom_index should be modulo a power of two