---- START NEW MESSAGE --- Received: from cherry.ease.lsoft.com [209.119.0.109] by dpmail10.doteasy.com with ESMTP (SMTPD32-8.05) id A2F1D90019C; Fri, 30 Jan 2004 00:16:49 -0800 Received: from PEAR.EASE.LSOFT.COM (209.119.0.19) by cherry.ease.lsoft.com (LSMTP for Digital Unix v1.1b) with SMTP id <3.00CC4635@cherry.ease.lsoft.com>; Fri, 30 Jan 2004 3:16:33 -0500 Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8e) with spool id 2891 for PICLIST@MITVMA.MIT.EDU; Fri, 30 Jan 2004 03:16:25 -0500 Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail V1.2d/1.8d) with BSMTP id 9844; Fri, 30 Jan 2004 03:14:56 -0500 Received: from smtp.hccnet.nl [62.251.0.13] by mitvma.mit.edu (IBM VM SMTP Level 430) via TCP with ESMTP ; Fri, 30 Jan 2004 03:14:55 EST X-Comment: mitvma.mit.edu: Mail was sent by smtp.hccnet.nl Received: from hccnet.nl by smtp.hccnet.nl via fia65-64-100.dsl.hccnet.nl [80.100.64.65] with ESMTP for id i0U8Evjw012527 (8.12.10/2.03); Fri, 30 Jan 2004 09:14:58 +0100 (MET) User-Agent: Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en, fr, nl, de-de MIME-Version: 1.0 References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <401A1281.2000407@hccnet.nl> Date: Fri, 30 Jan 2004 09:14:57 +0100 Reply-To: pic microcontroller discussion list Sender: pic microcontroller discussion list From: Rob Hamerling Subject: Re: [PIC]: Hitech PICCLITE state machine optimization To: PICLIST@MITVMA.MIT.EDU In-Reply-To: Precedence: list X-RCPT-TO: Status: U X-UIDL: 371856457 Herbert Graf wrote: > I had a look at the assembly on another section of the state machine where > it's even worse: > > if ((ISR_state == 1 && ISR_charBuf == 'P') > > 380 0036 0822 movf _ISR_state,w > 381 0037 3A02 xorlw 2 > 382 0038 1D03 btfss 3,2 > 383 0039 283E goto u191 > 384 003A 0821 movf _ISR_charBuf,w > 385 003B 3A50 xorlw 80 > 386 003C 1903 btfsc 3,2 > 387 003D 286E goto u440 > > Ouch! :) Thanks for any help, TTYL Why do you say 'worse' and why 'ouch'?? You did not mention any requirements (timing, memory space, etc). If there are no such requirements and the code works as expected, then you are done, and optimisation is a waste of time. Regards, Rob. -- Rob Hamerling, Vianen, NL phone +31-347-322822 homepage: http://www.robh.nl/ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body .