Why not using an offset switch? when you press it, you jump to a reading routine put the value into a word variable that will be use as the offset. In this way the offset will never be greater then the true value.