Skip to content

Instantly share code, notes, and snippets.

@cygx

cygx/asm.p6 Secret

Created November 19, 2015 12:14
Show Gist options
  • Save cygx/f08da6caf35c7f3de1ff to your computer and use it in GitHub Desktop.
Save cygx/f08da6caf35c7f3de1ff to your computer and use it in GitHub Desktop.
my $cu := MoarASM::CompUnit.new;
$cu.add-frame: {
my \S0 = local str;
my \I0 = local int;
my \N0 = local num;
op_const_s S0, sv('hello');
op_say S0;
op_const_n64 N0, nv(1e0);
op_sleep N0;
op_const_s S0, sv('world');
op_say S0;
op_const_i64 I0, iv(42);
op_return_i I0;
}
say $cu.compile.mainline.();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment