This commit is contained in:
Kartik K. Agaram 2014-08-18 12:12:58 -07:00
parent 4a0b335c28
commit dbe8d43671
1 changed files with 8 additions and 10 deletions

18
mu.arc
View File

@ -27,18 +27,16 @@
`(,operand 1)) ; assume type is always first bit of metadata, and it's always present
(mac m (loc) ; for memory
(w/uniq gloc
`(let ,gloc ,loc
(if (pos 'deref (metadata ,gloc))
(memory* (memory* (v ,gloc)))
(memory* (v ,gloc))))))
`(let loc@ ,loc
(if (pos 'deref (metadata loc@))
(memory* (memory* (v loc@)))
(memory* (v loc@)))))
(mac setm (loc val) ; set memory, respecting addressing-mode tags
(w/uniq gloc
`(let ,gloc ,loc
(if (pos 'deref (metadata ,gloc))
(= (memory* (memory* (v ,gloc))) ,val)
(= (memory* (v ,gloc)) ,val)))))
`(let loc@ ,loc
(if (pos 'deref (metadata loc@))
(= (memory* (memory* (v loc@))) ,val)
(= (memory* (v loc@)) ,val))))
(def run (instrs (o fn-args) (o fn-oargs))
(ret result nil