On Mar 31, 2006, at 12:05 PM, Wouter van Ooijen wrote: >> Mip for mip, are the ARM instructions capable of much more? > > As always, it depends. If you can away with the RMW problem, a PIC can > set or reset a pin in a single instruction. This is a bit more > complicated on an ARM, but it can be done. > > An ARM is a register-register architecture. So no direct > manipulation of bits in memory. Compare: > > # one 12, 14 or 16 bit instruction > bsf some_place_in_memory, a_specific_bit > > with > > # 4 instructions, 32 bits each > ldr r0, =some_place_in_memory > ldr r1, [ r0 ] > and r0, r0, # ( 1 << a_specific_bit ) > str r1, [ r0 ] > I've been reading the Luminary data sheets (and designing hypothetical PCBs...) There is apparently a new feature in the cortex M3 core called "bit banding" where ARM throws address space at the bit-addressing "problem" of the architecture. That means that for an arbitrary bit N in some register address M, you can access JUST the one bit by using memory address: bitbandbase + (M *32) + (N*4) making the above example something like: ldr r0, =(bitbandcalc(some_place_in_memory, a_specific_bit) str r_known_one, [r0] Where at least one of those instructions is only 16 bits... Sorta neat. I'm not sure how I feel about "wasting" 32 bytes of address space for each byte of "bit-banded" memory, but I guess a small ARM processors DOES have address space to burn! BillW -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist