Problem with heap directive - Page 2


+ Reply to Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 34

Thread: Problem with heap directive1020 days old

  1. #16
    Senior Member AlbertoFS's Avatar
    Join Date
    Apr 2005
    Posts
    689
    Thumbs Up
    Received: 92
    Given: 2
    Total Downloaded
    4.62 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    Hi Les,
    I have just uploaded my code in the Files system.
    I wrote some Set_Bank / Reset_Bank to solve the problem.
    I want to prepare another code for testing.
    Regards
    Alberto

    PS: This a single bas file to isolate the problem.
    I change the DummyArray value to move all variables through the Banks.
    Thank you les.
    Regards
    TestCode.zip
    Last edited by AlbertoFS; 15th August 2017 at 20:53.
    73's de Alberto ea3agv

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #17
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,592
    Thumbs Up
    Received: 339
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    Many thanks Alberto. I'll check it out.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #18
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,592
    Thumbs Up
    Received: 339
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    Alberto.... There's a file missing from your code, so I can't compile it. "Include "D:\MyIncFiles\SYS_18FXXK20.inc"

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #19
    Senior Member AlbertoFS's Avatar
    Join Date
    Apr 2005
    Posts
    689
    Thumbs Up
    Received: 92
    Given: 2
    Total Downloaded
    4.62 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    Sorry Les,
    I updated the project in files server.
    Regards
    Alberto
    73's de Alberto ea3agv

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #20
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,592
    Thumbs Up
    Received: 339
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    That's OK Alberto. I'm sure I've corrected the Heap directive, so I'll upload an App.exe patch.

    I've created several programs that have a huge amount of differing variables and types, and they all seem to work as expected, but a third party, who understands the language as much as you do, looking as well is always better.

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #21
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,592
    Thumbs Up
    Received: 339
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    Please..... This thread is moving off the subject of its heading, which makes things confusing.

    Any other possible anomalies must be placed in a separate thread with a code snippet that shows an issue. This thread is concerning the Heap directive only.

    I've uploaded a patch for version 3.6.0.2 that should correct the Heap directive anomaly. It also corrects the Float = -Float anomaly (but only if RAM banks are concerned, otherwise it works as expected). The Float = -Float code has been in the compiler since day one of Floats being added, and it has nothing to do with Heap or At etc, so please... A new thread.

    See the files section for the update patch:

    Proton Version 3.6.0.2 Beta patch

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #22
    Senior Member AlbertoFS's Avatar
    Join Date
    Apr 2005
    Posts
    689
    Thumbs Up
    Received: 92
    Given: 2
    Total Downloaded
    4.62 GB

    1 Not allowed!

    Default Re: Problem with heap directive

    I tested the Heap Directive with short and large code. For my part the Heap Directive issue is corrected.
    Les, I really appreciate the new comment heading of the different groups of variables in the asm file.
    Many thanks again for this fantastic support and for this great compiler.
    Regards
    Alberto
    Last edited by AlbertoFS; 17th August 2017 at 09:43.
    73's de Alberto ea3agv

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #23
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,592
    Thumbs Up
    Received: 339
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    You miss nothing Alberto, and keep it up. They are useful aren't they? They show the various variable types in the asm file, which is useful for more advanced users who appreciate the asm produced by the compiler. It's not important to understand the asm because the compiler produces the best it can, but it is useful to get the maximum out of a small device when the asm can be read clearly, which has always been one of my goals with the compiler.

    I'll create a full installer later this afternoon and upload it to the forum.

  16. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #24
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    Les,

    There is still some problems. Same file compiled with 3.5.9.9 works as expected but compiled with 3.6.0.2 it does not run. I did some tests and I am able to give you some information.

    I attached a file with two different compiles. Ver 1.5 was compiled with 3.5.9.9 while Ver 1.6 compiled with 3.6.0.2.

    The code freeze at lines 468 to 472. If I comment out these lines the code keeps going. To be able to do the test I had to uncomment lines 475 to 477, as these where only added to debug the code.

    The problem seems to be when there is this type of code: -

    Code:
    Rx_Buff[11] = Rx_Buff[11] - 48              ' Convert Latitude tens degree to integer
    Rx_Buff[12] = Rx_Buff[12] - 48              ' Convert Latitude units degree to integer
    Rx_Buff[38] = Rx_Buff[38] - 48              ' Convert Fix type to integer 
    
    Fix_Type = Rx_Buff[38]                      ' Load Fix_Type with Rx_Buff[38] value
    Files.zip
    Regards

    Joseph

  18. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  19. #25
    Senior Member AlbertoFS's Avatar
    Join Date
    Apr 2005
    Posts
    689
    Thumbs Up
    Received: 92
    Given: 2
    Total Downloaded
    4.62 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    Hi Josep,
    I tried your code using the same variables at the same addresses RAM with a simulation code with Proteus.
    And I have been able to recreate the same asm code compiled with V3.6.0.2. I do not find any issue here.
    Only the possibility remains that the values in the string are not all ASCII or the problem comes from before?

    Could you try to print the ASCCI value of the string:
    Code:
        HRSOut "Buffer ASCII: ", Rx_Buff#11, " ", Rx_Buff#12, " ",Rx_Buff#38, 13,10             
    
        Rx_Buff[11] = Rx_Buff[11] - 48              ' Convert Latitude tens degree to integer
        Rx_Buff[12] = Rx_Buff[12] - 48              ' Convert Latitude units degree to integer
        Rx_Buff[38] = Rx_Buff[38] - 48              ' Convert Fix type to integer 
    
        Fix_Type = Rx_Buff[38]                      ' Load Fix_Type with Rx_Buff[38] value
        Lat_Deg = (RX_BUFF#11 * 10) + RX_BUFF#12    ' Work out array 11 and 12 for Lat_Deg
    
        HRSOut "Buffer Dec: ", Dec Rx_Buff#11, " ", Dec Rx_Buff#12, " ", Dec Rx_Buff#38, 13,10
        HRSOut "Fix_Type: ", Dec Fix_Type, 13,10
        HRSOut "Lat_Deg: ", Dec Lat_Deg, 13,10
    Regards
    Alberto
    73's de Alberto ea3agv

  20. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  21. #26
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    If you look at line 463 to line 477 I have a loop to show all ASCII characters and all characters are displayed correctly.

    Code:
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For bTemp = 1 To bLoop
        Select bTemp
            Case 1 To 20
            Print At 1,bTemp, Rx_Buff[bTemp - 1] , "  "
       
            Case 21 To 40
            Print At 2,bTemp - 20 , Rx_Buff[bTemp - 1] , "  "
    
            Case 41 To 60
            Print At 3,bTemp - 40 , Rx_Buff[bTemp - 1] , "  "
        
            Case 61 To 80
            Print At 4,bTemp - 60 , Rx_Buff[bTemp - 1] , "  "
        EndSelect
    Next
    This bit of code is just a few lines up of: -

    Code:
    Rx_Buff[11] = Rx_Buff[11] - 48              ' Convert Latitude tens degree to integer
    Rx_Buff[12] = Rx_Buff[12] - 48              ' Convert Latitude units degree to integer
    Rx_Buff[38] = Rx_Buff[38] - 48              ' Convert Fix type to integer 
    
    Fix_Type = Rx_Buff[38]                      ' Load Fix_Type with Rx_Buff[38] value
    However, it still remains that compiling with 3.5.9.9 there are no issues. In fact, this morning I went back and fort from 3.5.9.9 to 3.6.0.2 just to check that there is a problem, which in any case it seems to me that there is one.
    Regards

    Joseph

  22. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  23. #27
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,592
    Thumbs Up
    Received: 339
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    Looking at the asm code for the versions 1.5 and 1.6 files you posted, they are nearly 100% identical, except for where I have adjusted the optimiser to be a bit more stable. But even those mnemonics are OK. All the RAM is identical, and the library routines etc. There is nothing that I can see that would stop one working and the other to work.

    I did notice that you say "If you look at line 463 to line 477", but the programs in the files.zip, have these lines of code at 436 to 450. Are you sure you are looking at the correct code Joseph? I know this sounds a little strange, but we all do strange things every now and then, and not notice that we are doing them. LOL

  24. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  25. #28
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    You are correct Les. Lines should read 436 to 450. As I copied these files and then I continued working on V1.6 and in confusion I checked where these lines are in the wrong file.

    However. As I said, the files I posted, Ver 1.5 and Ver 1.6 are identical, but 1.5 folder was compiled with 3.5.9.9 and works ok, and 1.6 was compiled with 3.6.0.2 and it stops working at: -

    Code:
    Rx_Buff[11] = Rx_Buff[11] - 48              ' Convert Latitude tens degree to integer
    Rx_Buff[12] = Rx_Buff[12] - 48              ' Convert Latitude units degree to integer
    Rx_Buff[38] = Rx_Buff[38] - 48              ' Convert Fix type to integer 
    
    Fix_Type = Rx_Buff[38]                      ' Load Fix_Type with Rx_Buff[38] value
    If I do a `Return' just before this it continue to work.

    You have mentioned something about the optimiser. So I will do another test with optimiser = 0 and try again.
    Regards

    Joseph

  26. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  27. #29
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,592
    Thumbs Up
    Received: 339
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    Joseph.... I've looked and looked and looked, and I can't find anything wrong with the underlying asm code. RAM banks are being set correctly, and the next loop is also correct. The above code produces the asm:

    Code:
    F1_000450 equ $ ; IN [HANDHELD V1.6.BAS] NEXT
        incf bTemp,F,1
        btfss  STATUS ,0,0
        bra _FRLB__74
    _NXLB__75
    GNGGA_PROCESS
    F1_000463 equ $ ; IN [HANDHELD V1.6.BAS] SIV = RX_BUFF#40 + RX_BUFF#41 + 0
        lfsr 0,SiV
        movff Rx_Buff#40, POSTINC0
        movff Rx_Buff#41, POSTINC0
        clrf POSTINC0,0
    F1_000468 equ $ ; IN [HANDHELD V1.6.BAS] RX_BUFF[11] = RX_BUFF[11] - 48
        movf Rx_Buff#11,W,1
        movwf PBP#VAR1,0
        movlw 48
        subwf PBP#VAR1,W,0
        movwf PBP#VAR0,0
        movff PBP#VAR0,Rx_Buff#11
    F1_000469 equ $ ; IN [HANDHELD V1.6.BAS] RX_BUFF[12] = RX_BUFF[12] - 48
        movf Rx_Buff#12,W,1
        movwf PBP#VAR1,0
        movlw 48
        subwf PBP#VAR1,W,0
        movwf PBP#VAR0,0
        movff PBP#VAR0,Rx_Buff#12
    F1_000470 equ $ ; IN [HANDHELD V1.6.BAS] RX_BUFF[38] = RX_BUFF[38] - 48
        movf Rx_Buff#38,W,1
        movwf PBP#VAR1,0
        movlw 48
        subwf PBP#VAR1,W,0
        movwf PBP#VAR0,0
        movff PBP#VAR0,Rx_Buff#38
    F1_000472 equ $ ; IN [HANDHELD V1.6.BAS] FIX_TYPE = RX_BUFF[38]
        movf Rx_Buff#38,W,1
        movlb 1
        movwf Fix_Type,1
    F1_000473 equ $ ; IN [HANDHELD V1.6.BAS] LAT_DEG = (RX_BUFF#11 * 10) + RX_BUFF#12
        movlb 0
        movf Rx_Buff#11,W,1
        mullw 10
        movff  PRODL ,PP7
        movff  PRODH ,PP7H
        movf Rx_Buff#12,W,1
        addwf PP7,W,0
        movlb 1
        movwf Lat_Deg,1
    Which is correct.... The Rx_Buff array elements used in the expressions are in RAM bank 0, then when it comes to variable Fix_Type, the RAM bank is set correctly to 1, because Fix_Type is in RAM bank 1.
    Then it moves back to RAM bank 0 for array element Rx_Buff#11, then back to RAM bank 1 for Lat_Deg. What exactly is happening to your code at this point? Can you add a serial output and see what is happening to the variables at that point please. There's nothing in there to cause any lock up.

    Where exactly are you putting a return that will not interfere with the end of the Next loop? At the moment, the code goes directly from the Next loop to label GNGGA_PROCESS.
    Last edited by top204; 20th August 2017 at 17:35.

  28. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  29. #30
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default Re: Problem with heap directive

    Les,

    I much appreciate looking into this.

    I think that now I found what was causing the code to stop running.

    It was caused by this: -

    Code:
    HRSIn2 Wait("$GNVTG") ' Wait for $GNVTG
    and this: -

    Code:
    HRSIn2 Wait("$GNGSA") ' Wait for $GNGSA
    It is not a matter that the incoming data is not finding `$GNVTG' or `$GNGSA' as the data is coming in correct.

    However, to solve the issue I had to add a wait time. I did a 10 seconds wait time to see if the HRSIN2 waits for 10 seconds, but the buffer was filled in ms.

    Code:
    HRSIn2 {10000 , GNGSA_PROCESS} , Wait("$GNGSA") ' Wait for $GNGSA
    HRSIn2 {10000 , GNGSA_PROCESS} , Wait("$GNVTG") ' Wait for $GNVTG
    Seems that the previous syntax I was using: -

    Code:
    HRSIn2 Wait("$GNVTG") ' Wait for $GNVTG
    is `broken'.

    What I cannot understand is why commenting out the: -

    Code:
    Rx_Buff[11] = Rx_Buff[11] - 48              ' Convert Latitude tens degree to integer
    Rx_Buff[12] = Rx_Buff[12] - 48              ' Convert Latitude units degree to integer
    Rx_Buff[38] = Rx_Buff[38] - 48              ' Convert Fix type to integer 
    
    Fix_Type = Rx_Buff[38]                      ' Load Fix_Type with Rx_Buff[38] value
    made the code running, and that is where I mislead myself and you, and I am deeply sorry for that.
    Last edited by joesaliba; 20th August 2017 at 18:59.
    Regards

    Joseph

  30. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. About Define directive...
    By SELCUK in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 26th May 2018, 02:10
  2. What does Heap mean after dimensioning a variable?
    By towlerg in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 11th February 2013, 09:27
  3. give directive to complier like c
    By SELCUK in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 28th December 2007, 17:49
  4. [SOLVED !] New CONFIG_START Directive
    By Paul Shepard in forum Proton Plus Compiler v3
    Replies: 6
    Last Post: 26th February 2006, 11:01

Tags for this Thread

Posting Permissions

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