[movitz-cvs] CVS movitz

ffjeld ffjeld at common-lisp.net
Mon Feb 25 23:34:11 UTC 2008


Update of /project/movitz/cvsroot/movitz
In directory clnet:/tmp/cvs-serv13493

Modified Files:
	asm.lisp 
Log Message:
Add indirect-operand-offset.


--- /project/movitz/cvsroot/movitz/asm.lisp	2008/02/23 22:35:08	1.15
+++ /project/movitz/cvsroot/movitz/asm.lisp	2008/02/25 23:34:11	1.16
@@ -6,7 +6,7 @@
 ;;;; Author:        Frode Vatvedt Fjeld <frodef at acm.org>
 ;;;; Distribution:  See the accompanying file COPYING.
 ;;;;                
-;;;; $Id: asm.lisp,v 1.15 2008/02/23 22:35:08 ffjeld Exp $
+;;;; $Id: asm.lisp,v 1.16 2008/02/25 23:34:11 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -19,6 +19,9 @@
 	   #:immediate-operand
 	   #:indirect-operand-p
 	   #:indirect-operand
+	   #:indirect-operand-offset
+	   #:instruction-operands
+	   #:instruction-operator
 	   #:register-operand
 	   #:resolve-operand
 	   #:unresolved-symbol
@@ -112,6 +115,12 @@
 (defun indirect-operand-p (operand)
   (typep operand 'indirect-operand))
 
+(defun indirect-operand-offset (operand)
+  (check-type operand indirect-operand)
+  (reduce #'+ operand
+	  :key (lambda (x)
+		 (if (integerp x) x 0))))
+
 (deftype pc-relative-operand ()
   '(cons (eql :pc+)))
 




More information about the Movitz-cvs mailing list