WOW Talk about major response ! I thought that I had been spammed today when I opened my mail program ! Thanks to all who has written and used so much precious time. Best Regards Lasse Madsen ----- Original Message ----- From: "Bob Barr" To: Sent: Monday, September 24, 2001 2:32 AM Subject: Re: [PIC]: Please help me before i loose sanity :) > Jinx wrote: > > > >In the code below it looks to me (although it would have > >been clearer commented and better formatted) that when > >the decfsz is true, the PC flow moves into the farve_1 routine > >which is terminated with an uncalled return. Where it will go > >from there is anyone's guess. Start with "movlw 0x32" and > >after the bcf porta,01 **** put "goto end" > > > > It'll take a little more than that. 'end' is a directive that marks the end > of the source file, not the code space. > > You've got to program something to make the processor stop executing code. > > In your example, I would expect the processor to run off the end of the code > space, wrap around, and start executing from location 0 again. > > A 'branch to self' will leave the processor executing branches forever. See > below. > > Regards, Bob > > >movlw 0xFF > >movwf counter > > > >loop: > > > > BCF porta,01 > > CALL pulse > > BSF porta,01 > > CALL farve_1 > > BCF porta,01 > > decfsz counter > > goto loop > > BCF porta,01 **** > > ; stop executing <<<<<< added > goto $ <<<<<< added, loop forever until reset > > >; > >; ===== Subprocedure 1 ===== > >farve_1 clrf mcount > > >>>> > > return > > > > end > > > > > > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- > 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