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

PROBLEM WHILE INSERTING ASM CODE INTO C FILES

Hello,
Iam facing problem with inserting asm code into my c file, what i did is
I have opend new project and target controller is at89c51, and added following c file to project.
***************************************
#pragma SRC
#pragma LARGE


#include <stdio.h>
#include <intrins.h>
#include <at89x51.h>

void main(void)
{
#pragma asm
MOV A,#21H
JMP $
#pragma endasm
}

*******************************
the above was the sample file, i am trying to learn inline asm

then i press F7 compiler shows some error like src control to be active.

then i right click on my .c file and i activated "Assemble SRC file" option the shows
error following.
*******************
*** FATAL ERROR L210: I/O ERROR ON INPUT FILE:
EXCEPTION 0021H: PATH OR FILE NOT FOUND
FILE: D1.OBJ
*******************
then again i right click on my .c file and i
activated "Generate Assemble SRC file" option
then while compiling shows error is

********************
C51 FATAL-ERROR -
ACTION: PRASING INVOKE-/#PRAGMA -LINE
LINE: #pragma SRC
ERROR: RESPECIFIED OR CONFLICTING CONTROL.
********************

Why the above was happening, is any thing i am doing wrong?.
Please help me Regarding above.

THANKING YOU,
PADMANABHAM

Parents
  • Sir,
    This is true that file d1.obj does not exists in that folder, i think the reason is that when compiling very first time the errors are comming and is giving "Target not created" message. and for that reason only i have suspected my code/compiling sequence/method. Then i asked help me on is code is fault or compiling method problem. on my first post. still i am confused.
    And i have tried a removing first two lines ie. #pragma SRC, #pragma LARGE and put tick mark for Genrerate asm src file options then compiled. This time ok but warning comes is unresolved external ?c_startup etc.
    but program works fine.
    Any way thanks for helping and i am very sorry for taking your valueble time, becasue of i am not expert in c programming and also in ENGLISH LANGUAGE to discuss with other people who knows english only.

    PADMANABHAM

Reply
  • Sir,
    This is true that file d1.obj does not exists in that folder, i think the reason is that when compiling very first time the errors are comming and is giving "Target not created" message. and for that reason only i have suspected my code/compiling sequence/method. Then i asked help me on is code is fault or compiling method problem. on my first post. still i am confused.
    And i have tried a removing first two lines ie. #pragma SRC, #pragma LARGE and put tick mark for Genrerate asm src file options then compiled. This time ok but warning comes is unresolved external ?c_startup etc.
    but program works fine.
    Any way thanks for helping and i am very sorry for taking your valueble time, becasue of i am not expert in c programming and also in ENGLISH LANGUAGE to discuss with other people who knows english only.

    PADMANABHAM

Children