---- START NEW MESSAGE --- Received: from cherry.ease.lsoft.com [209.119.0.109] by dpmail10.doteasy.com with ESMTP (SMTPD32-8.05) id AF9D110401CC; Wed, 28 Jan 2004 15:02:53 -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 <18.00CC1825@cherry.ease.lsoft.com>; Wed, 28 Jan 2004 18:02:40 -0500 Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8e) with spool id 9531 for PICLIST@MITVMA.MIT.EDU; Wed, 28 Jan 2004 18:02:34 -0500 Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail V1.2d/1.8d) with BSMTP id 8006; Wed, 28 Jan 2004 18:02:17 -0500 Received: from mta9.srv.hcvlny.cv.net [167.206.5.42] by mitvma.mit.edu (IBM VM SMTP Level 430) via TCP with ESMTP ; Wed, 28 Jan 2004 18:02:16 EST X-Comment: mitvma.mit.edu: Mail was sent by mta9.srv.hcvlny.cv.net Received: from optonline.net (ool-18bed33a.dyn.optonline.net [24.190.211.58]) by mta9.srv.hcvlny.cv.net (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HS8001642MXX9@mta9.srv.hcvlny.cv.net> for piclist@mitvma.mit.edu; Wed, 28 Jan 2004 18:01:46 -0500 (EST) MIME-version: 1.0 X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT Message-ID: <40183F76.6050208@optonline.net> Date: Wed, 28 Jan 2004 18:02:14 -0500 Reply-To: pic microcontroller discussion list Sender: pic microcontroller discussion list From: Tom Dickinson Subject: [PIC]: Re: Trouble assembling code for 16F84A Comments: cc: dwayner@planet.eon.net To: PICLIST@MITVMA.MIT.EDU Precedence: list X-RCPT-TO: Status: U X-UIDL: 371856168 Dwayne, Thanks for your advice, and thanks to Westfield, Hopsfield and others who immediately identified my problem. After changing the register labels to upper case the code assembled OK, and after a few tweaks it runs in MPSIM. I realized I needed a trap for zero divisor and that's installed and working. I'm assembling parts and soon will burn a PIC (and maybe crash). As to context saving, the way the program evolved, global interrupts are disabled for everything except the three instructions where the input is polled: poll_input btfsc PORTA, 0 goto count_in goto poll_input count_in bcf INTCON, 7 ;disable global interrupts ....etc. I don't think there is any sensitive context here to be saved. After I get this running, I plan to post the code and ask for a critique of style, bad practice etc. It's about 200 lines of code, is that too long to post? This is my first real PIC program, I did a short test program: increment a 16 bit register using TMR0 interrupt, display either lo byte or hi byte on LEDs on PORTB, selected by pushbutton input. I burned this and it worked, so I know I'm on the right track. thanks for your help, Tom -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics .