9 Replies Latest reply on Feb 22, 2016 2:09 PM by xbolshe

    Assembly in Intel Galileo

    Somik

      Hi, let me start with saying that I am new to board programming. My question is: How can I use pure assembly (not in-line assembly) in Intel Galileo? I have tried google but I have not found any kind of simple guide on this topic. I have tried Arduino IDE, but that did not work out, and I am currently waiting for cables from this IoT - Intel® Galileo Gen 1 Board Assembly using Eclipse* and Intel® XDK IoT Edition | Intel® Developer Zone tutorial to arrive. So what I am hoping for is for someone to explain to me which software (and maybe hardware) do I need to upload my assembly code onto Intel Galileo and which steps do I need to take to do so.

      I appreciate any help.

       

      I know that I do not have to use assembly in Galileo, but that is what I want, so please do not answer saying that I should use Arduino or any other language. Thank you.

       

      PS: I am on WIN8

        • 1. Re: Assembly in Intel Galileo
          Intel_Alvarado

          Hi,

           

          There aren't tools or software to program the Galileo board with assembly code. This thread might be of your interest: Re: "How to" Assembler Debugging Intel Galileo .

           

          Sergio

          • 2. Re: Assembly in Intel Galileo
            Avtar

            how can i change my processor . i'm a employee in a organization.i'm using core i 3 what its not enough for me i want to change it to core 7 How can i do this some one help me ??????

            • 3. Re: Assembly in Intel Galileo
              BenKissBox

              Excuse me Avtar, but what is the relationship between your question and the assembly language ?

              And to answer you, simply said : change your computer... You can not replace a i3 by an i7 on a motherboard. It's like if you have a VW Cox car and you go to the garage to say "please put a Porsche engine in it, because I need more power"

              • 4. Re: Assembly in Intel Galileo
                BenKissBox

                Hello Somik,

                can you explain why you need/want to program the Quark directly into assembly?

                I do not understand your question about "uploading the assembly code". You will never upload an assembly file (more precisely, the Galileo will be unable to do anything with it). The Galileo needs a binary file (ELF format). It does not matter if the source code is assembly, C or whatever else.

                If you are experiencing problems to upload something from Arduino IDE, switching to assembly will not solve anything.

                Now, if you *really* want to loose an incredible amount of time to code in assembly, the best thing is to configure a x86 GAS chain (GAS is the assembler living beside GCC). You will then be able to generate an ELF file that you can upload on x86.

                But once again, I do not understand at all why you want to do it an assembly...

                • 5. Re: Assembly in Intel Galileo
                  Somik

                  Hello BenKissBox,

                  I am sorry for poor explaination i have provided. What I want is to write code in asembly (intel syntax) and upload it to Intel Galileo as a sketch. I dont want to program board itself, but to use asembler as one would use Arduino or C. I can upload arduino sketches and I have no problem with Arduino IDE. Could you explain to me, how to configure GAS?

                  Thank you for any assistance.

                  • 6. Re: Assembly in Intel Galileo
                    FGT

                    Intel_Alvarado wrote:

                     

                    Hi,

                     

                    There aren't tools or software to program the Galileo board with assembly code. This thread might be of your interest: Re: "How to" Assembler Debugging Intel Galileo.

                     

                    Sergio

                    I'm not so sure about this... depending on what you consider "tools or software". Actually, I think there may be some gas as indicated by in another reply. You  are right, however, in that there may be no IDEs or libraries specifically designed for software development in Galileo using Assembly language.

                     

                    Fernando.

                    • 7. Re: Assembly in Intel Galileo
                      FGT

                      Somik wrote:

                       

                      Hello BenKissBox,

                      I am sorry for poor explaination i have provided. What I want is to write code in asembly (intel syntax) and upload it to Intel Galileo as a sketch. I dont want to program board itself, but to use asembler as one would use Arduino or C. I can upload arduino sketches and I have no problem with Arduino IDE. Could you explain to me, how to configure GAS?

                      Thank you for any assistance.

                       

                      Some comments:

                      a) There is not such thing as " write code in asembly (intel syntax) and upload it to Intel Galileo as a sketch". A sketch is a way of referring to an Arduino Sketch, which is handled by the Arduino IDE (handled = written, compiled, uploaded, etc.).

                      b) I think there is no IDE or software specifically designed for developing code in assembly language for Galileo, as mentioned in another reply and the link provided in the same reply.

                      c) Developing using gas should be as simple as writing code in assembly language and compiling "old fashion", i.e. at the Linux console. What you mention as "upload" should be simply run a command line program. I don't think any IDE would help you on this... but maybe I'm wrong, so please tell me if you are able to do so.

                      d) Specifically about " how to configure GAS?" I would start with the XDK image for Galileo, which I've verified it has gcc. I don't know about gas, though.

                       

                      HTH,

                       

                      Fernando.

                      • 8. Re: Assembly in Intel Galileo
                        BenKissBox

                        Hello Somik,

                         

                        gas means "gnu assembler". You will find it in any GNU package, you can find Windows, Linux, Mac executables (it is even installed along with gcc in most cases as far as I remember)

                         

                        But I don't understand what you mean by "Intel syntax". Do you mean the x86 assembly language or the Intel's specific assembly pseudo-ops? You have to know that an assembler tool recognizes two kind of instructions: instructions related to your processor (like "MOV EAX, EBX") which will be transformed into binary code that will be executed by the processor, and pseudo-ops, which are instructions for the assembler tool itself (like "DB" or "DW" which are used to create variables). The pseudo-ops are not part of the x86 instruction set (that's why they are called like this), every assembler can have different ones (even if there is a kind of standard for that)

                         

                        Second point : gas will never produce a sketch. It produces an object file (exactly like gcc). All object files need to be linked in order to get a loadable file (I mean here : which can be loaded by the Linux kernel). For the Arduino, I would *highly* recommend to work like this (making a binary file which can be loaded by Linux). I hope that you do not expect to make a "raw" binary for the X1000... because that's a HUGE work. X1000 are not microcontrollers, they are high end processors. your file would then need to initialize the DRAM controller, the embedded peripherals, etc... (I do not even want to imagine the work to initialize and start the USB controller in assembly...)

                         

                        To automate your work, you will also need to understand how to use "make", which is the utility tool used to generate binary files from source code to binary executable (make does not compile or link, but it starts gas, gcc, the linker, etc... in the correct order and with correct parameters - like the x86 parameter to choose the correct instruction set - so you don't have to type it manually each time; You type "make myprojectname", and wait until it's done °-)

                         

                        Once you have your binary file from assembly, you will need to upload it. The Galileo uses ZMODEM protocol to do that. So you need a ZMODEM transfer utility, and that's done... assuming you want to to use Linux once again... Otherwise, it means you need a JTAG or a ISP programmer to flash the bootloader memory

                         

                        As you can see, it's a lot of work, and using assembly for a complete project is not something common (nowadays, assembly is most of the time used for "inline" assembly within C or C++ code, for some specific sequences where a tight timing or very low level - like DSP - processing is needed)

                        • 9. Re: Assembly in Intel Galileo
                          xbolshe

                          Hi,

                           

                          an example of assembler application is here: https://github.com/xbolshe/galileo-sources/tree/master/blink_asm

                           

                          I used NASM and LD only to make this application.

                           

                          BR,

                          xbolshe