Sign in

username:

password:



Not a member?

Search Comp.Arch.Embedded



Search tips

embedded by Keywords

68HC11 | 68HC12 | 8051 | 8052 | ARM | ARM7 | Asic | AT91 | AT91RM9200 | Atmel | AVR | AVRStudio | Bootloader | CFP | CompactFlash | Cygnal | Cypress | Dataflash | DSP | eCos | EEPROM | Embedded Linux | Emulator | Endian | Ethernet | Firewire | FPGA | Freescale | GCC | GNUARM | GSM | H8 | HDLC | I2C | Infineon | Interrupts | Java | JTAG | LCD | LED | LPC2000 | MCU | Microchip | MMC | MPLAB | MSP430 | PC104 | PCB | PCI | PCMCIA | PowerPC | Rabbit | RS232 | RS485 | RTOS | SBC | SDRAM | Sensor | SPI | STK500 | UART | UML | USART | USB | Verilog | VHDL | VxWorks | Xilinx

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | Comp.Arch.Embedded | Difference Between Stack Pointer and Frame Pointer

There are 11 messages in this thread.

You are currently looking at messages 10 to 11.

Re: Difference Between Stack Pointer and Frame Pointer - Dave Hansen - 2005-07-05 11:20:00

On Tue, 05 Jul 2005 14:47:59 GMT, "Richard" <n...@thanks.com> wrote:

>> Most AVR compilers have a data stack separate from the hardware stack.
>
>I'm interested in this statement.  The IAR compiler is the only AVR compiler
>I have come across that does this, and I've never been sure why.  Any clues?

How many AVR compilers have you seen?  The only one that _doesn't_
(AFAIK) is avr-gcc.

The primary reason it that direct manipulation of the hardware stack
pointer (SP) in the AVR is non-atomic (eight bits at a time, and
interrupts must be disabled on writes to prevent ISRs from stomping
all over memory), while the data stack pointer can be kept in a 16-bit
general purpose register that supports 16-bit math.  

IOW, it makes code generation simpler, and the resulting code is both
faster an smaller.

Regards,

                               -=Dave
-- 
Change is inevitable, progress is not.



previous | 1 | 2