Update on procedures in the Proton BASIC Compiler


+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,427
    Thumbs Up
    Received: 296
    Given: 142
    Total Downloaded
    1.75 GB

    3 Not allowed!

    Default Update on procedures in the Proton BASIC Compiler

    Just an update on the procedure mechanism that I'm creating for the standard 8-bit Proton compiler....

    Things are going well.... I've just finished updating the expression parser and procedures are now accepted within expressions:

    Code:
    Device = 16F1937
    Declare Xtal = 32
    
    Dim Global_MyFloat as Float
    
    Proc RadToDeg(pRadians as Float), Float
    
    Symbol c180DivPi = 180.0 / 3.14    
         Result = pRadians * c180DivPi 
    EndProc
    
    Global_MyFloat = RadToDeg(120) / 2.0
    Notice the local Symbol within the procedure. This will not be recognised anywhere else in the program, only within the procedure, but if there is a symbol outside the procedure, the contents will use that, so the code within a procedure can access global types as well. If the same name symbol or variable is used inside and outside (globally) the procedure, the code inside it will use the local symbol or variable, and ignore the global symbol or variable with the same name. i.e. Locals have precedence.

    Also, String and Array returns are finished:

    Code:
    Device = 16F1937
    Declare Xtal = 32
    
    Dim Global_MyString as String * 32
    
    Proc TestProc(), String * 32
        Result = "Hello World"    
    EndProc
    
    Global_MyString = TestProc()
    I'm now busy adding the ByRef and BycRef code to the parameters, so indirect access of variables and flash memory can be done. It's equivalent to sending the parameter as the address of a variable, so the Ptr8, Ptr16, or Ptr32 commands can be used. Or the cPtr8, cPtr16, or cPtr32 commands if sending the address of Flash memory. i.e. Data tables.

    It's been a struggle adding the procedures, and all that comes with them, in the main body of the compiler, without disturbing the compiler as it stands, but it really is starting to look good, and has been a joy to get back into the programming mode! It should be ready in a couple of weeks, so watch out for, future, true libraries for Proton, the same as Proton24 types.
    Last edited by top204; 6th January 2019 at 13: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.

  • #2
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,165
    Thumbs Up
    Received: 96
    Given: 1
    Total Downloaded
    2.75 GB

    0 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    Will these changes be fully reflected in the P24 version of the compiler? e.g. BycRef.
    Hopefully once users have had time to work with procedures in the 8 bit environment they may be more inclined to make the step to 16 bit MPUs.
    JohnB

  • 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
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,427
    Thumbs Up
    Received: 296
    Given: 142
    Total Downloaded
    1.75 GB

    0 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    I truly hope so John, because the PIC24 and dsPIC devices are brilliant! They are fast, easy to use, and inexpensive for what they offer. Hopefully then, I'll create Proton32, but, IMO, the PIC32 devices have also not caught on, so I'm also busy making the moves for ProtonAVR. I have a, "very alpha", version of the compiler working with the AT328P device and it looks good. :-)

    The PIC24 and dsPIC devices can access Flash memory as they do RAM. It's named PSV memory access. This means the BycRef directive is not required, but I will be adding it to Proton24's syntax, but it will ignore it, and use ByRef instead.

    Even the enhanced 14-bit core devices can access Flash memory as they do RAM, by adding 0x8000 to the address. i.e. Bit-15 set. It means the standard FSR0L\H and FSR1L\H SFRs can be used to read Flash on these devices, and the compiler uses this mechanism as standard because it produces very good and tight code. However, the 18F devices and the standard 14-bit core devices, need the flash memory address so they can use the TBLPTRL\H\U SFRs for 18F, or EE SFRs for standard 14-bit core, and different mnemonics to access Flash memory. Hence the need for the BycRef directive to use the address of flash memory, and not the address or RAM when accessing quoted strings of characters. i.e. "Hello World", because these are stored in flash memory and not sent sequentially as most other compilers do, or the name of a data table. i.e. Cdata or Dim as Code, which are both the same, but Dim as Code is newer and better because the compiler will eventually be changed to use only data tables that are accessed in the program, just as Proton24 does now. So many Dim as Code data tables can be placed in the code listing, but only the ones used will be placed in the final compilation.

    This is the big problem with writing the compiler to suit all 8-bit devices! They are all very different, but it has to be made as transparent as possible to the end user, and hopefully, Proton does this as much as is possible.
    Last edited by top204; 6th January 2019 at 14:33.

  • 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.

  • #4
    Prolific Poster normnet's Avatar
    Join Date
    Jul 2004
    Posts
    2,367
    Thumbs Up
    Received: 78
    Given: 45
    Total Downloaded
    1.39 GB

    0 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    Quote Originally Posted by Les View Post
    ...Hopefully then, I'll create Proton32, but, IMO, the PIC32 devices have also not caught on...
    I confess I am presently trying to make headway with PIC32MZ (MZ includes 200MHz) in MPLABX however its been a beast for even some of the most basic commands. MZ example code for DelayMS for instance isn't easily found. I may well of overlooked however I have not as of yet found one definate PIC32MZ code example. I can now after some time blink an LED. PDS PIC32MZ 200 MHz support would be more than welcome. So far it appears the PIC32 lineup may be a bit easier to solder than some of the others including ARM as PIC32 devices include TQFP pins.

    Norm

  • 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
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,165
    Thumbs Up
    Received: 96
    Given: 1
    Total Downloaded
    2.75 GB

    0 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    @Les
    I wondered if that might be the case after I sent it but it would be good to keep compatibility between compilers if possible.
    JohnB

  • 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.

  • #6
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,232
    Thumbs Up
    Received: 75
    Given: 181
    Total Downloaded
    5.15 GB

    1 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    Surely ProtonAVR is your way forward commecially.
    George.

  • 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
    Senior Member GAMBOA's Avatar
    Join Date
    Nov 2004
    Posts
    422
    Thumbs Up
    Received: 19
    Given: 0
    Total Downloaded
    203.73 MB

    0 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    Les,

    I'm glad Proton is progressing properly. Many of us are anxious to be able to buy the new version.
    As for PIC32. I think that Microchip has lost the battle against the ARM and I think that this line will be abandoned to join the universal current of the whole world with ARM. In fact, he already has some models with an ARM license in addition to the Atmel that are also his now.

    Regards,
    Gamboa

  • 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.

  • #8
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,427
    Thumbs Up
    Received: 296
    Given: 142
    Total Downloaded
    1.75 GB

    0 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    That's my thoughts as well Gamboa. With Microchip buying Atmel, they now have the ARM licensing, and I think they will move down that avenue, and eventually drop the PIC32 devices, or do as they've done with the older PIC microcontroller's, and increase the prices so much, few people buy them.

    I wonder how Microchip are going to deal with the Chinese rip offs of the Atmel devices. i.e. all the ones used in the Chinese Arduino boards that cost a lot less than the chips themselves when bought from Microchip, or anywhere else, even when bought in bulk? They seem to be Chinese fabrications of the devices, so Atmel must have been quite freelance with their architecture specs.
    Last edited by top204; 6th January 2019 at 20:38.

  • 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
    Prolific Poster normnet's Avatar
    Join Date
    Jul 2004
    Posts
    2,367
    Thumbs Up
    Received: 78
    Given: 45
    Total Downloaded
    1.39 GB

    0 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    Going the Microchip ARM route the SAM E70/S70/V70/V71 Family offers up to 300 MHz in as small as a 64 pin LQFP as well as QFP. Impressive specs!

  • 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.

  • #10
    Member Oldhack's Avatar
    Join Date
    Aug 2010
    Posts
    169
    Thumbs Up
    Received: 6
    Given: 0
    Total Downloaded
    1.38 GB

    0 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    Hello
    Proton Just gets better and better,.
    A very large thank you Les for your dedication, my thought is when will the C++ crowd will wake up and see Proton as the best Compiler out there.
    Gary

  • 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
    Fanatical Contributor fanie's Avatar
    Join Date
    Oct 2005
    Posts
    7,964
    Thumbs Up
    Received: 29
    Given: 13
    Total Downloaded
    280.03 MB

    0 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    Thanks Les, same as Gary said above. The whole world is in a terrible shamble, but the good news is it is slowly turning for the better, and so will the processors I suspect.
    The same conditions (politically) caused disruptions some 2000 years ago when the zodiac changed from Aries to Pisces, now it's changing from Pisces to Aquarius - the up side is we now have pics ;-)

    The 5th Dimension Age of Aquarius 1969

    The Age of Aquarius: What it REALLY Means
    Fanie

  • 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.

  • #12
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,354
    Thumbs Up
    Received: 44
    Given: 39
    Total Downloaded
    3.36 GB

    0 Not allowed!

    Default Re: Update on procedures in the Proton BASIC Compiler

    Good work Les. You know how much we all appreciate your fabulous work on the compiler, it just keeps getting better and better. Happy New Year to you and everybody.

    Charlie

  • 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. Procedures in the 8-bit Proton Compiler
      By top204 in forum The Lounge
      Replies: 12
      Last Post: 12th December 2018, 11:23
    2. Proton basic compiler PWM
      By manojsoorya in forum Interrupt Sources
      Replies: 17
      Last Post: 30th October 2015, 22:14
    3. [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
    4. Replies: 1
      Last Post: 22nd February 2011, 21:16
    5. [SOLVED !] Proton+ basic compiler
      By robotman in forum Proton Plus Compiler v3
      Replies: 2
      Last Post: 19th March 2009, 02:03

    Members who have read this thread since 11th November 2019, 22:33 : 1

    Actions :  (Set Date)  (Clear Date)

    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