[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] Re: Wierd Calls.
From: |
Weddington, Eric |
Subject: |
RE: [avr-gcc-list] Re: Wierd Calls. |
Date: |
Wed, 11 Mar 2009 08:28:53 -0600 |
> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of David VanHorn
> Sent: Wednesday, March 11, 2009 8:24 AM
> To: AVR-GCC
> Subject: Re: [avr-gcc-list] Re: Wierd Calls.
>
>
> Well.. Still flogging the horse here.
>
>
>
> I have the .S file, but I don't know how to interpret it.
It's the assembly output from the compiler. It goes straight into gas and out
comes your object code.
>
> I carved up the statement even further, and moved the
> declarations so all the vars are in ram so I can watch them easily.
>
> A = Raw_Data[0][Raw_Data_Index]; // Gives the
> expected result.
> Bin = (A / Data_Divisor); // Gives
> nonsense, AND trashes data in ram!
>
> Here's the asm output. The first line is what I'd expect.
That's not the asm output. That is a listing, because of the addresses on the
side.
> 1072: A = Raw_Data[0][Raw_Data_Index]; // Get
> the old data
> +00000337: 91C00076 LDS R28,0x0076 Load direct
> from data space
> +00000339: 91D00077 LDS R29,0x0077 Load direct
> from data space
>
> The second one starts out normally, but then this call to
> 0x622, which is hosing everything.
>
> 1073: Bin = (A / Data_Divisor); // Find the bin
> for the old raw data
> +0000033B: 01FE MOVW R30,R28 Copy register pair
> +0000033C: 5FE2 SUBI R30,0xF2 Subtract immediate
> +0000033D: 4FFE SBCI R31,0xFE Subtract
> immediate with carry
> +0000033E: 8180 LDD R24,Z+0 Load
> indirect with displacement
> +0000033F: E090 LDI R25,0x00 Load immediate
> +00000340: E06F LDI R22,0x0F Load immediate
> +00000341: E070 LDI R23,0x00 Load immediate
> +00000342: 940E0622 CALL 0x00000622 Call subroutine
What does the .S file show for the code snippet above? That's what we're trying
to get at.
- [avr-gcc-list] Wierd Calls., David VanHorn, 2009/03/10
- RE: [avr-gcc-list] Wierd Calls., Weddington, Eric, 2009/03/10
- [avr-gcc-list] Re: Wierd Calls., David Brown, 2009/03/10
- Re: [avr-gcc-list] Re: Wierd Calls., David VanHorn, 2009/03/10
- Re: [avr-gcc-list] Re: Wierd Calls., David VanHorn, 2009/03/11
- RE: [avr-gcc-list] Re: Wierd Calls.,
Weddington, Eric <=
- Re: [avr-gcc-list] Re: Wierd Calls., Dave Hylands, 2009/03/11
- Re: [avr-gcc-list] Re: Wierd Calls., David VanHorn, 2009/03/11
- RE: [avr-gcc-list] Re: Wierd Calls., Dave Hansen, 2009/03/11
- Re: [avr-gcc-list] Re: Wierd Calls., Paulo Marques, 2009/03/12
- Re: [avr-gcc-list] Re: Wierd Calls., Dave Hylands, 2009/03/12
- RE: [avr-gcc-list] Re: Wierd Calls., Weddington, Eric, 2009/03/12
- Re: [avr-gcc-list] Re: Wierd Calls., Dave Hylands, 2009/03/13
- Re: [avr-gcc-list] Re: Wierd Calls., David VanHorn, 2009/03/13