     @context = '_this' if @bound
 
   compileExpression: (o) ->
-    @func = o.namespace.createFunc this
-    @func.type = new Type "func", (new Type for _ in @params), new Type
-    @func.type.codeNodes.push this
-    {type: @func.type, access: @func.label}
+    @label = o.namespace.nextLabel()
+    @type = new Type "func", (new Type for _ in @params), new Type
+    @type.codeNodes.push this
+    {type: @type, access: @label}
 
   compileFunc: (o) ->
     o = {namespace: o.namespace.createSubNamespace()}
-    code = @body.compileStatement o
-    # TODO figure returning stuff
-    linkTypes @func.type.findRoot().returnType, voidType
-    returnCode = "set pc, pop"
-    o.namespace.extraAsm.push {asm: ":#{@func.label}\n#{code}\n#{returnCode}"}
+    codes = []
+    codes.push ":#{@label}"
+    # we need z because sp can't be offset inline
+    codes.push "set z, sp"
+    codes.push @body.compileStatement o
+    # TODO figure out how to return stuff
+    linkTypes @type.findRoot().returnType, voidType
+    codes.push "set pc, pop"
+    o.namespace.extraAsm.push asm: codes.join "\n"
 
   children: ['params', 'body']
 

  leftType.linkTo rightType

class Variable
  constructor: (@label, @type, @namespace) ->
class Func
  constructor: (@label, @codeNode) ->

class Namespace
  constructor: (@parent)->

    # good news, guys: you're parameter types are now known!
    for codeNode in callType.findRoot().codeNodes
      codeNode.compileFunc o
    codes = []
    # position the stack just after our local variables
    codes.push "sub sp, #{o.namespace.localVariableCount}"
    for arg in args
      codes.push "set push, #{arg.access}"
    codes.push "jsr #{funcVariable.access()}"
    # restore the stack and z
    codes.push "add sp, #{o.namespace.localVariableCount}"
    codes.push "set z, sp"
    return codes.join("\n")

  # Tag this invocation as creating a new instance.
