avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Bootloader - SPM - Mega128


From: Pieter Potgieter
Subject: Re: [avr-gcc-list] Bootloader - SPM - Mega128
Date: Wed, 23 Jan 2002 10:30:41 +0200

On Tuesday 22 January 2002 07:43 pm, you wrote:
> Perhaps the compiler/assembler do not know the instruction
> yet. It is possible that you have to write the byte code
> of the instruction with ".byte 0xNN" or similar stuff.

>
> Bye
> Christoph P.
>
> Pieter Potgieter wrote:
> > Hi folks
> >
> > Has someone written a bootloader for the mega128 ?
> >
> > How do I get the following opcode to work?
> >  __asm__ __volatile__ ( "spm" : : );
> >
> > If I use this the compiler tells me the following:
> > ccDPY2QO.s:1997: Error: illegal opcode spm for mcu atmega128
> >
> > I intend to write macros to handle the assembler for the bootloader
> > page_write and page_load etc.
> >
> > Question:
> > How is the SPM instruction involved, because in the example bootloader
> > code in the datasheet for the Mega128, I do not see the spm instruction
> > being used?
> >

I think you are right, the assembler does not know the instruction,
I do not know enough assembler to define a new opcode.
Please any suggestions ?
I saw in the atmel appnote109, for the bootloader that the opcode they use 
are 0x95E8.  The way thay use it is to define it the following way:
#define _SPM    DW 0x95E8 

But now the assembler complains about DW
Someone with more knowledge please help

Thanks Christoph
Pieter
avr-gcc-list at http://avr1.org



reply via email to

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