--- /dev/null
+//---------------------------------------------------------------------
+// Register Usage
+//---------------------------------------------------------------------
+// %rax Accumulator Register
+// %rsi Program Counter
+// %rsp Argument Stack Pointer
+
+//---------------------------------------------------------------------
+// Main Routine
+//---------------------------------------------------------------------
+
+// Execute next instruction
+.macro NEXT
+ lodsq
+ jmpq *(%rax)
+.endm
+
+// Macro to define a primitive
+.macro defcode name
+ .data
+ .global \name
+ .p2align 4
+\name :
+ .quad code_\name
+ .text
+ .globl code_\name
+ .p2align 4, 0x90
+code_\name :
+ // ...the code goes here...
+.endm
+
+// Macro to define a function
+.macro deffun name
+ .data
+ .global \name
+ .p2align 4
+\name :
+ .quad EXEC_FUN
+ // ...the code goes here...
+.endm
+
+// Main Interpreter Definition
+ .text
+ .globl EXEC_FUN
+ .p2align 4, 0x90
+EXEC_FUN:
+ pushq %rsi
+ pushq %rsp
+ pushq %rbp
+ leaq 8(%rax), %rsi
+ movq %rsp, %rbp
+ NEXT
+
+//---------------------------------------------------------------------
+// Primitive Definitions
+//---------------------------------------------------------------------
+
+// Exit the application
+defcode OP_halt
+ popq %rdi
+ call _exit
+
+// Exit a function, returning to the caller
+defcode OP_return
+ popq %rbx
+ lodsq
+ movq %rbp, %rsp
+ popq %rbp
+ popq %rsp
+ popq %rsi
+ leaq (%rsp, %rax, 8), %rsp
+ pushq %rbx
+ NEXT
+
+// Pushes an immediate value onto the stack
+defcode OP_imm
+ lodsq
+ pushq %rax
+ NEXT
+
+// Duplicates the top value on the stack
+defcode OP_dup
+ movq (%rsp), %rax
+ pushq %rax
+ NEXT
+
+// Drops the top N values from the stack
+defcode OP_dropn
+ lodsq
+ leaq (%rsp, %rax, 8), %rsp
+ NEXT
+
+// Allocates space for N locals in the current stack frame
+defcode OP_localsn
+ lodsq
+ leaq (%rsp, %rax, 8), %rsp
+ NEXT
+
+// Push the Nth argument onto the stack
+defcode OP_ldargn
+ NEXT
+
+// Push the Nth local onto the stack
+defcode OP_ldlocn
+ NEXT
+
+// Pop top of stack and store to the Nth argument slot
+defcode OP_stargn
+ NEXT
+
+// Pop top of stack and store to the Nth local slot
+defcode OP_stlocn
+ NEXT
+
+//---------------------------------------------------------------------
+// Main Routine
+//---------------------------------------------------------------------
+ .text
+ .global _main
+ .global main
+ .p2align 4, 0x90
+_main:
+main:
+ pushq %rax
+ movq %rsp, %rbp
+ leaq cold_start(%rip), %rsi
+ NEXT
+
+// First instructions to execute by the interpreter
+ .data
+ .global cold_start
+ .p2align 4
+cold_start:
+ .quad OP_imm, 1
+ .quad OP_imm, 2
+ .quad dummy
+ .quad OP_halt
+
+deffun dummy
+ .quad OP_imm, 0x2A
+ .quad OP_return, -2