Разработка, производство и продажа радиоэлектронной аппаратуры
|
Требуется программист в Зеленограде - обработка данных с датчиков; ColdFire; 40 тыс.
e-mail: jobsmp@pochta.ru
|
ASM / ENDASM
Abbreviation: None.
Arguments: None.
Default: None.
μVision2 Control: This directive may not be specified on the command line.
Description: The ASM directive signals the beginning of a block of
source text to merge into the .SRC file generated using the
SRC directive.
This source text can be thought of as in-line assembly.
However, it is output to the source file generated only when
using the SRC directive. The source text is not assembled
and output to the object file.
In μVision2 you may set a file specific option for C source
files that contain ASM/ENDASM sections as follows:
Right click on the file in the Project Window – Files tab
Choose Options for… to open Options – Properties
page
Enable Generate Assembler SRC file
Enable Assemble SRC file.
With this setting, μVision2 generates an assembler source
file (.SRC) and translates this file with the Assembler to an
Object file (.OBJ).
The ENDASM directive signals the end of the source text
block.
NOTE
The ASM and ENDASM directives can occur only in the
source file, as part of a #pragma directive.
Keil Software — Cx51 Compiler User’s Guide 27
2
Example: #pragma asm / #pragma endasm
The following C source file:
.
.
.
stmt level source
1 extern void test ();
2
3 main () {
4 1 test ();
5 1
6 1 #pragma asm
7 1 JMP $ ; endless loop
8 1 #pragma endasm
9 1 }
.
.
.
generates the following .SRC file.
; ASM.SRC generated from: ASM.C
NAME ASM
?PR?main?ASM SEGMENT CODE
EXTRN CODE (test)
EXTRN CODE (?C_STARTUP)
PUBLIC main
; extern void test ();
;
; main () {
RSEG ?PR?main?ASM
USING 0
main:
; SOURCE LINE # 3
; test ();
; SOURCE LINE # 4
LCALL test
;
; #pragma asm
JMP $ ; endless loop
; #pragma endasm
; }
; SOURCE LINE # 9
RET ; END OF main
END
Составить ответ | Вернуться на конференцию
Ответы
- сенькую 8) — thorium (20.09.2007 14:43:3 86.57.155.216, пустое)