Unsigned division of 32 bit by 16 bit giving 32 quot &16 HKarl, here are my suggestions:
1) The Result(Quotient) does not need to be cleared during loop initialization, since it is completely overwritten inside the loop.
2) Use a...

Friday, 28 July 2006 - 02:31

Need help in efficient code Questions:
1) What is the typical change in "progress" between calls to crossfade() ? Is it always incremented by 1?
2) What is the typical value for max_progress? Is it a...

Thursday, 20 July 2006 - 13:58

64-bit division, C/asm mix You're welcome, svofski. It was fun problem that I couldn't resist.
Here's everything I know about passing and returning data between GCC and assembly functions.
The main gotcha...

Monday, 17 July 2006 - 19:37

simple branch/compare question zoomcityzoom wrote:@zoom: your solution works for all cases.
Did you just congratulate yourself? :P
Anyways.. In my haste to mod peret's code, what I thought that i had written,...

Monday, 17 July 2006 - 07:51

simple branch/compare question peret, do you really need the 16bit adiw?
Isn't this equivalent? (and 1 cycle faster) :
ldi r24, data
ldi r25, 0x20
add r24, r25
brcs...

Monday, 17 July 2006 - 06:14

simple branch/compare question Heh, I'm reading the other one right now.
I read this one first, and was quite excited to be able to make the first response... But, It turned out that I was really about 10 posts...

Monday, 17 July 2006 - 03:04

simple branch/compare question I guess I'm late to the party. I saw the other thread first, and put my response there. https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=40341
That'll...

Monday, 17 July 2006 - 02:56

simple branch/compare question What is the range of "data" and "volts"? Your description above implies that both "data+20" and "volts" can exceed $FF.
In this case, the straightforward method to solve this...

Monday, 17 July 2006 - 02:31

64-bit division, C/asm mix I thought it would be helpful to post my algorithm the form of C:
uint32_t CalcFTW( uint32_t Freq )
{
uint32_t Dividend = Freq;
uint32_t Quotient = 0;
uint32_t...

Saturday, 15 July 2006 - 19:58

64-bit division, C/asm mix Ok, that makes sense.
Two points:
1) All you really need is the first 28 fractional bits of Freq/Fmclk.
2) Since you are throwing out the integer portion, I assume that it's...

Saturday, 15 July 2006 - 18:45

64-bit division, C/asm mix Your code looks great for your initial foray into assembly.
Sizewise, it's roughly as small as it can get. There about 9-10 lines that can be removed.
With some algorithm...

Saturday, 15 July 2006 - 05:33

Remainder How did you calculate your expected result?
Given your TestVal: (broken into 32byte chunks, to void messing up the forum)...

HKarl, here are my suggestions: 1) The Result(Quotient) does not need to be cleared during loop initialization, since it is completely overwritten inside the loop. 2) Use a...

Questions: 1) What is the typical change in "progress" between calls to crossfade() ? Is it always incremented by 1? 2) What is the typical value for max_progress? Is it a...

You're welcome, svofski. It was fun problem that I couldn't resist. Here's everything I know about passing and returning data between GCC and assembly functions. The main gotcha...

zoomcityzoom wrote:@zoom: your solution works for all cases. Did you just congratulate yourself? :P Anyways.. In my haste to mod peret's code, what I thought that i had written,...

peret, do you really need the 16bit adiw? Isn't this equivalent? (and 1 cycle faster) : ldi r24, data ldi r25, 0x20 add r24, r25 brcs...

Heh, I'm reading the other one right now. I read this one first, and was quite excited to be able to make the first response... But, It turned out that I was really about 10 posts...

I guess I'm late to the party. I saw the other thread first, and put my response there. https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=40341 That'll...

What is the range of "data" and "volts"? Your description above implies that both "data+20" and "volts" can exceed $FF. In this case, the straightforward method to solve this...

I thought it would be helpful to post my algorithm the form of C: uint32_t CalcFTW( uint32_t Freq ) { uint32_t Dividend = Freq; uint32_t Quotient = 0; uint32_t...

Ok, that makes sense. Two points: 1) All you really need is the first 28 fractional bits of Freq/Fmclk. 2) Since you are throwing out the integer portion, I assume that it's...

Your code looks great for your initial foray into assembly. Sizewise, it's roughly as small as it can get. There about 9-10 lines that can be removed. With some algorithm...

How did you calculate your expected result? Given your TestVal: (broken into 32byte chunks, to void messing up the forum)...

## Pages