Shop OBEX P1 Docs P2 Docs Learn Events
flexspin compiler for P2: Assembly, Spin, BASIC, and C in one compiler - Page 17 — Parallax Forums

flexspin compiler for P2: Assembly, Spin, BASIC, and C in one compiler

11415171920123

Comments

  • potatohead wrote: »
    Eric, I've not had time to do much with it, but what I did do worked nicely. I really want you to know your efforts are appreciated. I'm in for $5 a month right now. That can change too. [I just had a free moment and did the default signup. You gotta tell us what makes sense. (somehow, lol)

    Thank you, I really appreciate it! Every little bit helps. If 10 of us chip in $5/year then even after taxes and fees there should be enough for an "EV" signing cert that gets rid of the warnings completely. If not, maybe we can get one of the cheaper certificates. And if there's not enough for that, well, maybe I can buy some Parallax toys and/or a few coffees to fuel late night programming sessions :).
    How does the signing process work? Can one get a cert useful for signing multiple executables, or is it per executable, or what? I'm thinking maybe get the multiple signing cert, and maybe a few handy things can get signed... Just a random thought.

    My understanding is that the cert is good for any number of signings during its period of validity (typically 1 year, although for more money you can get a 2 or 3 year certificate). So lots of fastspin, spin2gui, and loadp2 releases, and maybe a few other things too...

    Thanks,
    Eric
  • So it stays signed, and we are just buying a signature create window?

    If so, cool. That does not seem all that onerous.

    [Thinks it is just crazy that people buy machines that cannot just run an executable]

  • I'll sign up for $5/mo too, Eric. I've already been affected by windows sandboxing your app, without telling me it was doing so, hopefully the legit certificate fixes that
  • potatoheadpotatohead Posts: 10,261
    edited 2019-08-02 04:17
    Cool. I see it as one cup of coffee I probably do not need. :D Same, but I got a dialog.

    And there are a few apps in development I am working with that all are not signed. Happens a lot.
  • potatohead wrote: »

    [Thinks it is just crazy that people buy machines that cannot just run an executable]
    Yes platform cabals have started. Back in our day we used to be able to just write an executable and be able to run/distribute it without paying an extra fee to some special group, but it's a different world now. I guess in the case of needing these certificates, all the malware guys have sort of created this with the widespread distribution of malicious software so much easier now, and "certification" is meant to hinder that or at least enable some traceability of the software's origin and hopefully also provide some confidence the software hasn't been corrupted. I liked those old days more...
  • potatoheadpotatohead Posts: 10,261
    edited 2019-08-02 04:43
    Me too. Oh well. Looks like it won't be too big of a deal to get our tools setup. Ok fine.

    And can you imagine just typing bytes in, then run? Crazy today it seems...
  • rosco_pcrosco_pc Posts: 465
    edited 2019-08-02 07:23
    ersmith wrote: »
    rosco_pc wrote: »
    https://www.digicert.com/order/order-1.php seems to 74 USD/year. I'm willing to chip in for 1 year, even though I don't use windows for my prop development.

    It's showing me $499 USD/year for the code signing certificate on that site. I'm not surprised that the price is different -- I suspect they show different prices to different people and in different places -- but the size of the difference is a little surprising.
    Certum has an opensource license, but it is very unclear what the actual cost is

    That's worth looking into, thanks.

    Followed the link from here to get the cheaper option:
    https://docs.microsoft.com/en-us/windows-hardware/drivers/dashboard/get-a-code-signing-certificate

    Not sure if that applies to normal programs as I see now it's drivers?

    Edit: in the mean time I'll sign up for another $5/month today
  • potatohead wrote: »
    [Thinks it is just crazy that people buy machines that cannot just run an executable]
    It is indeed. I myself have taken to avoid such crippled hardware.

    On the topic of signing certificates, I once had the problem of Windows 10 users having trouble running my EXEs (Warning message which to override you had to click on "more information" or whatever, which looked like a hyperlink, really non-obvious). As usual, it was just a hobby thing, so instead of paying the ridiculous extortion fee for a certificate, I just got hold of registry tweak file that disables the SmartScreen nonsense and told people to apply that first, heh.

  • I'm fairly certain that Parallax has the ability to create signed certificates for Win & macOS (I remember setting up the macOS certificate for SimpleIDE with Jeff Martin, at some point in history)...

    dgately
  • I am not really sure about this certificate stuff. Windows is not Sandboxing the current exe, it just asks you to allow it once.

    On the other hand I am just hacking around with Spin2Gui to integrate TAQOZ into the mix and am stuck now with the uncertificated version, I guess.

    Because If that certification does pretend hackers to change the existing code, It will prevent me from changing Spin2Gui. I have not tried it yet, but If I am able to change gui.tcl on a certified exe then the certification is not worth a dime.

    And if I am NOT able to do so, then Eric needs to provide two versions or I need to send every change to Eric to test it.

    Mike
  • msrobots,
    It's open source, you can always clone it, make changes, and build yourself. So no need for separate versions.
  • Roy Eltham wrote: »
    msrobots,
    It's open source, you can always clone it, make changes, and build yourself. So no need for separate versions.

    You are right, but currently I just patch my version and add some buttons to gui.tcl… lame excuse I know

    Mike
  • jef_vtjef_vt Posts: 23
    edited 2019-08-04 10:10
    I think I found a bug in the fastspin compiler, or I am doing something wrong.
    I am converting a big project from P1 to P2 with more than 5000 lines of code. So the less I need to change the happier I am :)
    And I couldn't get this part working until i saw the lst file.
    byte[@modus1_name][20] := "!"
    
    should do the same as
    byte[@modus1_name+20][0] := "!"
    
    But it isn't.

    byte[@modus1_name][20] := "!" does this (and works like a charm):
    01bd4     01 00 00 FF 
    01bd8     F8 F8 04 F1 | 	add	ptr__dat__, ##760
    01bdc     7C 60 01 F6 | 	mov	local02, ptr__dat__
    01be0     01 00 00 FF 
    01be4     F8 F8 84 F1 | 	sub	ptr__dat__, ##760
    01be8     21 62 05 F6 | 	mov	local03, #33
    01bec     14 60 05 F1 | 	add	local02, #20
    01bf0     B0 62 41 FC | 	wrbyte	local03, local02
    01bf4     14 60 85 F1 | 	sub	local02, #20
    

    while byte[@modus1_name+20][0] := "!" does this (and DOESN'T work):
    01bd4     21 60 05 F6 | 	mov	local02, #33
    01bd8     01 00 00 FF 
    01bdc     0C 61 45 FC | 	wrbyte	local02, ##780
    

    there is an offset missing. the ptr__dat__ is not included when there is a calculation.
    A bytemove suffers the same problem.
    Is this known and is there a workaround?

    EDIT: I downloaded the lates version currently available, changed optimisations and tried with ( ) without luck. Whenever there is a calculation in the first part, it skips to add the offset.
    for compilation I use the following:
    .\fastspin.exe -2 -l -O0 --code=hub ..\samples\LCD.spin2
    

    EDIT2: I found a work-a-round. This WORKS:
    temp_calc := @modus1_name
    byte[temp_calc+20][0] := "!"
    
    But I still count this as a bug that needs a fix.
  • msrobots wrote: »
    I am not really sure about this certificate stuff. Windows is not Sandboxing the current exe, it just asks you to allow it once.

    On the other hand I am just hacking around with Spin2Gui to integrate TAQOZ into the mix and am stuck now with the uncertificated version, I guess.

    Because If that certification does pretend hackers to change the existing code, It will prevent me from changing Spin2Gui. I have not tried it yet, but If I am able to change gui.tcl on a certified exe then the certification is not worth a dime.
    The signature only applies to the binary (spin2gui.exe), which in this case is the Tcl interpreter. The actual Tcl scripts themselves are not signed. So yes, there's still a pretty big security hole in one sense. On the other hand the Tcl scripts are in plain text so bad things in them are relatively easy to spot.

    I think the main purpose of this signature thing is to protect against viruses that spread by inserting themselves into binaries. (Well, that and probably earning money for Microsoft...)
  • jef_vt wrote: »
    I think I found a bug in the fastspin compiler, or I am doing something wrong.
    I am converting a big project from P1 to P2 with more than 5000 lines of code. So the less I need to change the happier I am :)
    And I couldn't get this part working until i saw the lst file.
    byte[@modus1_name][20] := "!"
    
    should do the same as
    byte[@modus1_name+20][0] := "!"
    
    But it isn't.

    Yes, it certainly should produce the same thing. There's a bug in the handling of @ when applied to DAT section labels from inside a Spin function. Thanks for finding this and posting the bug report!

    Are you able to build fastspin from source? I checked a fix in to my github repository. I'm away from my P2 at the moment so I can't verify everything, but at least the two code snippets you posted above produce the same output now.

    Cheers,
    Eric
  • rosco_pc wrote: »
    Followed the link from here to get the cheaper option:
    https://docs.microsoft.com/en-us/windows-hardware/drivers/dashboard/get-a-code-signing-certificate

    Not sure if that applies to normal programs as I see now it's drivers?

    Edit: in the mean time I'll sign up for another $5/month today

    Thanks! And thanks for finding that link -- it's dramatically cheaper. I also wonder if it's driver only. I've sent in an application and we'll see what happens...
  • ersmith wrote: »
    jef_vt wrote: »
    byte[@modus1_name][20] := "!"
    
    should do the same as
    byte[@modus1_name+20][0] := "!"
    
    But it isn't.

    Yes, it certainly should produce the same thing. There's a bug in the handling of @ when applied to DAT section labels from inside a Spin function. Thanks for finding this and posting the bug report!

    Are you able to build fastspin from source? I checked a fix in to my github repository. I'm away from my P2 at the moment so I can't verify everything, but at least the two code snippets you posted above produce the same output now.

    Cheers,
    Eric
    I am sorry. I tried, but I couldn't get it build from source.
    I have no idea what I did wrong. It also is a bit out of my comfort zone. I can program a µC, but a PC is a black box for me.
    Can you build it? Thank you in advance!
  • ersmithersmith Posts: 6,068
    edited 2019-08-06 23:32
    Here's a zip file containing the lastest fastspin for Windows. It's a beta version and hasn't been through the whole test suite, so I'm not sure if everything works (it should, but caveat emptor).

    [ reported not working, so file has been deleted ]
  • Cluso99Cluso99 Posts: 18,069
    Eric,
    I downloaded spingui today. Ran code thru it and compiled but not loaded.
    It looks great !
    Thanks so much for your work :)
  • Cluso99 wrote: »
    Eric,
    I downloaded spingui today. Ran code thru it and compiled but not loaded.
    It looks great !
    Thanks so much for your work :)

    You have to select if you want to build for P1 or P2

    Menu Commands
    last one Configure Commands
    Then select Defaults: P1 Defaults or P2 Defaults and save.

    Works for me and you can use it for P1 or P2. Well mostly. Pasm does not convert easy.

    Mike
  • Cluso99Cluso99 Posts: 18,069
    Thanks for the info, although I know I was compiling for P2 since it rejected a missed movs and accepted sets. Also the :label for P1 and .label for P2. These make P1 and P2 non-interchangeable.
    I presume the output will be correct then for P1 or P2 but I’ll check the listing to be sure.
  • ersmith wrote: »
    Here's a zip file containing the lastest fastspin for Windows. It's a beta version and hasn't been through the whole test suite, so I'm not sure if everything works (it should, but caveat emptor).

    sorry, I got nothing from this exe. When I run this, I don't have any feedback in the console.
    The file is also a lot smaller (2MB vs 1.4MB).
  • jef_vt wrote: »
    ersmith wrote: »
    Here's a zip file containing the lastest fastspin for Windows. It's a beta version and hasn't been through the whole test suite, so I'm not sure if everything works (it should, but caveat emptor).

    sorry, I got nothing from this exe. When I run this, I don't have any feedback in the console.
    The file is also a lot smaller (2MB vs 1.4MB).

    Argh; sorry, it's hard for me to test remotely. Could you try the one attached to this message instead?
  • ersmith wrote: »
    jef_vt wrote: »
    ersmith wrote: »
    Here's a zip file containing the lastest fastspin for Windows. It's a beta version and hasn't been through the whole test suite, so I'm not sure if everything works (it should, but caveat emptor).

    sorry, I got nothing from this exe. When I run this, I don't have any feedback in the console.
    The file is also a lot smaller (2MB vs 1.4MB).

    Argh; sorry, it's hard for me to test remotely. Could you try the one attached to this message instead?

    It is working like a charm!
    I haven't testen all the features of the compiler, but this bug is history.
    Thank you so much!
  • Eric: How does fastspin find its include files? I created a ~/fastspin directory as described in the Linux section of your README.md file and copied the binaries and the include files there in the appropriate subdirectories but fastspin doesn't seem to be able to find its header files when I try to compile ebasic3. Has something changed? I have ~/fastspin/bin in my PATH.
    Davids-Mac-mini:ebasic3 dbetz$ make
    fastspin -o ebasic -2 -D PROPELLER -D LINE_EDIT -D vsprintf=__simple_vsprintf ebasic.c db_compiler.c db_edit.c db_expr.c db_generate.c db_image.c db_scan.c db_statement.c db_symbols.c db_system.c db_vmdebug.c db_vmint.c editbuf.c  osint_prop2.c simple_vsnprintf.c fastspin_stuff.c
    Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2019 Total Spectrum Software Inc.
    Version 3.9.29-beta-2c52443 Compiled on: Aug  7 2019
    ebasic.c
    error: Preprocessor errors:
    /Users/dbetz/work/ebasic3/ebasic.c:1: error: Can't open include file "stdio.h"
        #include <stdio.h>
    /Users/dbetz/work/ebasic3/db_compiler.h:10: error: Can't open include file "stdio.h"
        #include <stdio.h>
        from /Users/dbetz/work/ebasic3/ebasic.c: 2:    #include "db_compiler.h"
    /Users/dbetz/work/ebasic3/db_compiler.h:11: error: Can't open include file "setjmp.h"
        #include <setjmp.h>
        from /Users/dbetz/work/ebasic3/ebasic.c: 2:    #include "db_compiler.h"
    /Users/dbetz/work/ebasic3/db_types.h:93: error: Can't open include file "string.h"
        #include <string.h>
        from /Users/dbetz/work/ebasic3/db_compiler.h: 12:    #include "db_types.h"
        from /Users/dbetz/work/ebasic3/ebasic.c: 2:    #include "db_compiler.h"
    /Users/dbetz/work/ebasic3/db_types.h:94: error: Can't open include file "stdint.h"
        #include <stdint.h>
        from /Users/dbetz/work/ebasic3/db_compiler.h: 12:    #include "db_types.h"
        from /Users/dbetz/work/ebasic3/ebasic.c: 2:    #include "db_compiler.h"
    /Users/dbetz/work/ebasic3/db_image.h:10: error: Can't open include file "stdarg.h"
        #include <stdarg.h>
        from /Users/dbetz/work/ebasic3/db_compiler.h: 13:    #include "db_image.h"
        from /Users/dbetz/work/ebasic3/ebasic.c: 2:    #include "db_compiler.h"
    /Users/dbetz/work/ebasic3/db_system.h:10: error: Can't open include file "stdarg.h"
        #include <stdarg.h>
        from /Users/dbetz/work/ebasic3/db_image.h: 11:    #include "db_system.h"
        from /Users/dbetz/work/ebasic3/db_compiler.h: 13:    #include "db_image.h"
        from /Users/dbetz/work/ebasic3/ebasic.c: 2:    #include "db_compiler.h"
    /Users/dbetz/work/ebasic3/db_system.h:11: error: Can't open include file "setjmp.h"
        #include <setjmp.h>
        from /Users/dbetz/work/ebasic3/db_image.h: 11:    #include "db_system.h"
        from /Users/dbetz/work/ebasic3/db_compiler.h: 13:    #include "db_image.h"
        from /Users/dbetz/work/ebasic3/ebasic.c: 2:    #include "db_compiler.h"
    8 errors in preprocessor.
    
  • David BetzDavid Betz Posts: 14,516
    edited 2019-08-08 01:36
    Okay, I see. There are no stdio.h, etc files in the include directory. Where do I find the .h files that go with fastspin C?

    Edit: I now see I have a proplib directory that I got from your GitHub account as well. Can you please remind me how to put together a working fastspin C environment? I know I had ebasic3 working with fastspin at one point and I'd like to get it working again.
  • David Betz wrote: »
    Eric: How does fastspin find its include files?
    fastspin looks for its include files by default in $BINARY_DIRECTORY/../include, where $BINARY_DIRECTORY is the directory which contains the executable program.

    You can override this by setting an environment variable called FASTSPIN_INCLUDE_PATH.

    You mentioned in the next message that your include directory is empty, which doesn't sound right at all. If you look in the original github repository there's an include directory which includes the standard .h files like stdio.h. Those are what you want to have in $BINARY_DIRECTORY/../include. Are you sure you've checked everything out and are up to date from github? Also, are you sure you're running the fastspin you just installed (that there's no other fastspin on your path)? If all else fails try explicitly running $GIT_REPO/build/fastspin, where $GIT_REPO is the location where you've checked out fastspin.

    (Incidentally, the fastspin library does have vsprintf now, so you shouldn't have to provide that for ebasic any more).

    Eric
  • ersmith wrote: »
    David Betz wrote: »
    Eric: How does fastspin find its include files?
    fastspin looks for its include files by default in $BINARY_DIRECTORY/../include, where $BINARY_DIRECTORY is the directory which contains the executable program.

    You can override this by setting an environment variable called FASTSPIN_INCLUDE_PATH.

    You mentioned in the next message that your include directory is empty, which doesn't sound right at all. If you look in the original github repository there's an include directory which includes the standard .h files like stdio.h. Those are what you want to have in $BINARY_DIRECTORY/../include. Are you sure you've checked everything out and are up to date from github? Also, are you sure you're running the fastspin you just installed (that there's no other fastspin on your path)? If all else fails try explicitly running $GIT_REPO/build/fastspin, where $GIT_REPO is the location where you've checked out fastspin.

    (Incidentally, the fastspin library does have vsprintf now, so you shouldn't have to provide that for ebasic any more).

    Eric
    Hmmm... I'm not sure what happened. I'll try updating spin2cpp again tonight when I get home. I did it from my laptop that I have at work and you're certainly correct that the header files are in the include directory. I'm not sure what happened when I moved them to $HOME/fastspin/include. Sorry for the false alarm and thanks for your response.

  • I fixed the problem with the include directory but now I get this when building ebasic3.
    gcptrs.spin
    error: Symbol getcnt is of a type not handled by PASM output yet
    make: *** [ebasic] Error 1
    
  • evanhevanh Posts: 16,032
    It was changed to GETCT.
Sign In or Register to comment.