diff options
-rw-r--r-- | mu.arc.t | 21 | ||||
-rw-r--r-- | new.mu | 8 |
2 files changed, 25 insertions, 4 deletions
diff --git a/mu.arc.t b/mu.arc.t index a054a48e..4d2efd3c 100644 --- a/mu.arc.t +++ b/mu.arc.t @@ -297,6 +297,27 @@ (clear) (add-fns + '((main + ((1 integer) <- literal 34) + ((2 integer) <- copy (1 integer))))) +(run function*!main) +;? (prn memory*) +(if (~iso memory* (obj 1 34 2 34)) + (prn "F - 'copy' performs direct addressing")) + +(clear) +(add-fns + '((main + ((1 integer-address) <- literal 2) + ((2 integer) <- literal 34) + ((3 integer) <- deref (1 integer-address))))) +(run function*!main) +;? (prn memory*) +(if (~iso memory* (obj 1 2 2 34 3 34)) + (prn "F - 'deref' performs indirect addressing")) + +(clear) +(add-fns '((test1 ((4 type) <- otype 0) ((5 type) <- literal integer) diff --git a/new.mu b/new.mu index 0ec7a440..aa0f28c4 100644 --- a/new.mu +++ b/new.mu @@ -1,14 +1,14 @@ ; memory map: 1-1000 reserved for the (currently non-reentrant) allocator (main ((1 integer) <- literal 1000) ; location 1 contains the high-water mark for the memory allocator - ((4 integer-pointer) <- new) - ((5 integer) <- deref (4 integer-pointer)) + ((4 integer-address) <- new) + ((5 integer) <- deref (4 integer-address)) ) (new - ((2 integer-pointer) <- copy (1 integer)) + ((2 integer-address) <- copy (1 integer)) ((3 integer) <- literal 1) ((1 integer) <- add (1 integer) (3 integer)) - (reply (2 integer-pointer))) + (reply (2 integer-address))) ;; vim:ft=scheme |