Commit 8a4531fb authored by Frode Vatvedt Fjeld's avatar Frode Vatvedt Fjeld

Designate the ia-x86 package with #:ia-x86 rather than "IA-X86".

Also, a few very minor edits.
parent 9342c8df
......@@ -10,11 +10,11 @@
;;;; Author: Frode Vatvedt Fjeld <frodef@acm.org>
;;;; Created at: Wed Apr 10 12:47:08 2002
;;;;
;;;; $Id: alignment.lisp,v 1.1.1.1 2004/01/12 14:19:00 ffjeld Exp $
;;;; $Id: alignment.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
(defclass alignment ()
((type
......
......@@ -9,11 +9,11 @@
;;;; Created at: Thu May 4 15:16:45 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: codec.lisp,v 1.3 2004/02/08 22:35:11 ffjeld Exp $
;;;; $Id: codec.lisp,v 1.4 2004/02/08 22:38:35 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
(defparameter *error-on-eof* nil)
(defparameter *error-on-unknown-instruction* nil)
......@@ -23,7 +23,7 @@
;;; ----------------------------------------------------------------
;;; A "template" is an object that is used to map op-codes to
;;; instructions. The basic problem it solves is that IA-X86 uses
;;; instructions. The basic problem it solves is that ia-x86 uses
;;; variable-length op-codes. Consequently, figuring out if the
;;; octets you are currently decoding represents a complete op-code
;;; is non-trivial.
......
......@@ -8,11 +8,11 @@
;;;; Created at: Thu May 4 16:41:20 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: def-instr.lisp,v 1.1.1.1 2004/01/12 14:19:00 ffjeld Exp $
;;;; $Id: def-instr.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
(defvar *instr-definitions* (make-hash-table))
......@@ -28,8 +28,8 @@
collect (make-instr-template instr-spec))))
(templates-remember name templates)))
*instr-definitions*)
(table-stats "IA-X86: " *template-table*)
(table-stats "IA-X86 2op: " *template-table-0f*))
(table-stats "ia-x86: " *template-table*)
(table-stats "ia-x86 2op: " *template-table-0f*))
(defun make-instr-template (instr-spec)
(destructuring-bind (base-class
......
;;;;------------------------------------------------------------------
;;;;
;;;; Copyright (C) 200120001999, 2002,
;;;; Copyright (C) 200120001999, 2002, 2004,
;;;; Department of Computer Science, University of Tromso, Norway
;;;;
;;;; Filename: ia-x86.lisp
......@@ -9,11 +9,11 @@
;;;; Created at: Fri Dec 17 18:01:26 1999
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: ia-x86.lisp,v 1.1.1.1 2004/01/12 14:19:00 ffjeld Exp $
;;;; $Id: ia-x86.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
;;; ----------------------------------------------------------------
;;; Instruction Definition
......
;;;;------------------------------------------------------------------
;;;;
;;;; Copyright (C) 2000,
;;;; Copyright (C) 2000, 2004,
;;;; Department of Computer Science, University of Tromso, Norway
;;;;
;;;; Filename: ia-x86-inline-data.lisp
;;;; Filename: inline-data.lisp
;;;; Description: Objects that represents inline data in assembly listings.
;;;; Author: Frode Vatvedt Fjeld <frodef@acm.org>
;;;; Created at: Mon Aug 21 10:35:46 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: inline-data.lisp,v 1.1.1.1 2004/01/12 15:23:55 ffjeld Exp $
;;;; $Id: inline-data.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
(defclass inline-data () ())
......
......@@ -9,11 +9,11 @@
;;;; Created at: Wed Feb 16 14:02:57 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: operands.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;; $Id: operands.lisp,v 1.3 2004/02/09 23:46:23 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
;;; ----------------------------------------------------------------
;;; Operand types
......
;;;;------------------------------------------------------------------
;;;;
;;;; Copyright (C) 20012000, 2002-2003,
;;;; Copyright (C) 20012000, 2002-2004,
;;;; Department of Computer Science, University of Tromso, Norway
;;;;
;;;; Filename: packages.lisp
......@@ -9,14 +9,14 @@
;;;; Created at: Wed Feb 16 14:02:57 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: packages.lisp,v 1.1 2004/01/13 11:04:33 ffjeld Exp $
;;;; $Id: packages.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "CL-USER")
(in-package #:cl-user)
(defpackage "IA-X86"
(:use "COMMON-LISP")
(defpackage #:ia-x86
(:use #:common-lisp)
(:export
#:init-instruction-tables
#:*cpu-mode*
......@@ -91,9 +91,9 @@
#:symtab-try-lookup-label
))
(defpackage "IA-X86-INSTR"
(:use "IA-X86")
(:import-from "COMMON-LISP" t nil defclass load eval compile)
(defpackage #:ia-x86-instr
(:use #:ia-x86)
(:import-from #:common-lisp t nil defclass load eval compile)
(:documentation
"All the specialized classes for IA-X86 instructions are put into
"All the specialized classes for ia-x86 instructions are put into
this package, so that we may have instructions named 'and' etc."))
......@@ -9,11 +9,11 @@
;;;; Created at: Mon Jan 31 16:33:23 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: postload.lisp,v 1.2 2004/01/14 22:22:30 ffjeld Exp $
;;;; $Id: postload.lisp,v 1.3 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
(defun table-stats (prefix table)
(format t "~&;; ~A ~D x86 instruction templates loaded.~%"
......@@ -45,12 +45,3 @@
(dotimes (i #x100 (nreverse r))
(when (null (aref table i))
(push i r)))))))
;;;(table-stats "IA-X86: " *template-table*)
;;;(table-stats "IA-X86 2op: " *template-table-0f*)
;;;;------------------------------------------------------------------
;;;;
;;;; Copyright (C) 20012000, 2003,
;;;; Copyright (C) 20012000, 2003-2004,
;;;; Department of Computer Science, University of Tromso, Norway
;;;;
;;;; Filename: prefixes.lisp
......@@ -9,11 +9,11 @@
;;;; Created at: Tue Aug 15 22:34:30 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: prefixes.lisp,v 1.1.1.1 2004/01/12 14:19:00 ffjeld Exp $
;;;; $Id: prefixes.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
;;; ----------------------------------------------------------------
;;; Instruction prefixes
......
......@@ -9,11 +9,11 @@
;;;; Created at: Mon May 15 13:43:55 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: proglist.lisp,v 1.1.1.1 2004/01/12 14:19:00 ffjeld Exp $
;;;; $Id: proglist.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
(defvar *label-counter* 0)
(defun make-label ()
......
......@@ -9,11 +9,11 @@
;;;; Created at: Mon Jul 31 13:54:27 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: read.lisp,v 1.1.1.1 2004/01/12 14:19:00 ffjeld Exp $
;;;; $Id: read.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
;;; Implements the following assembly syntax:
;;;
......@@ -63,7 +63,7 @@
(assert (member spec +all-registers+)
(spec)
"Expected a register: ~A" spec)
(find-symbol (symbol-name spec) "IA-X86"))
(find-symbol (symbol-name spec) #:ia-x86))
(defun is-register-p (spec)
(and (symbolp spec)
......@@ -209,7 +209,7 @@ returns the symbol/label that is referenced."
(loop for p in prefix-spec
with user-size = nil
if (symbolp p)
collect (let ((ps (find-symbol (symbol-name p) "IA-X86")))
collect (let ((ps (find-symbol (symbol-name p) #:ia-x86)))
(if (decode-set +prefix-opcode-map+ ps :errorp nil)
ps
(error "No such prefix: ~A" p)))
......@@ -218,14 +218,6 @@ returns the symbol/label that is referenced."
do (setf user-size p)
finally (return (values prefixes user-size))))
;;; (mapcar #'(lambda (p)
;;; (let ((ps (find-symbol (symbol-name p)
;;; "IA-X86")))
;;; (if (decode-set *prefix-opcode-map* ps :errorp nil)
;;; ps
;;; (error "No such prefix: ~A" p))))
;;; prefix-spec))
(defvar *find-instruction-cache* (make-hash-table :test #'eq))
(defun read-instruction (sexpr)
......@@ -235,10 +227,10 @@ returns the symbol/label that is referenced."
(setf (values prefix-list user-size) (read-prefixes (first sexpr))
instr-name (second sexpr)
operand-list (nthcdr 2 sexpr))
(setf prefix-list nil
user-size nil
instr-name (first sexpr)
operand-list (nthcdr 1 sexpr)))
(setf prefix-list nil
user-size nil
instr-name (first sexpr)
operand-list (nthcdr 1 sexpr)))
(case instr-name
(:align
(make-instance 'alignment :type operand-list))
......@@ -246,14 +238,14 @@ returns the symbol/label that is referenced."
(mapcar #'read-operand operand-list))
(t (make-instance (or (gethash instr-name *find-instruction-cache*)
(setf (gethash instr-name *find-instruction-cache*)
(multiple-value-bind (instr-symbol instr-symbol-status)
(find-symbol (string instr-name) "IA-X86-INSTR")
(unless instr-symbol-status
(error "No instruction named ~A." (string instr-name)))
instr-symbol)))
'prefixes prefix-list
'user-size user-size
'operands (mapcar #'read-operand operand-list))))))
(multiple-value-bind (instr-symbol instr-symbol-status)
(find-symbol (string instr-name) #:ia-x86-instr)
(unless instr-symbol-status
(error "No instruction named ~A." (string instr-name)))
instr-symbol)))
'prefixes prefix-list
'user-size user-size
'operands (mapcar #'read-operand operand-list))))))
(defun inline-data-p (expr)
......
;;;;------------------------------------------------------------------
;;;;
;;;; Copyright (C) 2000,
;;;; Copyright (C) 2000, 2004,
;;;; Department of Computer Science, University of Tromso, Norway
;;;;
;;;; Filename: ia-x86-registers.lisp
;;;; Filename: registers.lisp
;;;; Description:
;;;; Author: Frode Vatvedt Fjeld <frodef@acm.org>
;;;; Created at: Tue Aug 1 10:24:59 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: registers.lisp,v 1.1.1.1 2004/01/12 14:19:00 ffjeld Exp $
;;;; $Id: registers.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
;;; ----------------------------------------------------------------
;;; Register sets
......
;;;;------------------------------------------------------------------
;;;;
;;;; Copyright (C) 2000,
;;;; Copyright (C) 2000, 2004,
;;;; Department of Computer Science, University of Tromso, Norway
;;;;
;;;; Filename: ia-x86-symtab.lisp
;;;; Filename: symtab.lisp
;;;; Description: Assembly symbolic lookups.
;;;; Author: Frode Vatvedt Fjeld <frodef@acm.org>
;;;; Created at: Tue Aug 22 10:01:38 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: symtab.lisp,v 1.1.1.1 2004/01/12 14:19:00 ffjeld Exp $
;;;; $Id: symtab.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
(in-package "IA-X86")
(in-package #:ia-x86)
;;; A symtab is a stack-organized list of "frames", where each frame
;;; is a hash-table.
......
;;;;------------------------------------------------------------------
;;;;
;;;; Copyright (C) 20012000, 2003, Frode Vatved Fjeld
;;;; Copyright (C) 20012000, 2003-2004, Frode Vatved Fjeld
;;;;
;;;; Filename: utilities.lisp
;;;; Description:
......@@ -8,13 +8,13 @@
;;;; Created at: Sun Nov 2 14:51:21 EET 2003
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: utilities.lisp,v 1.1.1.1 2004/01/12 14:19:00 ffjeld Exp $
;;;; $Id: utilities.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
;; FIXME: There is probably a better place in the great scheme of
;; things for stuff like this...
(in-package "IA-X86")
(in-package #:ia-x86)
;; Unfortunately ANSI doesn't specify the slots and initargs of
;; STYLE-WARNINGS... but we don't want to signal full WARNIGN either,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment