Skip to content

Instantly share code, notes, and snippets.

@bkerley
Created September 27, 2008 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkerley/13379 to your computer and use it in GitHub Desktop.
Save bkerley/13379 to your computer and use it in GitHub Desktop.
dispatch "+"
{
asm (
"xor %%rax, %%rax\n\t"
"call _stack_pop\n\t"
"push %%rax\n\t"
"xor %%rax, %%rax\n\t"
"call _stack_pop\n\t"
"pop %%rbx\n\t"
"add %%rax, %%rbx\n\t"
"mov %%rbx, %%rdi\n\t"
"call _stack_push\n\t"
: /* no output */
: /* no input */
: "%rax", "%rbx", "%rdi"
);
}
dispatch "*"
{
pop a
pop b
add a, b
push b
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment