11 - fix 'deref'

It was broken since commit 7.
This commit is contained in:
Kartik K. Agaram 2014-07-31 02:04:01 -07:00
parent 73978d2f82
commit 66a52b5ff2
2 changed files with 8 additions and 8 deletions

2
mu.arc
View File

@ -112,7 +112,7 @@
(= (m oarg.0) (m arg.0))
deref
(= (m oarg.0)
(m (memory* arg.0))) ; TODO
(memory* (m arg.0)))
reply
(do (= result arg)
(break))

14
new.mu
View File

@ -1,14 +1,14 @@
; memory map: 1-1000 reserved for the (currently non-reentrant) allocator
(main
((integer 1) <- literal 1000) ; location 1 contains the high-water mark for the memory allocator
((integer-pointer 4) <- new)
((integer 5) <- deref (integer-pointer 4))
((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))
)
(new
((integer-pointer 2) <- copy (integer 1))
((integer 3) <- literal 1)
((integer 1) <- add (integer 1) (integer 3))
(reply (integer-pointer 2)))
((2 integer-pointer) <- copy (1 integer))
((3 integer) <- literal 1)
((1 integer) <- add (1 integer) (3 integer))
(reply (2 integer-pointer)))
;; vim:ft=scheme