Sanjiv Kumar Gupta wrote:

> > What is stopping the value of 'foo' itself being > 255?
> Programmer will get an overflow error for that during linking.

For my curiosity, what's the background here? Do you really only have 256
bytes of storage on this system?

If you've got eight bit registers in a larger address space then I'd expect
you'd want to address data outside the first 256 bytes, e.g. you'd actually
want

    add r1, lowpart_offset(foo)
    add r2, highpart_offset(foo)

in which case

    add r1, lowpart_offset(foo + 10)
    add r2, highpart_offset(foo + 10)

would make sense.

On the other hand, if you actually do only have 256 bytes storage then you'd
want to the link to fail anyway because the hardware won't cope - so the
overflow error is as good as anything else, isn't it?

Rup.

Reply via email to