jumping out of a gosub reminder


Results 1 to 18 of 18

Threaded View

  1. #7
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: jumping out of a gosub reminder

    I had similar ideas, but give up on them. I use something like this:
    Code:
    Gosub xx : If err=1 then goto yy
    
    XX:
    if something to triger going to err sub then
    err=1 ' goto in different sub after retun
    else
    err=0 ' return and continue normally
    endif
    But if you must have gosub, without return, you can look up in datasheet of PIC, POP command. It should pop up stack, and free one space.

    Quote Originally Posted by Datasheet
    The TOS value is pulled off the return
    stack and is discarded. The TOS value
    then becomes the previous value that
    was pushed onto the return stack.
    This instruction is provided to enable
    the user to properly manage the return
    stack to incorporate a software stack
    If I understand POP and PUSH commands, you could do something like this

    If err=1 THEN
    @ POP
    GOTO ErrHandler
    ENDIF
    Last edited by pedja089; - 2nd February 2020 at 22:15.

Similar Threads

  1. programming jumping game
    By bokken in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th February 2012, 06:40
  2. jumping out of subroutine with goto
    By helloo in forum General
    Replies: 4
    Last Post: - 3rd January 2012, 10:37
  3. OWIN not jumping to label
    By MOUNTAIN747 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th March 2011, 15:30
  4. A reminder for all Forum Users
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 40
    Last Post: - 6th December 2008, 18:56
  5. Pot reading jumping like crazy!!!
    By champion in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 20th November 2006, 21:24

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts