---- START NEW MESSAGE --- Received: from cherry.ease.lsoft.com [209.119.0.109] by dpmail10.doteasy.com with ESMTP (SMTPD32-8.05) id AD1C3EA016E; Fri, 30 Jan 2004 11:14:36 -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 <21.00CC520B@cherry.ease.lsoft.com>; Fri, 30 Jan 2004 13:41:48 -0500 Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8e) with spool id 3039 for PICLIST@MITVMA.MIT.EDU; Fri, 30 Jan 2004 13:21:06 -0500 Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail V1.2d/1.8d) with BSMTP id 5875; Fri, 30 Jan 2004 13:20:00 -0500 Received: from staff.webbox.com [207.183.234.76] by mitvma.mit.edu (IBM VM SMTP Level 430) via TCP with ESMTP ; Fri, 30 Jan 2004 13:19:58 EST X-Comment: mitvma.mit.edu: Mail was sent by staff.webbox.com Received: from mauve [207.231.76.117] by staff.webbox.com (SMTPD32-6.00) id AFBD5F71007E; Fri, 30 Jan 2004 10:17:33 -0800 Mime-Version: 1.0 Content-Type: text/plain content-length: 1342 Message-ID: <30010430.37200@webbox.com> Date: Fri, 30 Jan 2004 10:17:35 -0800 Reply-To: pic microcontroller discussion list Sender: pic microcontroller discussion list From: William Couture Subject: Re: [PIC:] Disassemblers KISS or not To: PICLIST@MITVMA.MIT.EDU Precedence: list X-RCPT-TO: Status: U X-UIDL: 371856544 >--- Original Message --- >From: Dave Tweed >Date: 1/30/04 8:58:29 AM > >> Which is why any decent disassembler has to do >> instruction emulation and tracking. Otherwise, all you >> have is a computerized opcode lookup table. >> > >Yeah, me too, although I found that an intermediate >approach worked well. > >I wrote a disassembler that kept a table of "entry points" >to executable code. You would start out by seeding this >table with the hardware entry points (reset and interrupt >vectors), and as the disassembler proceeded, it would add >additional entries every time it encountered any sort of >branch or call. When ever it got to an unconditional jump >or return, it would abandon the current path and start on >another unexplored entry point from the table. Eventually, >it would find all of the reachable code in the >system. Yup, That's what I'm doing, too. >The only things it couldn't handle were indirect jumps and >calls (computed or table-driven), but these were rare >enough that it was easy to identify them and add the >necessary entries to the entry point table manually. And (using the PIC as an example) it can't tell register 0x05 (PORTA) from 0x85 (TRISA). That's why PICDIS has PICEMU's instruction emulation doing register tracking. Bill -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body .