Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Bingo600
PostPosted: Nov 23, 2004 - 06:44 AM
Raving lunatic


Joined: Apr 25, 2004
Posts: 3946
Location: Denmark

Hi Guyzz

I just had a peek into some of the assembler listings generated by WinAvr.

My main module is called main ....

WinAvr generates a main.lss file , that seams to contain the "Whole project" , and then there are .lst files generated for each separate module.

The funny part is that the assembly differsf from the .lst and the .lss file.

Almost as if the .lst is generated in a separate run from the .lss file

Is the .lss file generated after optimizing or ???

I have a place where i do a
Code:

uint16_t meas;

  meas <<=3


Thats xlated to : ("this is pseudo code imnot in front of my devel pc"):

ldi rxx,3
loop:
shift "left" x-low
shift "left w. carry" , x-high
dec rxx
bneq loop

in the .lst file.

But in the .lss file its suddenly this code :

ldi rxx,3
loop:
add x-low,x-low
addc x-high,x-high
dec rxx
bneq loop

I know a "<< 1" is = "*2" is = "x+x" , but was just wondering ....

Any hints here ??

I can post the read listings , tonight if someone is interested.


/Bingo
 
 View user's profile Send private message  
Reply with quote Back to top
brandesb
PostPosted: Nov 23, 2004 - 07:32 AM
Newbie


Joined: Apr 14, 2003
Posts: 6
Location: Berlin, Germany

Hello Bingo,

the .lst is generated during assembly stage and
the .lss is generated by avr-objdump from the .elf file,
ist's kind of a disassemly.

If you take a closer look on the instruction set, you will find
the AVRs really do not have a LSL/ROL instruction. Theese are
replaced using ADD/ADC instructions. It is mentioned in the
instruction set manual.

The assembler knows both mnemonics for theese instructions, but
a disassembler usually can't tell the difference any more.

There are some more of theese double meaning instructions (for example status
register manipulating like SEI, CLI, ...).

/Berndt
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits