eGospodarka.pl
eGospodarka.pl poleca

eGospodarka.plGrupypl.misc.elektronika › GNU assembler (GAS) - pytanie o #define
Ilość wypowiedzi w tym wątku: 7

  • 1. Data: 2009-11-17 10:26:44
    Temat: GNU assembler (GAS) - pytanie o #define
    Od: SM <b...@k...com.pl>

    Witam,

    Mam pytanie dotyczące GNU asemblera (a dokładnie
    w wersji dla procków AVR32).

    Czy można w nim zrobić coś w rodzaju #define?
    A dokłanie chodzi mi o zastąpienie rejestru
    identyfikatorem,

    czyli zamiast:

    mov r0, r1

    zrobić coś takiego jak w asemblerze dla AVR 8bit:

    .def dst = r0
    .def src = r1

    mov dst, src

    Pozdrawiam,
    SM


  • 2. Data: 2009-11-17 12:37:38
    Temat: Re: GNU assembler (GAS) - pytanie o #define
    Od: Zbych <a...@o...pl>

    SM pisze:

    > Czy można w nim zrobić coś w rodzaju #define?
    > A dokłanie chodzi mi o zastąpienie rejestru
    > identyfikatorem,

    A próbowałeś przed assemblacją przepuścić plik przez preprocesor?
    Czyli dodać swoje #define w pliku i kompilować go z opcją
    "-x assembler-with-cpp"?


  • 3. Data: 2009-11-17 12:55:55
    Temat: Re: GNU assembler (GAS) - pytanie o #define
    Od: SM <b...@k...com.pl>

    Zbych pisze:
    > SM pisze:
    >
    >> Czy można w nim zrobić coś w rodzaju #define?
    >> A dokłanie chodzi mi o zastąpienie rejestru
    >> identyfikatorem,
    >
    > A próbowałeś przed assemblacją przepuścić plik przez preprocesor?
    > Czyli dodać swoje #define w pliku i kompilować go z opcją
    > "-x assembler-with-cpp"?
    >

    Rozumiem że mam nie wywoływać avr32-as.exe tylko avr32-gcc.exe
    z podaną powyżej opcją (albo zapisanym plikiem źródłowym
    z rozszerzeniem .S)?

    SM


  • 4. Data: 2009-11-17 13:39:29
    Temat: Re: GNU assembler (GAS) - pytanie o #define
    Od: Zbych <a...@o...pl>

    SM pisze:
    > Zbych pisze:
    >> SM pisze:
    >>
    >>> Czy można w nim zrobić coś w rodzaju #define?
    >>> A dokłanie chodzi mi o zastąpienie rejestru
    >>> identyfikatorem,
    >>
    >> A próbowałeś przed assemblacją przepuścić plik przez preprocesor?
    >> Czyli dodać swoje #define w pliku i kompilować go z opcją
    >> "-x assembler-with-cpp"?
    >>
    >
    > Rozumiem że mam nie wywoływać avr32-as.exe tylko avr32-gcc.exe
    > z podaną powyżej opcją (albo zapisanym plikiem źródłowym
    > z rozszerzeniem .S)?

    Tak, po podaniu opcji -x rozszerzenie nie ma znaczenia.


  • 5. Data: 2009-11-17 16:13:01
    Temat: Re: GNU assembler (GAS) - pytanie o #define
    Od: SM <b...@k...com.pl>

    >
    > Tak, po podaniu opcji -x rozszerzenie nie ma znaczenia.

    Tylko że teraz kompilator chce mi wcisnąć swoje procedury
    rozruchowe. chyba sekcja .fini czy też .reset. z crt0.
    Czy można jakąś opcją wyłączyć mu doklejanie czegokolwiek?

    SM


  • 6. Data: 2009-11-18 07:23:12
    Temat: Re: GNU assembler (GAS) - pytanie o #define
    Od: Zbych <a...@o...pl>

    SM pisze:
    >>
    >> Tak, po podaniu opcji -x rozszerzenie nie ma znaczenia.
    >
    > Tylko że teraz kompilator chce mi wcisnąć swoje procedury
    > rozruchowe. chyba sekcja .fini czy też .reset. z crt0.
    > Czy można jakąś opcją wyłączyć mu doklejanie czegokolwiek?

    Można:

    -nostartfiles
    Do not use the standard system startup files when linking. The standard
    system libraries are used normally, unless -nostdlib or -nodefaultlibs
    is used.

    -nodefaultlibs
    Do not use the standard system libraries when linking. Only the
    libraries you specify will be passed to the linker. The standard startup
    files are used normally, unless -nostartfiles is used. The compiler may
    generate calls to memcmp, memset, memcpy and memmove. These entries are
    usually resolved by entries in libc. These entry points should be
    supplied through some other mechanism when this option is specified.

    -nostdlib
    Do not use the standard system startup files or libraries when linking.
    No startup files and only the libraries you specify will be passed to
    the linker. The compiler may generate calls to memcmp, memset, memcpy
    and memmove. These entries are usually resolved by entries in libc.
    These entry points should be supplied through some other mechanism when
    this option is specified.


  • 7. Data: 2009-11-18 08:14:41
    Temat: Re: GNU assembler (GAS) - pytanie o #define
    Od: SM <b...@k...com.pl>

    > Można:
    >
    > -nostartfiles
    > Do not use the standard system startup files when linking. The standard
    > system libraries are used normally, unless -nostdlib or -nodefaultlibs
    > is used.
    >
    > -nodefaultlibs
    > Do not use the standard system libraries when linking. Only the
    > libraries you specify will be passed to the linker. The standard startup
    > files are used normally, unless -nostartfiles is used. The compiler may
    > generate calls to memcmp, memset, memcpy and memmove. These entries are
    > usually resolved by entries in libc. These entry points should be
    > supplied through some other mechanism when this option is specified.
    >
    > -nostdlib
    > Do not use the standard system startup files or libraries when linking.
    > No startup files and only the libraries you specify will be passed to
    > the linker. The compiler may generate calls to memcmp, memset, memcpy
    > and memmove. These entries are usually resolved by entries in libc.
    > These entry points should be supplied through some other mechanism when
    > this option is specified.

    Wielkie dzięki za pomoc!

    Pozdrawiam,
    SM

strony : [ 1 ]


Szukaj w grupach

Szukaj w grupach

Eksperci egospodarka.pl

1 1 1

Wpisz nazwę miasta, dla którego chcesz znaleźć jednostkę ZUS.

Wzory dokumentów

Bezpłatne wzory dokumentów i formularzy.
Wyszukaj i pobierz za darmo: