At 09.53 2011.10.25, you wrote: >I think I'm losing confidence in Microchip's compiler expertise... > >What's the point again of defining the SFR addresses in the linker =20 >instead of in the C include files? >It seems to prevent a significant slew of "obvious" optimizations, and =20 >there is still a huge per-chip source include as well, so it's not =20 >really moving any chip dependencies to link time... > > digitalWriteFast(3,1); // compiles to LATxSET =3D b >9d00135c: 24020001 li v0,1 >9d001360: 3c03bf88 lui v1,0xbf88 >9d001364: ac6260e8 sw v0,24808(v1) > digitalWriteFast(3,0); // compiles to LATxCLR =3D b >9d001368: 3c03bf88 lui v1,0xbf88 >9d00136c: ac6260e4 sw v0,24804(v1) > >Love that double load of identical constants! > >Is this the sort of thing that Microchip's "global optimization" fixes? I hope so. Oh, and that was digitalWriteFast, I have seen more horrific output from the compiler. :D This is an example (but there could be more and better) that asm is not finished on the PIC32, where actually it's even easier than in dsPIC or PIC. I prefer to code in asm, if I am in a hurry I do write a function in C, develop, debug.. when I'm happy with it, I rewrite it in asm, maybe even taking a look at the disassembly of it. >Grr. >BillW --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .