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

In Line Assembly Issue

I am using following code by enabling FILE-OPTIONS-ASSEMBLE SRC FILE flag in one of my test.C file.

In test.c file I used following code:
#pragma asm NOP
#pragma endasm

After inclding generated test.SRC file in project browser, when I compile will get following error:

test.SRC(127): error A9: SYNTAX ERROR

In test.src file at 127 line I observed following line of statement:

<DPTR DATA 082H>

What's the worng with this?

Parents
  • But, as Erik says, why not just use the _nop_() Intrinsic function?
    An additional comment
    If you use the Keil kludged inline assembly (I do not have a problem with it, I'd never use inline assembly anyhow - but it IS kludged) you lose the C source based debug and THAT is a pain.

    Anyhow, if you need a nop in C code you are using the wrong tool regardless, how are you going to ensure in any way that the reamining C is going to time as you want next time you com,pile it.

    Well, since two different persons have the same problem, I guess it is schoolwork.

    Erik

Reply
  • But, as Erik says, why not just use the _nop_() Intrinsic function?
    An additional comment
    If you use the Keil kludged inline assembly (I do not have a problem with it, I'd never use inline assembly anyhow - but it IS kludged) you lose the C source based debug and THAT is a pain.

    Anyhow, if you need a nop in C code you are using the wrong tool regardless, how are you going to ensure in any way that the reamining C is going to time as you want next time you com,pile it.

    Well, since two different persons have the same problem, I guess it is schoolwork.

    Erik

Children