|
Project Information
Links
|
DeprecatedAs3c is no longer in development. Checkout Apparat instead. It includes a more advanced and robust inline assembler plus tons of other features.As3cAs3c is a bytecode compiler for the AVM2 written in C#. FeaturesIt allows you to...
As3c works great with Mono on Linux and OS X. You do not even have to recompile it. Syntax exampleHello worldThis example is equivalent to a simple trace('Hello World!'). package
{
import flash.display.Sprite;
import de.popforge.asm.Op;
import de.popforge.asm.__asm;
/**
* Hello World example using As3c inline asm syntax.
*
* @author Joa Ebert
*/
public class Main extends Sprite
{
public function Main()
{
__asm(
Op.findPropertyStrict('public::trace'),
Op.pushString('Hello World!'),
Op.callPropertyVoid('public::trace', 1)ยด
);
}
}
}New possibilitiesWhen using asm you can define labels wherever you want. You can also jump to labels from any point in your code. This opens completly new possibilities as you can see. Although this one might be a little bit confusing ;) package
{
import flash.display.Sprite;
import de.popforge.asm.Op;
import de.popforge.asm.__asm;
/**
* Asm example for new possibilities when using labels and inline asm.
*
* @author Joa Ebert
*/
public class Main extends Sprite
{
public function Main()
{
if (true === true)
{
__asm(Op.jump('.else'));
__asm('.if:');
trace('Hello if!');
}
else
{
__asm('.else:');
trace('Hello else!');
__asm(Op.jump('.if'));
}
}
}
}AlternativesIf you are familiar with the haXe language you might want to take a look at hxASM. An ActionScript 2 alternative is flasm. |