This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to include assmebly inc file in C file?

I want to include an assembly include file in a C file
I am not able to do so using pragma

I tried the following
--------------------------------------------
;File1.asm
TEST_MACRO MACRO mov a, r0 ENDM

//File2.c
#pragma asm
#include "file1.inc"
#pragma endasm

---------------------------------------------
void main()
{ #pragma asm TEST_MACRO
#pragma endasm

}

With this I cannot compile file2.c
The src file formed is
-------------------------------------------------------
//file2.src
NAME FILE2

?PR?main?FILE2 SEGMENT CODE EXTRN CODE (?C_STARTUP) PUBLIC main
; #pragma asm #include "file1.inc" #pragma endasm

void main() { #pragma asm

RSEG ?PR?main?FILE2
main: ; SOURCE LINE # 5 ; SOURCE LINE # 6
; TEST_MACRO TEST_MACRO
; #pragma endasm
; ; } ; SOURCE LINE # 11 RET
; END OF main

END
--------------------------------------------------------

Error is
Cant open file name File1.asm

The #pragma endasm is not detected by the preprocessor

Please help.

Regards,
Gaurav

0