<html>
<body>
Hi Bengt,<br><br>
I assume the function at <font size=2>0x00000A68 in your first listing is
'div16s', in which case the result is returned in R16/R17. That being so,
then the first parameter being passed to the function <br><br>
S_ShortFilter(ppgAcDiff, &filtMem[channel], filterdjup,
&firFiltMem[channel]);<br><br>
is already in the correct register pair and doesn't need to be moved.
Sorry, but I don't think he problem is with the compiler.<br><br>
</font>All the best for now,<br>
John<br><br>
<br>
At 13:44 04/05/2007, you wrote:<br>
<blockquote type=cite class=cite cite=""><font size=2>Hi.<br>
<br>
I know that I am usually wrong about this but this looks like a compiler
bug to me. Please have look.<br>
<br>
ppgAcDiff and acGain are signed short.<br>
<br>
This simple line didn’t do anything so I checked the assembler. Actually
this is very similar to my previous problem but this time the variable is
used at the line right after. Just to provoke, I inserted a simple ++ in
between and yes, now the result is saved. What is going on here?<br>
<br>
ppgAcDiff = ppgAcDiff/acGain;<br>
<br>
<br>
411:
ppgAcDiff = ppgAcDiff/acGain;<br>
+0000020D: 019C
MOVW
R18,R24 Copy
register pair<br>
+0000020E: 0187
MOVW
R16,R14 Copy
register pair<br>
+0000020F: 940E0A68 CALL
0x00000A68 Call subroutine<br>
414:
subtractTotalDiffFiltered = S_ShortFilter(ppgAcDiff,
&filtMem[channel], filterdjup, &firFiltMem[channel]);<br>
<br>
<br>
<br>
411:
ppgAcDiff = ppgAcDiff/acGain;<br>
+0000020D: 019C
MOVW
R18,R24 Copy
register pair<br>
+0000020E: 0187
MOVW
R16,R14 Copy
register pair<br>
+0000020F: 940E0A6D CALL
0x00000A6D Call subroutine<br>
+00000211: 0178
MOVW
R14,R16 Copy
register pair<br>
412: ppgAcDiff++;<br>
+00000212: 01C7
MOVW
R24,R14 Copy
register pair<br>
+00000213: 9601
ADIW
R24,0x01 Add immediate to
word<br>
+00000214: 017C
MOVW
R14,R24 Copy
register pair<br>
414:
subtractTotalDiffFiltered = S_ShortFilter(ppgAcDiff,
&filtMem[channel], filterdjup, &firFiltMem[channel]);<br>
<br>
/Bengt<br>
________________________________________________________________<br>
</font><br>
<font face="Times New Roman, Times">Bengt
Ragnemalm</font>
Tel +46 13 22 24 97<br><br>
<font face="Times New Roman, Times" size=2>Research
engineer
FAX: +46 13 10 19 02<br>
</font><br>
<font face="Times New Roman, Times" size=2>Linköpings
Universitet
</font><a href="mailto:bengt.ragnemalm@imt.liu.se">
mailto:bengt.ragnemalm@imt.liu.se</a><br><br>
<font face="Times New Roman, Times" size=2>Inst. för Medicinsk Teknik
Internet:
</font><a href="http://www.imt.liu.se/"><font color="#800080">
http://www.imt.liu.se</a><br>
</font><br>
<font face="Times New Roman, Times" size=2>S-581 85 Linköping SWEDEN<br>
</font><br>
<font face="Times New Roman, Times"> <br>
<br>
</font>_______________________________________________<br>
Icc-avr mailing list<br>
Icc-avr@imagecraft.com<br>
<a href="http://dragonsgate.net/mailman/listinfo/icc-avr" eudora="autourl">
http://dragonsgate.net/mailman/listinfo/icc-avr</a></blockquote></body>
</html>