Society of Robots - Robot Forum

Software => Software => Topic started by: backman on February 15, 2011, 09:48:24 AM

Title: 50$ robot and assembler
Post by: backman on February 15, 2011, 09:48:24 AM
Hi,
I have a little question. I am compiling c# code and I need assembler code because I understand more to assembler. Because i have linux I am compiling with make file and so I don't know how to do it.

Sorry for my bad english.
Title: Re: 50$ robot and assembler
Post by: dmclifton on February 15, 2011, 10:38:54 AM
To clarify, you mean C code right? C# is .Net CLR code that does not compile down to machine code.

I would suggest rather that you learn C code instead of working with assembler...it is much easier to use (once you understand it), and it all compiles down to the same thing (the .hex machine code).

There is no good direct way I know of to convert C code into assembler code, because assembler is not a 'step' in the process of compilation. There are tools to convert X86 code into assembler but these won't work, as you want to work with the registers and whatnot in your particular microprocessor. Somebody else might know something, but in general it is a rather manual process.
Title: Re: 50$ robot and assembler
Post by: backman on February 15, 2011, 10:50:53 AM
Yes I mean C code. And I thought the c code must go trought assembler. But thanks for answer.
Title: Re: 50$ robot and assembler
Post by: waltr on February 15, 2011, 11:56:52 AM
I don't know about the tools to compile code for the processor in the $50 Bot project.

I work with PICs from Microchip and their tools (MPLAB IDE) do create assembler code from the C compilers and then invokes the assembler and linker to produce the finial Hex file.
Also with MPLAB IDE one can look at the assembler code produced and even run the simulator into the assembler code.
Title: Re: 50$ robot and assembler
Post by: dmclifton on February 15, 2011, 12:15:21 PM
Not what you are looking for per-se, but I did see this: you can combine C program code with assembler.

http://winavr.scienceprog.com/avr-gcc-tutorial/how-to-combine-c-program-with-external-asm.html (http://winavr.scienceprog.com/avr-gcc-tutorial/how-to-combine-c-program-with-external-asm.html)

It is possible that the AVR stuff goes to assembler first, but I haven't seen such when using AVR Studio at least.