Ah, this becomes (somewhat) clearer now. And then not...
Following it through, it seems that its possible to generate two
slightly differing prologues;
ignoring other registers, and assuming a tmp reg (r0), you get:
move treg, rampd
push treg
move rampd, 0
...
move treg, rampz
push treg
if AVR_
Ian,
Trying again... :-)
No, the "last one" should NOT be AVR_HAVE_RAMPZ.
The Z register and the RAMPD register are used together to address
memory in an AVR part which supports RAMPD.
Some later AVR micrcontrollers have a "Z" register (i.e., AVR_HAVE_RAMPZ
is set). Newer, more capable ver
Ok, I don't want to sound rude, but did anyone actually *read* what I wrote?
I'll highlight the parts of lines in question this time, perhaps that
will help...
if (AVR_HAVE_RAMPZ
^^
&& TEST_HARD_REG_BIT (set, REG_Z)
&& TEST_HARD_REG_BIT (set, REG_Z + 1))
Ian,
I apologize if I was being obtuse! :-)
The AVR_HAVE_RAMPD #define tells the routine "emit_push_sfr()" to save
the RAMPD register, but only if the third parameter to the call is
non-zero. The constant AVR_HAVE_RAMPD will be non-zero if the AVR
micro-architecture supports a RAMPD register
Maybe one day even a problem in 32bit architectures.
On Thu, Dec 16, 2021 at 7:50 PM Bruce D. Lightner
wrote:
> Ian,
>
> Just from a purely AVR architecture point of view, the AVR_HAVE_RAMPD
> #define indicates that the AVR chip in question supports the "RAMP" paging
> register, described as fol