P2 Links for where to obtain Tools & Sample/Test Code (reference only)

2»

Comments

  • cgraceycgracey Posts: 12,613
    edited 2020-01-03 - 23:47:38
    I made a change to PNut.exe for Tubular to enable compiling and downloading from the command line:

    https://drive.google.com/file/d/1W3sVAx9TeI9mCRsaywBB7_SIYmX8zYpU/view?usp=sharing

    To just compile your PASM code:
    PNut_v33p yourpasmfile.spin2 -p
    

    To also download your PASM code:
    PNut_v33p yourpasmfile.spin2 -p -r
    

    To compile from a batch file, make a batch file like this:
    start "PNut Compiler" /wait PNut_v33p.exe yourpasmfile.spin2 -p
    echo %errorlevel%
    

    It will report 0 for no compiler error or 1 for compiler error.

    You can add -r to also download and run. Download won't happen unless compilation was successful.
  • Thanks chip!
  • Publison wrote: »
    I had problems trying to read the Google Docs Instruction Set even when printing off on 24"x36" pages.
    I have taken the XLS files to a more readable letter size for my desk reference.

    Good idea. And here's my version. I think the bit encoding is not so important except for compiler developers. For me as beginner the verbose description is more helpful.

  • Peter JakackiPeter Jakacki Posts: 8,980
    edited 2020-01-09 - 16:06:32
    I just group the columns after the description and then collapse that to hide it. If I print the result out then there are 8 pages.
    Here's a screenshot.
  • cgracey wrote: »
    I made a change to PNut.exe for Tubular to enable compiling and downloading from the command line:

    https://drive.google.com/file/d/1W3sVAx9TeI9mCRsaywBB7_SIYmX8zYpU/view?usp=sharing

    To just compile your PASM code:
    PNut_v33p yourpasmfile.spin2 -p
    

    To also download your PASM code:
    PNut_v33p yourpasmfile.spin2 -p -r
    

    To compile from a batch file, make a batch file like this:
    start "PNut Compiler" /wait PNut_v33p.exe yourpasmfile.spin2 -p
    echo %errorlevel%
    

    It will report 0 for no compiler error or 1 for compiler error.

    You can add -r to also download and run. Download won't happen unless compilation was successful.

    Chip: Is it possible to change the errorlevel value to the offending line # in the code -- that would make bug hunting with external editors a bit easier.
  • Good idea but just be careful, %errorlevel% used to have a max value of 255. It may go higher now, or not.
  • It could be done. Any way of knowing if errorlevel goes over 255 these days?
  • I think Win NT allows arbitrary 32 bit integers.
    However, I think one'd probably want the file name the error is in, too.
  • JonnyMacJonnyMac Posts: 6,576
    edited 2020-03-01 - 02:42:10
    However, I think one'd probably want the file name the error is in, too.
    Agreed, but PNut is Chip's workspace, and never really intended for big public use -- so I will take little changes if I can get them. Since many projects are multi-file, your suggestion makes sense. Would also love to have Ctrl-Z working for those, "I didn't mean to do that!" pastes. :)
  • Can't you just print out the line number of the error to standard output and have the IDE capture that, instead of abusing errorlevel?
  • If there is an error during compilation, the offending file will be open and the cursor will be put where the error is.
  • I would be very helpful in PNut could output text including error messages when run from command line.

    Especially, if could be in format similar to FastSpin, OpenSpin, etc...

    Or, maybe we need OpenSpin2...
  • Here's the details of revC's only change over revB - https://forums.parallax.com/discussion/comment/1483004/#Comment_1483004

  • David BetzDavid Betz Posts: 13,718
    edited 2020-03-27 - 15:22:36
    (deleted for being off topic)
Sign In or Register to comment.