On Tuesday 27 July 2004 10:12, Matthias Weingart wrote: > 2998: 0d 4e mov r14, r13 ; > 299a: 0b 43 clr r11 ; <- should be > R12?? 299c: 1e 42 9a 02 mov &0x029a,r14 ;0x029a ->a 29a0: > 1f 42 9c 02 mov &0x029c,r15 ;0x029c ->a 29a4: 0f de > bis r14, r15 ; 1. You're using a slightly outdated version of gcc, cause 'clr r11' followed by 'clr r12'
> 29b2: 0e 8c sub r12, r14 ;<----------?? > 29b4: 0f 7d subc r13, r15 ; > 29b6: 05 34 jge $+12 ;abs 0x29c2 2.this is a compare and branch instruction (cbranchsi_others) how do you think longs being compared? I thought there is no long compare instruction in msp430. > Where is R12 initialized??? (using <<16 it works). look above > > And there must be another bug, that I have not yet found. > When I try to calculate a average over 256 values using long I get > different results compared to my solution calculated with > the host PC (I use "short int" and int instead of int and long). make sure you not running over the stack limit. > > Use long with care! ;-( you have to use everything with care ... not only longs and ints, but everything. Take special care of use matches and lighters in public places. > > How can I avoid the usage of so much registers? > mov #1, r11 > mov r11,r15 > ret You do not need to avoid it, cause if you look _carefully_ to the code, you'll find, that 'mov r11,r15' is a landing point for some jump instruction you wrote. > seems a little bit crazy!? It does not... Actually this is a good thing to use 'lint'. It helps beginners to find many errors before first compile attempt. For example this will complain about unefficient cast ;) Cheers, ~d > > M. > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Mspgcc-users mailing list > Mspgcc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mspgcc-users