about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-07-10 22:08:08 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-07-10 22:08:08 -0700
commitf4bc8c31484c848881f9995a3b8333777fea8440 (patch)
tree61e8e887b2d97544284e50e1e27ee7e9a1eef33d /mu.arc
parentf9ff24be5a1cb6e1dd67479b59faacaaeeb48d60 (diff)
downloadmu-f4bc8c31484c848881f9995a3b8333777fea8440.tar.gz
11 - enhance the language with types
The types aren't actually used yet. That comes later.
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc16
1 files changed, 9 insertions, 7 deletions
diff --git a/mu.arc b/mu.arc
index 3755f4fa..f87bc8d1 100644
--- a/mu.arc
+++ b/mu.arc
@@ -1,7 +1,9 @@
 ; things that a future assembler will need separate memory for:
 ;   code; types; args channel
 (def clear ()
-  (= types* (table))
+  (= types* (obj
+              integer (obj size 1)
+              address (obj size 1)))
   (= memory* (table))
   (= function* (table)))
 (clear)
@@ -23,14 +25,14 @@
 ;?           (prn op " " oarg)
           (case op
             loadi
-              (= (memory* oarg.0) arg.0)
+              (= (memory* oarg.0.1) arg.0)
             add
-              (= (memory* oarg.0)
-                 (+ (memory* arg.0) (memory* arg.1)))
+              (= (memory* oarg.0.1)
+                 (+ (memory* arg.0.1) (memory* arg.1.1)))
             read
-              (= (memory* oarg.0)
+              (= (memory* oarg.0.1)
                  ; hardcoded channel for now
-                 (memory* pop.fn-args))
+                 (memory* pop.fn-args.1))
             reply
               (= returned (annotate 'result arg))
             ; else user-defined function
@@ -38,7 +40,7 @@
 ;?                 (prn "== " memory*)
                 (each o oarg
 ;?                   (prn o)
-                  (= memory*.o (memory* pop.results))))
+                  (= (memory* o.1) (memory* pop.results.1))))
             )))))
 ;?   (prn "return")
     rep.returned)