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

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

RE: [avr-gcc-list] Wierd Calls.


From: Weddington, Eric
Subject: RE: [avr-gcc-list] Wierd Calls.
Date: Tue, 10 Mar 2009 10:29:40 -0600

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of David VanHorn
> Sent: Tuesday, March 10, 2009 10:01 AM
> To: AVR-GCC
> Subject: [avr-gcc-list] Wierd Calls.
> 
> I'm probably doing something wrong again.. 
>  
> I've seen this on and off, as I'm stepping through the 
> compiled code in the asm window.
> I will have a call that makes no sense to me, sort of 
> randomly appearing as I change the code, and dissapearing for 
> no obvious reason.  It's always to the lcd_init routine, even 
> though this code has nothing to do with the LCD... 
>  
> Below is where it's currently happening.
> This SHOULD just load BIN with a value between 0 and 31.
> It has to pull data from Raw_Data[0] according to the value 
> of Raw_Data_Index which will be between 0 and 511.   
> Raw_Samples is 512, and Sample_Bins is 32.
>  
> 1051:      Bin = (Raw_Data[0][Raw_Data_Index]) / (Raw_Samples 
> / Sample_Bins); // Find the bin for the old raw data
> +0000031B:   90C00076    LDS       R12,0x0076     Load direct 
> from data space
> +0000031D:   90D00077    LDS       R13,0x0077     Load direct 
> from data space
> +0000031F:   01F6        MOVW      R30,R12        Copy register pair
> +00000320:   53EC        SUBI      R30,0x3C       Subtract immediate
> +00000321:   4FFF        SBCI      R31,0xFF       Subtract 
> immediate with carry
> +00000322:   8180        LDD       R24,Z+0        Load 
> indirect with displacement
> +00000323:   E06F        LDI       R22,0x0F       Load immediate
> +00000324:   940E062C    CALL      0x0000062C     Call subroutine
> +00000326:   2FA8        MOV       R26,R24        Copy register
> +00000327:   E0B0        LDI       R27,0x00       Load immediate

If I had to guess, I would guess that this is a word address / byte address 
issue and what it is really calling is math subroutines in libgcc.

Use the -save-temps switch and look at the <file>.s filt that is generated to 
see what the compiler is outputting for the section of code above. That should 
shed some light on which function it thinks its calling.




reply via email to

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