ASM

Abbreviation

None.

Arguments

None.

Default

None.

Description

The ASM directive signals the beginning merge of a block of source text 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.
The ENDASM directive is used to signal the end of the source text block.

NOTE
The ASM directive can occur only in the source file as part of a #pragma directive.

See Also
ENDASM
Example
#pragma asm

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