реклама на сайте
подробности

 
 
> startup.s для Cortex M4
vanek18
сообщение Jun 4 2015, 05:58
Сообщение #1


Участник
*

Группа: Участник
Сообщений: 15
Регистрация: 30-01-15
Пользователь №: 84 841



Добрый день! Подскажите пожалуйста, в startup.s для Cortex-M4 в обработчике сброса написано следующее:
CODE
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT __main
IMPORT SystemInit

LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
Почему SystemInit без подчеркивания,а __main с ними...и что вообще значат эти два подчеркивания?
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
esaulenka
сообщение Jun 4 2015, 09:49
Сообщение #2


Профессионал
*****

Группа: Свой
Сообщений: 1 032
Регистрация: 13-03-08
Из: Маськва
Пользователь №: 35 877



Что странно, описание гуглится плохо.

Зато есть локальная копия:
Цитата(C:\Keil_v5\ARM\Hlp\armlib.chm)
The entry point of a program is at __main in the C library where library code:
- Copies non-root (RO and RW) execution regions from their load addresses to their execution addresses. Also, if any data sections are compressed, they are decompressed from the load address to the execution address.
- Zeroes ZI regions.
- Branches to __rt_entry.


Цитата
The library function __rt_entry() runs the program as follows:
Sets up the stack and the heap by one of a number of means that include calling __user_setup_stackheap(), calling __rt_stackheap_init(), or loading the absolute addresses of scatter-loaded regions.
Calls __rt_lib_init() to initialize referenced library functions, initialize the locale and, if necessary, set up argc and argv for main().
For C++, calls the constructors for any top-level objects by way of __cpp_initialize__aeabi_.
Calls main(), the user-level root of the application.
From main(), your program might call, among other things, library functions.
Calls exit() with the value returned by main().


--------------------
Тут обсуждается творческий порыв, а не соответствие каким-либо стандартам ©
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 21st July 2025 - 23:07
Рейтинг@Mail.ru


Страница сгенерированна за 0.01372 секунд с 7
ELECTRONIX ©2004-2016