           code (->> body
                     (mapcat #(compile-form args fns %))
                     (tag-with localname))
-          code (concat code [[:rtn]])
+          code (concat code [[:rtn (str "; end " name)]])
           num-locals (count @locals)
           local-scope (concat [[:dum num-locals]]
                        (vec (repeatedly num-locals #(identity [:ldc 0])))

                     loads
                     [[:ldf "@main ; load main"]
                      [:rap (count fns)]
                      [:rtn]])
        prelude {:name 'prelude
              :code code
              :length (count code)}]

  (let [code [[:ldc 0 "; #main"]
              (load-fn 0 'step)
              [:cons]
              [:rtn "; end main"]]
        main {:name 'main
              :code code
              :length (count code)}]
