[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] code for 90s4433 is using SPH

From: Marek Michalkiewicz
Subject: Re: [avr-gcc-list] code for 90s4433 is using SPH
Date: Sun, 23 Feb 2003 22:29:33 +0100
User-agent: Mutt/1.4i

On Sun, Feb 23, 2003 at 08:08:58PM +0100, Volkmar Dierkes wrote:
> As I have found in the data sheet SPH is defined as reserved. There 
> is no hint that it is always zero.

But AVR-GCC has always worked that way (long time ago there was
no -mtiny-stack option at all, and most devices had no SPH).
OK, I've just asked address@hidden to be sure...  But datasheets
quite often don't tell the whole truth - for example, the fact
that setting the I flag enables interrupts only after the next
instruction was not clearly documented, and found experimentally.
GCC depends on it, and Atmel officially confirmed it later.

We don't have a separate "avr2 with 8-bit stack pointer"
architecture with its own set of libraries, so even if your
own program never accesses the non-existent SPH, any library
code could still do it.

> I am already in contact with the guys of VMLAB to get a workaround, 
> but I think the avr-gcc behavior should be to didn't use SPH for 
> devices where it didn't exist.

I'm not familiar with VMLAB, but I'd suggest to work around it in
such a way that the non-existent SPH reads as zero, and can be
written with a zero value too.  Writing a nonzero value probably
should give a warning - might help to catch a bug in the program
(trying to set the stack pointer to point to non-existent memory).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]