Em 26/10/2011 13:11, William "Chops" Westfield escreveu: > On Oct 26, 2011, at 3:17 AM, Isaac Marino Bavaresco wrote: > >> What the OP wants? >> I can see "load the bit mask" -> "load base address" -> "output the >> value at base address+offset". > The original complaint was against the slightly larger piece of > source code for: > digitalWriteFast(3,1); > digitalWriteFast(3,0); > Which produced: > li v0,1 > lui v1,0xbf88 > sw v0,24808(v1) > lui v1,0xbf88 > sw v0,24804(v1) > Which has an obvious extra instruction. > In a loop, two different registers are used to hold the (same) > address "page" of two io registers. > > It's similar to setting the RAM page explicitly for every access > on PIC16; not really horrible, but exactly the sort of thing that > I would hope a compiler would NOT do. I guess Microchip is really > hooked on the idea! :-) > > BillW I'm pretty sure that with optimizations on, the compiler would remove the redundant instructions. Isaac --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .