Commit 90d6b4c7 authored by Frode Vatvedt Fjeld's avatar Frode Vatvedt Fjeld

Sign-extend the displacement part of an instruction when decoding it.

parent e0ddeec1
;;;;------------------------------------------------------------------
;;;;
;;;; Copyright (C) 2000, 2001, 2002, 2004,
;;;; Copyright (C) 2000, 2001, 2002, 2004-2005,
;;;; Department of Computer Science, University of Tromso, Norway
;;;;
;;;; Filename: codec.lisp
......@@ -9,7 +9,7 @@
;;;; Created at: Thu May 4 15:16:45 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
;;;; $Id: codec.lisp,v 1.5 2004/02/10 00:03:14 ffjeld Exp $
;;;; $Id: codec.lisp,v 1.6 2004/09/02 09:01:19 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
......@@ -701,11 +701,12 @@ decode a datum into a symbolic instr-symbolic object."
(incf byte-pos (template-instr-immediate-numo template))
;; displacement
(setf (instr-symbolic-displacement is)
(complex (change-endian (ldb (byte (* 8 (template-instr-displacement-numo template))
(* 8 byte-pos))
datum)
(template-instr-displacement-numo template))
(template-instr-displacement-numo template)))
(sign-extend-complex
(complex (change-endian (ldb (byte (* 8 (template-instr-displacement-numo template))
(* 8 byte-pos))
datum)
(template-instr-displacement-numo template))
(template-instr-displacement-numo template))))
(incf byte-pos (template-instr-displacement-numo template))
;; SIB
(when (template-instr-sib-p template)
......
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