> -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of Isaac Marino Bavaresco > Sent: 26 May 2009 18:34 > To: Microcontroller discussion list - Public. > Subject: RE: [PIC] Source boost V HiTech compilers for C use > > > Look how they do 'Var = 0;' : > > bcf STATUS,C > movlw 0 > btfsc STATUS,C > movlw 1 > movwf Var > > 'Var = 1;' > > clrf Var > bsf STATUS,C > rlf Var,f > > 'Var = 2;' > > clrw > iorlw 2 > movwf Temp > movf Temp,w > movwf Var > > And so on... I still don't think it's deliberate, most likely caused by the way the new compilers work, with generation of intermediate P code as mentioned by someone else. FWIW the older compilers also produced some nonsense code for simple expressions prior to optimisation, e.g. from one of my old projects using PICC 8.05: 148: if( TMR1IE && TMR1IF ) { 0011 1683 BSF 0x3, 0x5 0012 1303 BCF 0x3, 0x6 0013 1C0C BTFSS 0xc, 0 0014 281B GOTO 0x1b 0015 2816 GOTO 0x16 0016 1283 BCF 0x3, 0x5 0017 1C0C BTFSS 0xc, 0 0018 281B GOTO 0x1b 0019 281A GOTO 0x1a 001A 281D GOTO 0x1d 001B 281C GOTO 0x1c 001C 289C GOTO 0x9c Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist