Stack Under flow


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    look if there's a part of your code ended with a return but uncalled by a Gosub

    well this is the only thing that make sense to me.

    Will be easier to say if you post your code Here.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default GOTO and GOSUB

    .................................................. .........................
    Last edited by sinoteq; - 14th September 2005 at 01:52.

  3. #3
    Join Date
    Sep 2005
    Location
    Hernando,Florida USA
    Posts
    8


    Did you find this post helpful? Yes | No

    Default goto and gosub

    HI Sinoteq
    There is one gosub and one return. so I would think the return
    would go back to GETKEY. Yes
    Or did I not understand your comment.

    Thanks
    Wayne

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Code:
    start:
    '
    '
    '
    
    LED1=0 '
    
    main:
    GoSub getkey
    
    getkey:
    kp1=0 'Clear kp1
    after Main, should have a goto start or something like that

    But i didn't get any error within MicroCode Studio using MPASM but get error with PM about WDTCON and LCDCON... in the PM M16F91X.inc file it miss those two lines
    Code:
    WDTCON		    equ     105h
    LCDCON		    equ     107h
    but shouldn't be the cause IMO
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Sep 2005
    Location
    Hernando,Florida USA
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Mplab Sim

    Hi Steve
    You only get the error if you use the MPLAB SIM tool or program the PIC
    and install it in the board.


    Thanks
    Wayne

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    So to be clear does
    Code:
    main:
    GoSub getkey
    Goto Start     ' <=== Add this line
    
    getkey:
    kp1=0 'Clear kp1
    fix the problem... i guess yes !?!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Sep 2005
    Location
    Hernando,Florida USA
    Posts
    8


    Did you find this post helpful? Yes | No

    Talking stack under flow

    Hi Steve (MR. E)

    Yes that did work and thank you very much for the help.
    But one more thing WHY and what is a stack underflow?

    Again Thanks

    Wayne

Similar Threads

  1. Hall Effect flow meter with 16F876
    By revelator in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th March 2010, 20:42
  2. Software Stack
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th December 2007, 10:04
  3. Stack over flow with IF THEN RETURN ENDIF???
    By kdoske in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th December 2007, 17:20
  4. hot water flow sensor
    By jessey in forum Off Topic
    Replies: 16
    Last Post: - 24th January 2007, 04:05
  5. 48 level Software Stack
    By Darrel Taylor in forum Code Examples
    Replies: 0
    Last Post: - 30th November 2003, 01:07

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