Hello (to everyone who replied), ----- Original Message ----- From: "Geo" To: Sent: Friday, October 04, 2002 4:43 AM Subject: Re: [PIC]: Program layout results in haywire operation? > On 4 Oct 2002, at 3:28, Tim H. wrote: > > > org 0 > > goto MAIN > > > > MAIN > > ....code here.... > > A call to delay which is in ISD.inc as well as the actual ISD interface code. > > You have not indicated here if the main part ends or just runs into the next > routine... The MAIN code initializes the ports, turns off the comparators, etc. It then drops down into an endless loop looking for a switch input on PORTB. Upon input, it determines which PORTB pin was pressed and then plays the corresponding message on the ISD. FWIW, I'm using the message cueing mode of the ISD chip to select/play the messages. All of the called subroutines end with the appropriate RETURN. I can't, for the life of me figure out why changing the location (order) of Delay and ISD code results in totally different operation. For anyone that's interested, I took notes on which layouts worked, and which ones didn't. Here are the results: http://picmcu.netfirms.com/picpeeve.gif For the "modules" where both are red, it means they're both in the same INC file (yes, I know that isn't the purpose of an INC file). Thanks, Tim H. > > > include ISD.inc > > Contents of ISD.inc: > > ..Delay function...return (return to calling routine) --- the .lst file says Delay begins @ 0x002E > > ..ISD code....return -- .lst says this begins at 0x003F > > end program > > George Smith > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads