Always. James Newtons Massmind wrote: >Is it just me or is assembly sometimes easier than C? > >--- >James Newton: PICList webmaster/Admin >mailto:jamesnewton@piclist.com 1-619-652-0593 phone >http://www.piclist.com/member/JMN-EFP-786 >PIC/PICList FAQ: http://www.piclist.com > > > > > >>-----Original Message----- >>From: piclist-bounces@MIT.EDU >>[mailto:piclist-bounces@MIT.EDU] On Behalf Of Sergio Masci >>Sent: 2004 Oct 06, Wed 11:13 >>To: Microcontroller discussion list - Public. >>Subject: [PIC] new optimisation in XCSB >> >>Hi all, >> >>I hope you will agree that the following info is worth >>mentioning. Version 1.7.0 of the xcsb compiler now also >>implements result promotion optimisation. The following xcsb >>source code is compiled into just 3 machine instructions >> >>hwreg PORTA = 5 >>hwreg PORTB = 6 >> >>const RA3 = (&PORTA << 3) + 3 >>const RB4 = (&PORTB << 3) + 4 >> >>proc inline set_bit(uint id) >> *(id >> 3) |= (1 << (id & 7)) >>endproc >> >>proc inline ubyte test_bit(uint id) >> return (*(id >> 3) & (1 << (id & 7))) != 0 endproc >> >>proc main() >> if test_bit(RA3) == 1 then >> set_bit(RB4) >> endif >>endproc >> >> >>Regards >>Sergio Masci >> >>http://www.xcprod.com/titan/XCSB - optimising PIC compiler >> >>_______________________________________________ >>http://www.piclist.com >>View/change your membership options at >>http://mailman.mit.edu/mailman/listinfo/piclist >> >> > > >_______________________________________________ >http://www.piclist.com >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist > > _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist