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
Didn't find your answer? Ask the community — no account required.
Z
Zbych
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"?
S
SM
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
Z
Zbych
SM pisze:
Tak, po podaniu opcji -x rozszerzenie nie ma znaczenia.
S
SM
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
Z
Zbych
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.
S
SM
Wielkie dzięki za pomoc!
Pozdrawiam, SM
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.