Hi everybody. I want to ask. I write a program in C languge, in this program I want to call a program that I wrote by assembler, when I use below it's not run. Please help me. #pragma src(Main.asm) #include<reg52.h> #include<stdio.h> #include<math.h> #include <intrins.h> #include <stdlib.h> void main(void) { Write_Lcd(); Delay(); } void Delay() { #pragma asm ; open inline-assembly block Mov R3,#0 LoopTreDsp: Nop Nop Nop Djnz R3,LoopTreDsp #pragma endasm }
yes. if I wrote #pragma SRC(SML.ASM) #include(reg52.h) ... void Delay(); void main(void) { while(1) { Delay(); } } void Delay() { Mov R3,#0 Loop: Nop Nop Nop Djnz R3,Loop } It generate error as: C51 FATAL - ERROR ACTION: PARSING INVOKE -/#PRAGMA-LINE LINE: #pragma SRC( ERROR: RESPECIFIED OR CONFLICTING CONTROL C51 TERMINATE. Target not created. and if I copy Delay subroutine and paste it into A.51 file and call it from Main.c as below: extern Delay(); void main(void) { while(1) { Delay(); } } It run correct.