wowwww
[cc1516.git] / gen.icl
diff --git a/gen.icl b/gen.icl
index a0333a2..3b32540 100644 (file)
--- a/gen.icl
+++ b/gen.icl
@@ -174,8 +174,10 @@ instance g Expr where
                Just (ADDR t arity) = tell [Instr "ldl" [Lit t] ""] >>| mapM_ g fs >>| pure ()
                Just (LAB l _ fn) = tell 
                        [Instr "ldc" [Lit fn] ""
+                       ,Instr "sth" [] ""
                        ,Instr "ldc" [Lit 0] ""
-                       ,Instr "stmh" [Lit 2] ""]
+                       ,Instr "sth" [] ""
+                       ,Instr "ajs" [Lit -1] ""]
     g (FunExpr _ k es fs) = getAdressbook >>= \ab->case 'Map'.get k ab of
                //Identifier points to function
                Just (LAB l arity fn) = if (arity <> (length es))
@@ -292,18 +294,6 @@ instance g Expr where
                                ,Instr "sub" [] ""
                                ,Instr "str" [Raw "SP"] ""
                                ,Instr "ldr" [Raw "RR"] ""
-                               //RR is nu goed
-//                             ,Instr "ajs" [Lit $ ~ (length es)] ""
-//                             ,Instr "ldl" [Lit t] ""
-//                             ,Instr "ldr" [Raw "RR"] "END OF HIGHERORDERFUNCALL"
-       //                      ,Instr "ldl" [Lit t] ""
-       //                      ,Instr "ldh" [Lit $ 1] ""
-       //                      ,Instr "neg" [] ""
-       //                      ,Instr "ldr" [Raw "SP"] ""
-       //                      ,Instr "add" [] ""
-       //                      ,Instr "ldc" [Lit arity] ""
-       //                      ,Instr "sub" [] ""
-       //                      ,Instr "str" [Raw "SP"] ""
                                ]
                        )
                Nothing = liftT (Left $ Error "Undefined function!!!")