> -----Original Message----- > From: > avr-gcc-list-bounces+eweddington=cso.atmel....@nongnu.org > [mailto:avr-gcc-list-bounces+eweddington=cso.atmel....@nongnu. > 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 mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list