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

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

Re: [avr-gcc-list] Operation problem


From: Gerard Marull Paretas
Subject: Re: [avr-gcc-list] Operation problem
Date: Fri, 10 Aug 2007 22:35:58 +0200

> Paulo Marques:
> I think you just answered your own question: if all the variables involved are uint16_t, then that is the precision used for all he _expression_ and it will overflow on the multiplication.

The same happens whether if currentsong.length is uint32_t or uint16_t.


As you asked Eric, I attach the C source of the function, the two disassembly files from both codes, and a diff file between the two asm files.

The items of structure are defined as follows:

struct{
    uint16_t bitrate;
    uint32_t length;
    uint16_t frames;
    uint16_t samples_per_sec;
    uint16_t samples_per_frame;
    uint8_t mpeg;
    uint8_t layer;
    uint8_t channel;
}currentsong;

I hope this information is enough now. (Sorry to not provide something more before :) )

Thanks for your help! Gerard.

Attachment: csource.c
Description: Text Data

Attachment: asm_works.s
Description: Binary data

Attachment: asm_notworks.s
Description: Binary data

Attachment: asm_diff.s
Description: Binary data


reply via email to

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