Discussion Forum

Asembly code in C

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

DetailsMessage
Read-Only
Author
aamir khan
Posted
12-Jul-2008 14:23 GMT
Toolset
None
New! Asembly code in C

Hi......... can anyone tell me how can i insert a few assembly instructions in a C code

Read-Only
Author
Andy Neil
Posted
12-Jul-2008 16:10 GMT
Toolset
None
New! Why?

The more important question is why you think you need to do this.

Almost all such requests are based on a fundamentally flawed understanding

You've posted this as "Non-specific (Generic)", but the answer will be specific to the particular compiler that you are using - so, in fact, nobody can really answer you question!

Read-Only
Author
Eduard Jadron
Posted
13-Jul-2008 08:40 GMT
Toolset
C51
New! RE: Asembly code in C

Hi.

You have must enable Generate Assembler SRC File switch and Assembler SRC File in Project Workspace.

#include <reg51.h>
#include <stdio.h>
#include <stdlib.h>
#include <rtx51tny.h>

void Delay(unsigned char Length)
{
#pragma ASM
djnz r7,$
#pragma ENDASM
}

Best Regards

Read-Only
Author
Jon Ward
Posted
14-Jul-2008 16:10 GMT
Toolset
None
New! RE: Asembly code in C

http://www.keil.com/support/docs/2308.htm

Jon

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