Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Tool source code — Parallax Forums

Propeller Tool source code

FredBlaisFredBlais Posts: 370
edited 2014-10-29 00:33 in Propeller 1
Where can I find the Propeller Tool source code?

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-10-26 18:14
    It's not available.

    Parts of the Propeller Tool were written with proprietary tools which Parallax isn't allowed to release. Apparently the Propeller Tool was written before the big push to make things like this open source.

    IIRC, Parallax (Ken) has expressed regret about not having complete control over the source code.
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-10-26 19:12
    You bet we have regrets about not being able to release the entire source code.

    It has one licensed component for the edit control which I chased down for over a year and was unable to get approval from the new corporate owner of the source code, even though it's well over 15 years old.

    Fred, what is it you want to see done with the Propeller Tool?

    Thanks,

    Ken Gracey
  • Heater.Heater. Posts: 21,230
    edited 2014-10-26 19:44
    Luckily we don't need the Propeller Tool source code any more.

    It I understand correctly the original Spin compiler used by the Propeller Tool was written by Chip in x86 assembler. God only knows why (It seems Chip is such an extreme propeller head that he can churn out such code in assembler faster than using a high level language :) ) That code was given to Roy Eltham who created a Spin compiler in C++ from it. The source for that compiler is here: http://code.google.com/p/open-source-spin-compiler/

    Then we have the PropellerIDE, a Propeller Tool in C++ by Jazzed. That code is now in the charge of lamestation and is available here: https://github.com/lamestation/PropellerIDE

    Thanks to all these great efforts we now have Spin compiler and IDEs that run anywhere you can compile them, Linux, Mac, Windows, RaspberryPi even the MIPS processors used in cheap WIFI routers.

    Now, what is it you wanted to do?
  • FredBlaisFredBlais Posts: 370
    edited 2014-10-27 22:37
    Thanks for your explanations. I just thought that everything Propeller has been open sourced. If I recall correctly, the Propeller Tool has been made in Delphi; one of my friends has been doing Delphi programming for 8 years so just by curiosity I wanted to take a peek at the source code with him. I still use the Propeller Tool a lot on my Windows machines... takes less than 1 minute to install and works really great.

    I feel something is wrong with the swarm of different IDE for the Prop, and it is probably confusing for a newcomer : BST, SimpleIDE, PropellerIDE, PZST, msrobots Editor17, blockly prop, programming from ipad, programming from chromebooks...
    On Parallax website, there is little or no mention of the others IDE. Still, you can find the Propeller Tool under the support tab, or on the various Propeller products download page. You really have to know whats happening on these forums to get the full picture.

    Is Parallax going to give more visibility to the PropellerIDE? Will they support it? Are we just waiting for v1.0?
  • pik33pik33 Posts: 2,366
    edited 2014-10-27 23:42
    <b>If</b> the Propeller Tool was written in Delphi it can be ported to Lazarus and then this not free component can be replaced...
  • Heater.Heater. Posts: 21,230
    edited 2014-10-28 02:40
    Interesting idea pik33. The Propeller Tool sources could be released sans the proprietary component.

    Is it of any thing other than of historical interest though, a curiosity for code nerds?

    I would hazard a guess that the missing component would be the editor.

    The actual compiler is written in x86 assembler.

    So as a cross-platform open source code base all we have is an empty shell of a Lazarus application with some menus and buttons on it. No use to man nor beast.

    On the other hand, speaking of code nerds, I have no interest in the Pascal stuff but I'd love to see how Chip wrote the compiler in assembler.

    So how about it Ken? Spill the source!
  • Heater.Heater. Posts: 21,230
    edited 2014-10-28 03:04
    FredBlais,
    I feel something is wrong with the swarm of different IDE for the Prop, and it is probably confusing for a newcomer : BST, SimpleIDE, PropellerIDE, PZST, msrobots Editor17, blockly prop, programming from ipad, programming from chromebooks...
    On Parallax website, there is little or no mention of the others IDE
    What could possibly be wrong with your customers putting in lot's of work to find new and interesting ways of working with your product? Time to worry is when nobody bothers.

    Admittedly some of those efforts, BST, HomeSpun, were spurred on because the Propeller Tool was not open source. That's history now and has been debated to death already.

    I don't know how much confusion there may be. BST is not on the radar much now a days as it is apparently abandoned and unsupported. PZST never was much on the radar. Editor17 is clearly a very early experiment. A A Chrome Book tool does not really exist as yet.

    There is something wrong that as far as the Parallax web site is concerned SimpleIDE and PropellerIDE don't exist. They do not appear on the downloads page and the search box does not find them. A google search will get you so simpleide on learn.parallax.com but that is the C world not Spin.

    It seems to be taking forever for an open source tool to hit the front page. SimpleIDE has been working for ages now.
  • pik33pik33 Posts: 2,366
    edited 2014-10-28 03:31
    Heater. wrote: »
    I would hazard a guess that the missing component would be the editor.

    (...)

    So how about it Ken? Spill the source!

    And now the Lazarus has a very good code editor component...
    Heater. wrote: »
    The actual compiler is written in x86 assembler.

    So it is time to rewrite it in x64 assembler :)

    (they often ask me if x64 processors CAN be programmed in assembler... so I always answer, yes, they can...)
  • Heater.Heater. Posts: 21,230
    edited 2014-10-28 04:20
    pik33,
    (they often ask me if x64 processors CAN be programmed in assembler)
    You should reply as follows:
    .file   "test.c"
            .text
            .globl  main
            .type   main, @function
    main:
    .LFB0:
            .cfi_startproc
            pushq   %rbp
            .cfi_def_cfa_offset 16
            .cfi_offset 6, -16
            movq    %rsp, %rbp
            .cfi_def_cfa_register 6
            movl    %edi, -20(%rbp)
            movq    %rsi, -32(%rbp)
            movl    $200, -4(%rbp)
            movl    $100, -8(%rbp)
            movl    -8(%rbp), %eax
            movl    -4(%rbp), %edx
            addl    %edx, %eax
            popq    %rbp
            .cfi_def_cfa 7, 8
            ret
            .cfi_endproc
    .LFE0:
            .size   main, .-main
            .ident  "GCC: (Debian 4.7.2-5) 4.7.2"
            .section        .note.GNU-stack,"",@progbits
    

    Looks like we are all set to go.

    Come on Ken where's the code?
  • pik33pik33 Posts: 2,366
    edited 2014-10-28 04:27
    I don't like this syntax; I prefer this... (fragment of code I wrote some time ago in Lazarus)
    function synteza:Tsample;
    
    var a:pointer;
        b:integer;
    
    begin
    a:=@tabl;
       asm
    
       push rax
       push rbx
       push rcx
       push rdx
       push rbp
       push rsi
       push rdi
    
       mov rbp,qword ptr a  
       mov rsi,rbp
       add rsi,4*17000 //  65536: last sin; 
       mov ecx,256
       mov edi,0
       mov ebx,[rsi]    //phase
    @p001:
    
             mov eax,[rsi+12]  // freq ramp
             cmp eax,0
             jne @p012         // zero -> new freq in 4
    
             mov eax,[rsi+4]
             jmp @p013
    
    @p012:   add eax,[rsi+4]   // add ramp
             mov [rsi+4],eax   // save ramped freq
             dec dword ptr [rsi+8] // dec time
             jne @p013
             mov dword ptr[rsi+12],0
    
    @p013:   add ebx,eax
             mov [rsi],ebx    // new phase to tabl
             add eax,[rsi+8]  //freq ramp
             mov [rsi+4],eax  //save ramped freq
    
             mov edx,[rsi+24] // vol ramp
             cmp edx,0
             jne @p002        // zero -> new volume in 16
    
             mov edx,[rsi+16]  // volume
             jmp @p003
    
    @p002:   add edx,[rsi+16] // ramp
             mov [rsi+16],edx // save vol
             dec dword ptr [rsi+20]
             jne @p003
             mov dword ptr [rsi+24],0
    
    
    @p003:   and rbx,$0000000000FFFFFF    // 24-bit phase
             shr rbx,10
             mov eax,[rbp+rbx*4] // sinus
             imul edx         //vol*sin
             add esi,32
             add edi,edx
             mov ebx,[rsi]    //phase
             dec ecx
             jnz @p001
    
    
    @p021:
       sar edi,15
       mov [rbp+4*16385],edi
    
    // second channel
    
       mov ecx,256
       mov edi,0
    @p101:   mov eax,[rsi+12]  // freq ramp
             cmp eax,0
             jne @p112         // zero -> new freq in 4
    
             mov eax,[rsi+4]
             jmp @p113
    
    @p112:   add eax,[rsi+4]   // add ramp
             mov [rsi+4],eax   // save ramped freq
             dec dword ptr [rsi+8] // dec time
             jne @p113
             mov dword ptr[rsi+12],0
    
    @p113:   add ebx,eax
             mov [rsi],ebx    // new phase to tabl
             add eax,[rsi+8]  //freq ramp
             mov [rsi+4],eax  //save ramped freq
    
             mov edx,[rsi+24] // vol ramp
             cmp edx,0
             jne @p102        // zero -> new volume in 16
    
             mov edx,[rsi+16]  // volume
             jmp @p103
    
    @p102:   add edx,[rsi+16] // ramp
             mov [rsi+16],edx // save vol
             dec dword ptr [rsi+20]
             jne @p103
             mov dword ptr [rsi+24],0
    
    
    @p103:   and rbx,$0000000000FFFFFF    // 24-bit phase
             shr rbx,10
             mov eax,[rbp+rbx*4] // sinus
             imul edx         //vol*sin
             add esi,32
             add edi,edx
             mov ebx,[rsi]    //phase
             dec ecx
             jnz @p101
    
    
    @p121:
       sar edi,15
       mov [rbp+4*16386],edi
    
    
    //   popad
    
       pop rdi
       pop rsi
       pop rbp
       pop rdx
       pop rcx
       pop rbx
       pop rax
       end;
    
    synteza[0]:=tabl[16385];
    synteza[1]:=tabl[16386];
    end;
    
    
  • Heater.Heater. Posts: 21,230
    edited 2014-10-28 04:42
    pik33,

    Interesting. Looks like a Direct Digital Synthesis signal generator.

    What platform are you on? Windows? Because the assembler that Free Pascal generates itself is in the format I have above. Which it would seeing as FPC uses the GCC assembler on Linux.
  • pik33pik33 Posts: 2,366
    edited 2014-10-28 05:58
    That is a signal generator :) written in asm because fpc was simply too slow.
    About the asm syntax in Lazarus, compiler options -> assembler style. Then you can select Intel or AT&T. Works in every x86/x64 platform
  • Heater.Heater. Posts: 21,230
    edited 2014-10-28 11:32
    pik33,

    Thanks for the tip re: assembler style.

    I am not the Pascal guy in the company. Whenever I compile our Free Pascal applications I do it from the command line. But that might come in useful one day.

    I have a rule in life: Never write software in a language whose name begins with "P": Perl, PHP, Python, Pascal, Prolog, PL/M, Postscript, Processing... there are many more. For some reason all the "P" languages are miserable :)
  • msrobotsmsrobots Posts: 3,709
    edited 2014-10-28 11:49
    PASM?

    Enjoy!

    Mike
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-10-28 11:51
    ...and in Heater's dictionary, PHORTH! :lol:
  • pik33pik33 Posts: 2,366
    edited 2014-10-28 12:31
    Pascal, as it is today, is good :) - you can program what you want in the way you want :) so I don't want any more (The Spin is even better - maybe we can do a spin compiler for Windows, where if you want the procedure in a new thread, you simply write cognew(procedure) :)
  • David BetzDavid Betz Posts: 14,516
    edited 2014-10-28 12:33
    pik33 wrote: »
    Pascal, as it is today, is good :) - you can program what you want in the way you want :) so I don't want any more (The Spin is even better - maybe we can do a spin compiler for Windows, where if you want the procedure in a new thread, you simply write cognew(procedure) :)
    You sort of already have a Spin compiler for Windows. You can use spin2cpp to translate Spin code to C++ and then compile that with a Windows C++ compiler.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-10-28 18:19
    I too would love to see the x86 pasm assembler code. I wrote a mini emulator in 486 assembler specifically targeting the fast 486 instructions. But that was >20 years ago. Remember PharLap anyone?
  • Heater.Heater. Posts: 21,230
    edited 2014-10-29 00:33
    @msrobots,
    PASM? ... Enjoy!
    Yeah, yeah, that crossed my mind. However in the Propeller world there is no such thing as "PASM". For example try to find it in the Propeller manual.

    There is this "PASM": http://en.wikipedia.org/wiki/Parrot_assembly_language which of course begins with a "P" and is miserable.

    @mindrobots,

    "PHORTH"

    I made a promise to the forum to no longer comment on stack based, syntax free and confusing languages:)

    @Clusso,
    I too would love to see the x86 pasm assembler code.
    Yes. We have to keep nagging at Ken and Chip.
Sign In or Register to comment.