From fe5a09fc91df961ac93e22723c36ae26cf6409c5 Mon Sep 17 00:00:00 2001 From: dtc <dtc> Date: Thu, 29 Jan 1998 07:15:45 +0000 Subject: [PATCH] Adding a printer for the INT immediate byte instruction. --- compiler/x86/insts.lisp | 25 ++++++++++++------------- compiler/x86/macros.lisp | 7 +++---- compiler/x86/system.lisp | 8 +++----- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/compiler/x86/insts.lisp b/compiler/x86/insts.lisp index e24c376a2..9712ea33b 100644 --- a/compiler/x86/insts.lisp +++ b/compiler/x86/insts.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/insts.lisp,v 1.13 1997/12/03 15:28:58 dtc Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/insts.lisp,v 1.14 1998/01/29 07:15:40 dtc Exp $") ;;; ;;; ********************************************************************** ;;; @@ -16,7 +16,7 @@ ;;; Written by William Lott ;;; ;;; Debugged by Paul F. Werkowski Spring/Summer 1995. -;;; Debugging and enhancements by Douglas Crosher 1996, 1997. +;;; Debugging and enhancements by Douglas Crosher 1996, 1997, 1998. ;;; (in-package :x86) @@ -1895,14 +1895,12 @@ ;;;; Interrupt instructions. -(disassem:define-instruction-format - (break 16 :default-printer '(:name :tab code)) - (op :field (byte 8 0) :value #b11001100) +;;; Single byte instruction with an immediate byte argument. +(disassem:define-instruction-format (byte-imm 16 + :default-printer '(:name :tab code)) + (op :field (byte 8 0)) (code :field (byte 8 8))) -(define-emitter emit-break-inst 16 - (byte 8 0) (byte 8 8)) - (defun snarf-error-junk (sap offset &optional length-only) (let* ((length (system:sap-ref-8 sap offset)) (vector (make-array length :element-type '(unsigned-byte 8)))) @@ -1944,7 +1942,7 @@ (defun break-control (chunk inst stream dstate) (declare (ignore inst)) (flet ((nt (x) (if stream (disassem:note x dstate)))) - (case (break-code chunk dstate) + (case (byte-imm-code chunk dstate) (#.vm:error-trap (nt "Error trap") (disassem:handle-break-args #'snarf-error-junk stream dstate)) @@ -1963,14 +1961,15 @@ (define-instruction break (segment code) (:declare (type (unsigned-byte 8) code)) - (:printer break ((op #b11001100)) - '(:name :tab code) - :control #'break-control ) + (:printer byte-imm ((op #b11001100)) '(:name :tab code) + :control #'break-control) (:emitter - (emit-break-inst segment #b11001100 code))) + (emit-byte segment #b11001100) + (emit-byte segment code))) (define-instruction int (segment number) (:declare (type (unsigned-byte 8) number)) + (:printer byte-imm ((op #b11001101))) (:emitter (etypecase number ((member 3) diff --git a/compiler/x86/macros.lisp b/compiler/x86/macros.lisp index 3e387d703..3c5270fd5 100644 --- a/compiler/x86/macros.lisp +++ b/compiler/x86/macros.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/macros.lisp,v 1.9 1997/11/25 17:59:22 dtc Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/macros.lisp,v 1.10 1998/01/29 07:15:43 dtc Exp $") ;;; ;;; ********************************************************************** ;;; @@ -16,7 +16,7 @@ ;;; Written by William Lott. ;;; ;;; Debugged by Paul F. Werkowski Spring/Summer 1995. -;;; Enhancements/debugging by Douglas T. Crosher 1996,1997. +;;; Enhancements/debugging by Douglas T. Crosher 1996,1997,1998. ;;; (in-package :x86) @@ -371,8 +371,7 @@ (- other-pointer-type))) 0) (inst jmp :eq ,label) - (inst int 3) - (inst byte pending-interrupt-trap) + (inst break pending-interrupt-trap) (emit-label ,label))))) diff --git a/compiler/x86/system.lisp b/compiler/x86/system.lisp index e0c8447a0..732da8551 100644 --- a/compiler/x86/system.lisp +++ b/compiler/x86/system.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/system.lisp,v 1.7 1997/12/31 18:03:32 dtc Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/system.lisp,v 1.8 1998/01/29 07:15:45 dtc Exp $") ;;; ;;; ********************************************************************** ;;; @@ -285,13 +285,11 @@ (:policy :fast-safe) (:translate unix::do-pending-interrupt) (:generator 1 - (inst int 3) - (inst byte pending-interrupt-trap))) + (inst break pending-interrupt-trap))) (define-vop (halt) (:generator 1 - (inst int 3) - (inst byte halt-trap))) + (inst break halt-trap))) (defknown float-wait () (values)) (define-vop (float-wait) -- GitLab