Searching \ for ' [PIC] call, main, goto, locations!' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'call, main, goto, locations!'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] [PIC] call, main, goto, locations!'
2002\07\07@192007 by Kevinhoward

picon face
This may seem like a daft question!!!


I have written a routine based on time delays from an input pulse
which uses call, goto, instructions. Should the main routine be located
before or after the "called" subroutines?

Does it matter if the "goto" subroutine is before or after the main routine?

For example;

      btfsc     portb,1
      goto     pulse1
      call       action1       ;should action1 be listed before or after

      btfsc     portb,2
      goto     pulse2
      goto     light2           ;should light2 be listed before or after

      btfsc     portb,3
      goto     pulse3
      call       delay1        ;should delay1 be listed before or after

      goto     main


Thanks for your help in advance--Analogue electronics for 28 years but a pic
newbie!!!!! learning fast but can't seem to find some basic rules!!!

-- hint: The list server can filter out subtopics
(like ads or off topics) for you. See

2002\07\07@231423 by Richard Mellina

picon face
When you 'call', the location in the program is stored ("pushed") into the
'stack'. At the end of the subroutine is placed the 'return' instruction
which retrieves ("pops") the program location on top of the stack and goes
to it. When you use 'goto' the processor simply jumps to that location in
the program and runs from there. I hope this helped solve your problem. Good

{Original Message removed}

2002\07\09@183440 by Kevinhoward

picon face
rsill -

Thanks for your help--- and moreover taking the time to reply to a newbie to

You supplied me in 6 lines with what I had missed in the numerous pic
"learning " books I have purchased.

Thanks again


-- Going offline? Don't AutoReply us!
email with SET PICList DIGEST in the body

More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...