;;; -*- Mode:Lisp; Readtable:ZL; Package:USER; Base:8; Patch-File:T -*-
;;; Patch file for MICRO-COMPILATION-TOOLS version 3.1
;;; Reason:
;;;  fix DESCRIBE-MISC-MAP and DESCRIBE-MID-RAM-MAP to know about TRAP
;;; Written 25-Mar-86 07:13:43 by JRM at site LMI Cambridge
;;; while running on Moe from band 3
;;; with Experimental System 110.152, Experimental Lambda-Diag 7.3, Experimental Local-File 68.4, Experimental FILE-Server 18.2, Experimental Unix-Interface 9.1, Experimental ZMail 65.10, Experimental Object Lisp 3.0, Experimental Tape 6.11, Experimental Site Data Editor 3.1, Experimental Tiger 24.0, Experimental KERMIT 31.2, Experimental Window-Maker 1.0, Experimental Gateway 4.0, Experimental TCP-Kernel 39.5, Experimental TCP-User 62.5, Experimental TCP-Server 45.5, Experimental MEDIUM-RESOLUTION-COLOR 3.0, Experimental MICRO-COMPILATION-TOOLS 3.0, microcode 1428, SDU ROM 103, Alpha III Andover.


;; *** Note: ***
;;   You may lose because the buffer has no readtable attribute.
;; *************

; From modified file DJ: L.MICRO-COMPILER; MLAP.LISP#60 at 25-Mar-86 07:13:44
#8R COMPILER#:
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "COMPILER")))
  (PATCH-SOURCE-FILE "SYS: MICRO-COMPILER; MLAP  "

(defun describe-misc-map ()
  (format t "~%Table of Active Misc Instructions~
            ~% Legend: + is system, * is user, ? is NIL symbol, - is TRAP, = is ILLOP~%")
  (do ((j *least-misc-opcode* (1+ j))
       (syspkgs (list (pkg-find-package "SYSTEM") (pkg-find-package "GLOBAL")))
       (pc-array #'micro-code-symbol-area)
       (name-array #'micro-code-symbol-name-area)
       (c)(pc)(name))
      ((> j *greatest-misc-opcode*))
    (if (zerop (remainder j #o100))
	(format t "~%~4o: " j))
    (setq pc (aref pc-array (misc-opcode->array-index j)))
    (setq name (aref name-array (misc-opcode->array-index j)))
    (cond ((= pc 4)
	   (setq c #/=))
	  ((= pc #o127)
	   (setq c #/-) )
	  ((null name)
	   (setq c #/?))
	  ((memq (symbol-package name) syspkgs)
	   (setq c #/+))
	  ('else
	   (setq c #/*)))
    (send standard-output :tyo c)))

))

; From modified file DJ: L.MICRO-COMPILER; MLAP.LISP#60 at 25-Mar-86 07:13:59
#8R COMPILER#:
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "COMPILER")))
  (PATCH-SOURCE-FILE "SYS: MICRO-COMPILER; MLAP  "

(defun describe-mid-ram-map ()
  (format t "~%Macro Instruction Decode Ram~%Legend: + useful, - is TRAP, = is ILLOP, @ is ZERO.")
  (dolist (bank *mid-ram-banks*)
    (format t "~%~S instructions:" (car bank))
    (do ((j 0 (1+ j))
	 (pc)
	 (c))
	((= j #o2000))
      (if (zerop (remainder j #o100))
	  (format t "~%~4o: " j))
      (setq pc (read-macro-instruction-decode-ram (car bank) j))
      (cond ((= pc 4)
	     (setq c #/=))
	    ((= pc #o127)
	     (setq c #/-))
	    ((= pc 0)
	     (setq c #/@))
	    ('else
	     (setq c #/+)))
      (send standard-output :tyo c))))

))
