Curuxa was an open-hardware modular electronics and robotics platform for teaching, developed by Adrián Bulnes (Urriellu) between 2009 and 2010. This is a frozen, read-only archive of the project’s website, curuxa.org; nothing here is maintained. Source code and designs: github.com/Urriellu/Curuxa · Original capture: Wayback Machine · urriellu.net

Snippet:Embed assembly in C

From Curuxa

If you are writing a program in C language but you need to implement a function or piece of code in assembly language, you can do it by writing your code between the __asm and __endasm; directives.

Real example

The following is an example that can also be found in the snippets about delays:

//Delay the program for 10 microseconds
void Delay10us(){
	__asm
		GOTO $+1
		GOTO $+1
		GOTO $+1
		GOTO $+1
		GOTO $+1
		GOTO $+1
		GOTO $+1
		GOTO $+1
		GOTO $+1
	__endasm;
}