Changeset 16631


Ignore:
Timestamp:
Nov 2, 2015, 4:35:11 PM (5 years ago)
Author:
rme
Message:

Add :nop flag to instruction byte #x1f in *disx86-twobyte*.

In x86-putop, unconditionally set (x86-di-flags instruction) to
passed-in flags. This enables the multi-byte nop instruction to
be recognized as a nop and omitted by the instruction printer
if desired.

In x86-print-di-lap, don't add anything extra to the pc offset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/x86-disassemble.lisp

    r16630 r16631  
    12301230   (make-x86-dis "(bad)")
    12311231   (make-x86-dis "(bad)")
    1232    (make-x86-dis "nopS" 'op-e +v-mode+)
     1232   (make-x86-dis '("nopS" . :nop) 'op-e +v-mode+)
    12331233   ;; #x20
    12341234   (make-x86-dis "movL" 'op-rd +m-mode+ 'op-c +m-mode+)
     
    21222122    (when (consp template)
    21232123      (if (x86-ds-mode-64 ds)
    2124       (setq template (cdr template))
    2125       (setq template (car template))))
    2126   (if (dotimes (i (length template) t)
     2124        (setq template (cdr template))
     2125        (setq template (car template))))
     2126    (setf (x86-di-flags instruction) flags)
     2127    (if (dotimes (i (length template) t)
    21272128          (unless (lower-case-p (schar template i))
    21282129            (return nil)))
    2129       (setf (x86-di-mnemonic instruction) template
    2130             (x86-di-flags instruction) flags)
     2130      (setf (x86-di-mnemonic instruction) template)
    21312131      (let* ((string-buffer (x86-ds-string-buffer ds))
    21322132             (mod (x86-ds-mod ds))
     
    22552255                  (vector-push-extend (schar b i) string-buffer))))))
    22562256        (setf (x86-di-mnemonic instruction) (subseq string-buffer 0))))
    2257   ok))
     2257    ok))
    22582258
    22592259(defparameter *x86-disassemble-print-nop* nil)
     
    28982898            (when op2
    28992899              (write-x86-lap-operand t op2 ds)))))
    2900       (format t ")~vt;~8<[~D]~>" (+ comment-start-offset tab-stop) (+ pc (x86-ds-entry-point ds))))
     2900      (format t ")~vt;~8<[~D]~>" (+ comment-start-offset tab-stop) pc))
    29012901    (when *disassemble-verbose*
    29022902      (let* ((istart (x86-di-start instruction))
Note: See TracChangeset for help on using the changeset viewer.