Code difference AVR 90S8515 vs. ATmega8515

Hi,

I found that when I compile a certain project in Imagecraft AVR for the

90S8515 or for the mega8515, the relative code sizes are 92% and 84% respectively. Is this the result of new instructions I am unaware of or can the Imagecraft compiler produce tighter code because some silicon bugs have been resolved on the mega8515?

Meindert

Reply to
Meindert Sprang
Loading thread data ...

can

have

There are some new instructions, and some variations on existing ones. Differences include movw instructions for moving two registers at once, different addressing modes for the lpm instruction, and a hardware multiplier which makes multiplication code (including array access) much smaller.

Reply to
David Brown

I figured that much, but couldn't download the instruction set. The atmel site seems to be down.

Meindert

Reply to
Meindert Sprang

Aha, my code uses quit a lot of rommed strings to be output. This sure explains the smaller code.

Thanks, Meindert

Reply to
Meindert Sprang

Just be very carefull -> if there is ever a chance Mega8515-built code can be installed on an (older) 90S8515 field upgrade!

-jg

Reply to
jim granville

Thanks for the hint Jim, but that won't be the case.

Meindert

Reply to
Meindert Sprang

atmel

They have different signature bytes, so you really need so screw up to have that happen...

--
Best Regards
Ulf at atmel dot com
These comments are intended to be my own opinion and they
may, or may not be shared by my employer, Atmel Sweden.
Reply to
Ulf Samuelsson

Signature bytes do not really protect against the problem, which is accidental ship (by a user of both devices) of Mega8515 code into a

90S8515 device. Meindert was sharp enough to spot that the change of target gave different code sizes - the average AVR user is rather more likely to 'find out the hard way' - tho you could argue that since clearly (90S Mega) then it is user beware....

It would probably help if AVR085: Replacing AT90S8515 by ATmega8515 mentioned that opcode changes mean a Mega8515 build may no longer be backward compatible on any existing 8515 products. - ie as a mid-run production change, there are risks.

-jg

Reply to
jim granville

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.