src/wam/instructions.lisp @ 7447809d31ad
More work on L0, a bit of cleanup
author |
Steve Losh <steve@stevelosh.com> |
date |
Sat, 26 Mar 2016 20:40:23 +0000 |
parents |
859a6c1314d3 |
children |
d80af96eaf15 |
(in-package #:bones.wam)
;;;; Query Instructions
(defun* %put-structure ((wam wam)
(functor symbol)
(arity arity)
(register register-index))
(:returns :void)
(let ((structure-cell (make-cell-structure (1+ (wam-heap-pointer wam))))
(functor-cell (make-cell-functor
(wam-ensure-functor-index wam functor)
arity)))
(wam-heap-push! wam structure-cell)
(wam-heap-push! wam functor-cell)
(setf (wam-register wam register) structure-cell))
(values))
(defun* %set-variable ((wam wam) (register register-index))
(:returns :void)
(let ((cell (make-cell-reference (wam-heap-pointer wam))))
(wam-heap-push! wam cell)
(setf (wam-register wam register) cell))
(values))
(defun* %set-value ((wam wam) (register register-index))
(:returns :void)
(wam-heap-push! wam (wam-register wam register))
(values))
;;;; Program Instructions
(defun* %get-structure ((wam wam)
(functor symbol)
(arity arity)
(register register-index))
(:returns :void)
(values))
(defun* %unify-variable ((wam wam) (register register-index))
(:returns :void)
(values))
(defun* %unify-value ((wam wam) (register register-index))
(:returns :void)
(values))