ARM Technical Support Knowledge Articles

GETTING INLINE ASSEMBLY TO WORK

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

How do I implement inline assembly in C51 using the ASM and ENDASM directives. I have read some of the knowledgebase articles relating to this problem, but I still cannot get it to work.

ANSWER

The following example program, MAIN.C, demonstrates some simple inline assembly.

void main(void){
test();

#pragma asm
JMP $ ; endless loop
#pragma endasm
}

The following rules apply to C51 inline assembly:

MORE INFORMATION

SEE ALSO

Article last edited on: 2008-07-17 03:50:34

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential