You are not logged in.

#1 2009-10-26 17:44:47

z.s.tar.gz
Member
From: Rural Florida
Registered: 2008-12-12
Posts: 298

How can you compile assembly?

I'm working on a robot and I already know assembly. I want to use avrdude to transfer it, but I don't know what to use to actually compile it.

I'm going to be using the atmega 644 if that helps.


I need to find a way out so everyone can find their way out.
Resregietd Lunix Uesr: 485581

Offline

#2 2009-10-26 18:25:14

reqamst
Member
Registered: 2009-10-24
Posts: 11

Re: How can you compile assembly?

I had never worked with avr microcontrollers, so I'm not really sure, but gcc-avr should be ok. It's in AUR.

Last edited by reqamst (2009-10-26 18:28:12)

Offline

#3 2009-10-26 23:22:06

z.s.tar.gz
Member
From: Rural Florida
Registered: 2008-12-12
Posts: 298

Re: How can you compile assembly?

I thought gcc only compiled C. Can it compile ASM too?


I need to find a way out so everyone can find their way out.
Resregietd Lunix Uesr: 485581

Offline

#4 2009-10-26 23:33:36

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: How can you compile assembly?

I don't know anything at all about assembly, but I do know that yasm is what x264 is using to compile their asm code.

Offline

#5 2009-10-26 23:34:17

tlvb
Member
From: Sweden
Registered: 2008-10-06
Posts: 297
Website

Re: How can you compile assembly?

You probably want avra, which is the avr assembler, and on top of that the include file for your particular mcu. In your case it should be something like m644def.inc and it tells useful stuff like what memory address PORTA maps to and such. Note that the latest versions of these inc files are incompatible with avra, or at least the one in the repos/aur, so you might have some converting to do.

Last edited by tlvb (2009-10-26 23:35:05)


I need a sorted list of all random numbers, so that I can retrieve a suitable one later with a binary search instead of having to iterate through the generation process every time.

Offline

#6 2009-10-26 23:35:14

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: How can you compile assembly?

Sweet.  AVRs are great fun to work with.

The big one is AVR-libc.  It is in community.
http://www.nongnu.org/avr-libc/user-man … mbler.html

There are also alternatives such as
http://avra.sourceforge.net/
http://www.avr-asm-tutorial.net/gavrasm/index_en.html

Offline

#7 2009-10-26 23:36:59

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: How can you compile assembly?

gcc does a lot of languages, avr32 being one of them.

GCC does not stand for 'GNU C Compiler', as some people seems to think, but 'GNU Compiler Collection'

Last edited by Mr.Elendig (2009-10-26 23:38:11)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#8 2009-10-26 23:42:09

tlvb
Member
From: Sweden
Registered: 2008-10-06
Posts: 297
Website

Re: How can you compile assembly?

Yeah, avrgcc can be set to produce asm output for debugging purposes, so it is probable that you can use it to assemble avr asm too, but I haven't figured out why, and the asm I've written so far has been painless with avra, except for the initial hump of converting the include file.


I need a sorted list of all random numbers, so that I can retrieve a suitable one later with a binary search instead of having to iterate through the generation process every time.

Offline

#9 2009-10-27 00:09:04

SoleSoul
Member
From: Israel
Registered: 2009-06-29
Posts: 319

Re: How can you compile assembly?

I thought gcc only compiled C. Can it compile ASM too?

GNU "as" is GNU assembler. It's part of the binutils. It uses at&t syntax though.

Offline

#10 2009-10-27 01:36:04

z.s.tar.gz
Member
From: Rural Florida
Registered: 2008-12-12
Posts: 298

Re: How can you compile assembly?

Cool. I was thinking of writing my own libraries anyways.
Probably going to go with avr-gcc first, then if that doesn't work try avra. Or maybe yasm.
I used to use zasm with the ti83's.


I need to find a way out so everyone can find their way out.
Resregietd Lunix Uesr: 485581

Offline

#11 2009-10-27 13:45:14

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: How can you compile assembly?

gcc can be used to link object code, but it will not assemble source. I've used gcc to link assembly that makes calls to unix system functions. Just a guess, but I suspect that gcc only acts as a wrapper to ld when using it in this fashion. Given your application, you'll probably be calling ld directly.

Offline

#12 2009-10-27 19:34:02

z.s.tar.gz
Member
From: Rural Florida
Registered: 2008-12-12
Posts: 298

Re: How can you compile assembly?

I'm kind of confused with ld, so I think I'm going to go with avra instead then.


I need to find a way out so everyone can find their way out.
Resregietd Lunix Uesr: 485581

Offline

#13 2009-10-27 20:26:54

tlvb
Member
From: Sweden
Registered: 2008-10-06
Posts: 297
Website

Re: How can you compile assembly?

well, there is avr-as which is an alias (or something) for as, the GNU assembler. I've just never used it...


I need a sorted list of all random numbers, so that I can retrieve a suitable one later with a binary search instead of having to iterate through the generation process every time.

Offline

Board footer

Powered by FluxBB