[movitz-cvs] CVS movitz
ffjeld
ffjeld at common-lisp.net
Sun Dec 16 08:57:19 UTC 2007
Update of /project/movitz/cvsroot/movitz
In directory clnet:/tmp/cvs-serv19475
Added Files:
asm.lisp
Log Message:
New assembler, not completed.
--- /project/movitz/cvsroot/movitz/asm.lisp 2007/12/16 08:57:19 NONE
+++ /project/movitz/cvsroot/movitz/asm.lisp 2007/12/16 08:57:19 1.1
;;;;------------------------------------------------------------------
;;;;
;;;; Copyright (C) 2007 Frode V. Fjeld
;;;;
;;;; Description: Assembly syntax etc.
;;;; Author: Frode Vatvedt Fjeld <frodef at acm.org>
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: asm.lisp,v 1.1 2007/12/16 08:57:19 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(defpackage asm
(:use :common-lisp)
(:export #:symbol-reference-p
#:symbol-reference
#:symbol-reference-symbol
#:immediate-p
#:immediate-operand
#:indirect-operand-p
#:indirect-operand
#:register-operand
#:unresolved-symbol))
(in-package asm)
(deftype symbol-reference ()
'(cons (eql quote) (cons symbol null)))
(defun symbol-reference-p (expr)
(typep expr 'symbol-reference))
(defun symbol-reference-symbol (expr)
(check-type expr symbol-reference)
(second expr))
(deftype immediate-operand ()
'(or integer symbol-reference))
(defun immediate-p (expr)
(typep expr 'immediate-operand))
(deftype register-operand ()
'keyword)
(defun register-p (operand)
(typep operand 'register-operand))
(deftype indirect-operand ()
'cons)
(defun indirect-operand-p (operand)
(consp operand))
(define-condition unresolved-symbol ()
((symbol
:initarg :symbol
:reader unresolved-symbol))
(:report (lambda (c s)
(format s "Unresolved symbol ~S." (unresolved-symbol c)))))
More information about the Movitz-cvs
mailing list