Shop OBEX P1 Docs P2 Docs Learn Events
PASM (.S files) in SimpleIDE — Parallax Forums

PASM (.S files) in SimpleIDE

kitsunekitsune Posts: 22
edited 2013-03-10 19:05 in Propeller 1
Hi,

before I make a blatant fool of myself (see below), let me briefly say "hello" since this is my first posting here. I grew up with 6502 assembly language, worked on minicomputers (FORTRAN and assembly) in the early 80s, held a completely different job for many years before I took up microcontroller programming (mostly Atmel AVR) once again in the 1990s. Ubuntu is my primary OS, but I do run XP in a VM (cannot run SimpleIDE under Ubuntu Lucid [Qt compatibility issue -- I have Qt 4.7 installed and SimpleIDE wants >4.7], but that is an entirely different issue...). Anyway, SimpleIDE does work well in the VM. I am not familiar with makefiles and kind of spoiled from Atmel Studio automatically generating makefiles.

Now here is the trouble: Trying to familiarize myself with PASM files under SimpleIDE, I created the following one-liner and stored it as "cog.S":
.section .cog
                .cog_ram

entry            jmp #entry

The other file ("hello.c") is a basic "main" in C. When I build the project, I get the following error message which I cannot interpret:
err.png


gcc does process the *.S file creating an appropriate *.asm file.

Any chance somebody could explain to me what I need to do to make SImpleIDE build a project that includes *.S files? The material in http://forums.parallax.com/showthread.php/142441-Native-assembly-files-(*.S)-in-propgcc?highlight=.s+files is great, but all the makefile stuff is way over my head.

I'd appreciate your assistance.

Kind regards,

Fred
418 x 82 - 3K

Comments

  • altosackaltosack Posts: 132
    edited 2013-03-10 07:16
    Hi Fred,

    There is a thread in the sub-forum "Propeller GCC Beta" with a very similar title to this one that might help. While you may not be familiar with Makefiles, there is an example one there that you can modify very minimally to get you started, and I would recommend using one if you want to include native assembly drivers. It's not absolutely necessary, but it makes things a lot easier, since there are a few steps and a few gotchas in the process.

    David
  • kitsunekitsune Posts: 22
    edited 2013-03-10 07:53
    Thanks for your reply, David. I am afraid the thread you are referring to is the one I am quoting in my initial posting as "way over my head". Guess I am pretty spoiled by automatic builds in Atmel Studio where I have no trouble building applications that include *.S files. Can you possibly give me a pointer to some introductory material on gcc makefiles for the Propeller? I am particularly interested in writing native PASM code running in multiple cogs, possibly (but not necessarily) supported by a minimum of compiled C or interpreted SPIN code in just one other cog. Transitioning to the Propeller was very enjoyable. I do like the learning experience as far as the controller is concerned. Being required to delve into the nitty-gritty of the IDEs seems very awkward to me, however.
  • altosackaltosack Posts: 132
    edited 2013-03-10 08:10
    Fred, as far as I know there is no single source that tells how to do this. Accordingly, I had planned on writing a tutorial on this back in September when I originally posted that thread, since I had to compile information from many different sources to get where I did, but there seemed to be no interest in the topic at the time, so I never did.

    Maybe now's the time !
  • kitsunekitsune Posts: 22
    edited 2013-03-10 08:22
    altosack wrote: »
    ...Maybe now's the time !
    I would certainly appreciate such a tutorial!
    As I said, working with the Propeller is great fun, but I keep struggling with the IDEs. "Propeller Tool" is the only IDE I am sort of happy with as far as the actual IDE is concerned. Since I am not that fond of SPIN and would like to be able to use "luxuries" such as header files and "#define" etc. in my assembly code (and possibly some compiled C code), I am looking into alternatives. A nicer editor would also be good to have...

    Maybe I should feel guilty that I limit myself to writing Propeller code, expecting a functioning IDE. I am definitely aware that most of the development is done by the community. PC programming, IDEs and stuff are matters I am not particularly good at. Therefore, I would like to be able to concentrate on what I do best.
  • jazzedjazzed Posts: 11,803
    edited 2013-03-10 08:43
    SimpleIDE doesn't support ".S" at this time, but it does support ".s". See the gas_toggle demo.
  • kitsunekitsune Posts: 22
    edited 2013-03-10 08:53
    Thank you for the information, jazzed.
    Oh well, if I want to use the luxuries provided by the preprocessor, I will have to learn about makefiles.
  • jazzedjazzed Posts: 11,803
    edited 2013-03-10 09:00
    kitsune wrote: »
    Thank you for the information, jazzed.
    Oh well, if I want to use the luxuries provided by the preprocessor, I will have to learn about makefiles.

    It will be in the April Beta release. I don't have any 0-8-5 maintenance plan at this time mainly because I'm so busy with the Parallax Education update.
  • kitsunekitsune Posts: 22
    edited 2013-03-10 09:12
    Cool -- good to know. Thank you again, jazzed.
  • altosackaltosack Posts: 132
    edited 2013-03-10 09:33
    Although I don't use SimpleIDE, it seems to me that there doesn't need to be support in it for *.S files, as long as you can get it to execute "make" (and it doesn't clobber *your* Makefile). My IDE is an editor with tabs for multiple files and an alt-Tab that switches to the "make" terminal (I could even use proptool if I used Windows, but it doesn't syntax highlight my Makefile or my c files). My Makefile also executes propeller-load with or without terminal output.

    My tutorial would include how to write *.S and cogc drivers for propGCC, modify a boilerplate Makefile, pass and use parameters from the main program to the driver (via a mailbox), and put all this together in an extendable and maintainable way. I understand that there are demos (toggle, in particular) that go pretty far in this, but people still seem to have a lot of questions and problems (as I did myself), so it seems like there's a need. If others would like to add a section on how to integrate this into their IDE of choice, that would be fine.

    Considering the above, Yea or nay ?
  • kitsunekitsune Posts: 22
    edited 2013-03-10 09:45
    Yeah, please, please, please, David!

    Mailbox/communication between cogs and hub etc. is not my real problem, I am much more troubled by the issue of integrating all this into the IDE.

    May I ask which editor you are using (as I mentioned, despite having started with "vi" type editors a long time ago, I am now mostly used to Atmel Studio, which is based on MS Visual)?
    To me, a propeller load function (+ terminal) would be mandatory...
  • jazzedjazzed Posts: 11,803
    edited 2013-03-10 10:08
    altosack wrote: »
    My tutorial would include how to write *.S and cogc drivers for propGCC, modify a boilerplate Makefile, pass and use parameters from the main program to the driver (via a mailbox), and put all this together in an extendable and maintainable way. I understand that there are demos (toggle, in particular) that go pretty far in this, but people still seem to have a lot of questions and problems (as I did myself), so it seems like there's a need. If others would like to add a section on how to integrate this into their IDE of choice, that would be fine.

    Considering the above, Yea or nay ?

    SimpleIDE (and most casual users) don't use make, but many professional software engineers certainly do.

    Any tutorials that show people how to use familiar tools like Make, GCC, and friends in the Propeller context are most welcome.
  • altosackaltosack Posts: 132
    edited 2013-03-10 10:27
    I use gedit (gnome-editor), but I also like bluefish because it has (to me) the most easily extendable syntax highlighting (it took me about 2 hours to extend it for AVR assembly a few years ago). The tutorial will not be about an IDE (y'all can use whatever you want, and I'm not about to start a war !), and it will not be geared towards professional software engineers (they probably already know how to use make), but it will show how automated and useful it can be (even and especially for a newbie) to use generic tools that are available for all platforms.

    Enough chit-chat, the next post I will put in this thread will include a draft of the tutorial, hopefully by tomorrow (I'll have some time tonight).
  • jazzedjazzed Posts: 11,803
    edited 2013-03-10 10:43
    altosack wrote: »
    Enough chit-chat, the next post I will put in this thread will include a draft of the tutorial, hopefully by tomorrow (I'll have some time tonight).

    Make is beautiful in many ways (except the requirement for hard tabs and a few other items).
    I'm certainly not interested in any kind of war of tools - I use make and vim all the time (and emacs sometimes).

    Maybe make just need some image "make-over" marketing.

    I look forward to your post.
  • kitsunekitsune Posts: 22
    edited 2013-03-10 10:49
    I am eagerly awaiting your post, David.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2013-03-10 19:05
    I had a good jumpstart from the stuff you originally posted, but due to time and other things, have not been able to do much since then. Would love to see a good cookbook presentation of tying together C with PASM or GAS cog based assembly so that I can cobble together in C the things it does best along with cog based assembler functions for the speed of it. Looking forward to whatever you come up with. Would also like to become IDE independent for various reasons as well.

    Thanks,

    Frank

    altosack wrote: »
    I use gedit (gnome-editor), but I also like bluefish because it has (to me) the most easily extendable syntax highlighting (it took me about 2 hours to extend it for AVR assembly a few years ago). The tutorial will not be about an IDE (y'all can use whatever you want, and I'm not about to start a war !), and it will not be geared towards professional software engineers (they probably already know how to use make), but it will show how automated and useful it can be (even and especially for a newbie) to use generic tools that are available for all platforms.

    Enough chit-chat, the next post I will put in this thread will include a draft of the tutorial, hopefully by tomorrow (I'll have some time tonight).
Sign In or Register to comment.