[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] First steps with avr-gcc

From: Dave Hylands
Subject: Re: [avr-gcc-list] First steps with avr-gcc
Date: Fri, 21 Oct 2005 11:22:23 -0700

Hi David,

Sending to the whole list this time.

> My questions:
> - The C code is not complete in the list file. Usually, the next line
> after a '{' is missing. Is there something wrong on my side or should it
> simply be like this?

I normally add a special rule to my makefile to produce list files. I
use the following options:

%.cod : %.c FORCE
        $(ECHO) "Listing $< ..."
        $(Q)$(COMPILE.c) -gstabs -Wa,-ahdlms=$@ $<

This snippet was from my own makefile that I use for building and
probably isn't entirely compatible with whatever you're using.

> - the function uses 2 registers (16 bits) while it should only use 8 bits.
> Is there something wrong on the make settings I used (generated by AVR
> Studio btw) or something else?

By default, the compiler is setup to use 16 bit ints. The C language
requires that the & operation promote both sides to ints.

Using the -mint8 option will produce smaller code (but only have 8 bit ints).

> - I'm surely lacking some knowledge here, should I first start reading the
> make manual, the gcc one or simply improve my C knowledge?

All of the above :) Information like this is normally buried deep and
often requires connecting multiple tidbits together.

Dave Hylands
Vancouver, BC, Canada

reply via email to

[Prev in Thread] Current Thread [Next in Thread]