GNU assembler (GAS) - pytanie o #define

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

Reply to
SM
Loading thread data ...

SM pisze:

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"?

Reply to
Zbych

Zbych pisze:

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

Reply to
SM

SM pisze:

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

Reply to
Zbych

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

Reply to
SM

SM pisze:

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.

Reply to
Zbych

Wielkie dzięki za pomoc!

Pozdrawiam, SM

Reply to
SM

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.