Discussion Forum

In Line Assembly Issue

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Steve Jeff
Posted
14-May-2007 20:35 GMT
Toolset
C51
New! 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?

Read-Only
Author
erik malund
Posted
14-May-2007 21:43 GMT
Toolset
C51
New! RE: In Line Assembly Issue

why not use the canned _nop_ macro

Read-Only
Author
Andy Neil
Posted
14-May-2007 22:35 GMT
Toolset
C51
New! Inline Assembler - Just don't do it!

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

Have you also enabled the generate assembler source option?

But, as Erik says, why not just use the _nop_() Intrinsic function?
http://www.keil.com/support/man/docs/c51/c51_lib_intrinsic.htm

Read-Only
Author
erik malund
Posted
14-May-2007 22:45 GMT
Toolset
C51
New! RE: Inline Assembler - Just don't do it!

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

Read-Only
Author
Andy Neil
Posted
15-May-2007 07:37 GMT
Toolset
C51
New! schoolwork?

"two different persons have the same problem"

See: http://www.keil.com/forum/docs/thread9887.asp

Next Thread | Thread List | Previous Thread Start a Thread | Settings