1 ;;;; target-only stuff from CMU CL's src/compiler/x86/insts.lisp
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
17 (defun print-mem-access (value stream print-size-p dstate)
18 (declare (type list value)
20 (type (member t nil) print-size-p)
21 (type sb!disassem:disassem-state dstate))
23 (princ (sb!disassem:dstate-get-prop dstate 'width) stream)
24 (princ '| PTR | stream))
25 (write-char #\[ stream)
27 (macrolet ((pel ((var val) &body body)
28 ;; Print an element of the address, maybe with
29 ;; a leading separator.
33 (write-char #\+ stream))
36 (pel (base-reg (first value))
37 (print-addr-reg base-reg stream dstate))
38 (pel (index-reg (third value))
39 (print-addr-reg index-reg stream dstate)
40 (let ((index-scale (fourth value)))
41 (when (and index-scale (not (= index-scale 1)))
42 (write-char #\* stream)
43 (princ index-scale stream))))
44 (let ((offset (second value)))
45 (when (and offset (or firstp (not (zerop offset))))
46 (unless (or firstp (minusp offset))
47 (write-char #\+ stream))
49 (sb!disassem:princ16 offset stream)
50 (princ offset stream))))))
51 (write-char #\] stream))