   VmInst
   (-step [this vm-state]
     (assoc vm-state :stack
-           (make-fn :code (assemble '((args 1)
-                                      (lvar 1 0 stack)
-                                      (set-cc)
-                                      (lvar 0 0 fun)
-                                      (return)))
+           (make-fn :code (assemble '((ARGS 1)
+                                      (LVAR 1 0 stack)
+                                      (SET-CC)
+                                      (LVAR 0 0 fun)
+                                      (RETURN)))
                     :env (->Env [(:stack vm-state)])
                     :name '%cc
                     :args '[fun])))

;;; VM Instructions
;;; ===============

(defn make-prim [symbol n-args opcode always? side-effect?]
  "Create a new primitive instruction."
  {:type :primitive-instruction
   :symbol symbol
   :n-args n-args

;;; The Global Environment
;;; ======================

(defn make-global-env
  "Create a hash table that serves as the global environment."
  []
  {})

;;; The VM State
;;; ============

(defn make-return-address
  "Create a new return address that jumps to step `pc` in `function`."
  [{:keys [function pc env]}]
  {:type :return-address
   :function function
   :pc pc
   :env env})

(defn make-fn
  "Create a new bytecode-interpreted function."
  [{:keys [code env name args]}]
  {:type :bytecode-function
   :code code
   :env env
   :name name
   :args args})

(defn initial-state
  "Create a new state for a VM, initially executing function `f`"
  [f]
  {:type :vm-state
   :function f
   :code (:code f)
