What a great compiler Proton is.


+ Reply to Thread
Results 1 to 7 of 7

Thread: What a great compiler Proton is.896 days old

  1. #1
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,353
    Thumbs Up
    Received: 83
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default What a great compiler Proton is.

    I wrote this piece of noddy code to understand how Lread works.

    Code:
      Device = 16F690
      Xtal = 8
    
      Declare All_Digital = True
      Declare Reminders = On
      Declare Show_System_Variables = Off
      Declare Create_Coff = On
      Declare Optimiser_Level = 0           ' no optimise on 16F
      Declare Dead_Code_Remove = Off        ' real men don't write dead code
    
      $define VersionHigh 1                 ' application version high
      $define VersionLow 2                  ' application version low
      
      Dim D_DataLen        As Byte                        
      Dim D_Data           As Byte                        
      Dim D_Counter        As Byte                        
    
      For D_Counter = 18 To 0 Step -1 
        D_Data = LRead (_code - D_Counter)
      Next
     
      Org (_code - 18)
      LData $16, $12, $17, $18, $34, $36, $03, (VersionHigh << 4) | (VersionLow), 09, 10, 11, 12, $55, $CC ' 16/12/17 18:34 3.6.0.3 1.2 for testing only
    I couldn't understand why the compiler was adding a tiny bit of code after the LData. Then I realized that the compiler "knew" that after the Next, execution would crash into the LData, so it added a STOP. But not immediately after the Next, just in case I really wanted to execute to LData.

    Hats off to Les.
    George.

  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. #2
    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: What a great compiler Proton is.

    Hi George,
    Indeed the compiler writes a STOP after the last line of code. Sometime it is a pain. Then you have to leave a space for this STOP, otherwise the compiler will give an error.
    For example, until now I could not write with Cdata in the eeprom memory until I understood that it is necessary to return to the memory space of the ROM.
    See this example:
    Code:
        Org $F00000
        CData 0,0,0,0,0,PW_CONTROL
        CData 255,65,65,65,65,65,65,65,65,255
    
        Org _code - 4   ' Come back to the ROM space to avoid a compilation error 
    ' because the compiler write a line (While 1 = 1 : Wend) at the end of basic code.
    It would be very interesting for advanced users to have a new "Declare" to eliminate this function.
    73's de Alberto ea3agv

  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. #3
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,412
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: What a great compiler Proton is.

    George

    I'm sure we all share your view that this is indeed an excellent compiler. Hats off to Les.

    Charlie

  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. #4
    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: What a great compiler Proton is.

    Thanks. That means a lot to me George and Charlie.

    The compiler places underlying Stop command mnemonics at the end of code because a lot of users don't know that without one, a piece of code that is not a loop, will simply run to the end of flash memory, then start again. Which will always cause chaos. I saw this so many times in the past, with users here on the forum asking "why was a program going berserk"? And the simple answer was to place a Stop command at the end of the program :-) So I decided to do it for them automatically quite a lot of years ago!

    If the compiler sees a Stop command anywhere within the program, it will not place the underlying Stop code at the end, because it is assumed the user has placed one to stop problems.
    Last edited by top204; 18th December 2017 at 19:29.

  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. #5
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,353
    Thumbs Up
    Received: 83
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: What a great compiler Proton is.

    @Alberto It is my experience that the compiler only adds the stop if program flow would carry on beyond ROM space.
    George.

  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. #6
    Senior Member Mellbreak's Avatar
    Join Date
    Jun 2012
    Posts
    571
    Thumbs Up
    Received: 36
    Given: 27
    Total Downloaded
    4.63 GB

    0 Not allowed!

    Default Re: What a great compiler Proton is.

    Some of you, I'm sure, will be interested in this posting on Facebook....

    http://www.facebook.com/groups/1044161729029932/


    Unfortunately, you may need a FB to see it.


    Cheers,

    Bob

  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. #7
    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: What a great compiler Proton is.

    Bob,

    There is no need for Facebook. See these links please: -

    Link 1

    Link 2
    Regards

    Joseph

  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.

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. [SOLVED !] Proton PICbasic V3_5_0_6 versus Proton+ Basic Compiler V3.2.5.5
    By Eddy in forum Pre-Sales and Upgrade Questions
    Replies: 6
    Last Post: 23rd October 2011, 11:34
  2. Replies: 1
    Last Post: 22nd February 2011, 20:16
  3. [SOLVED !] Great Plugin's for Proton Users!
    By LittlePIC in forum Proton Plus Compiler v3
    Replies: 16
    Last Post: 24th December 2005, 02:04
  4. Proton+ V3.0 = GREAT!
    By Frizie in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 8th November 2004, 21:57

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