[movitz-cvs] CVS movitz
ffjeld
ffjeld at common-lisp.net
Thu Feb 28 20:30:09 UTC 2008
Update of /project/movitz/cvsroot/movitz
In directory clnet:/tmp/cvs-serv24114
Modified Files:
asm-x86.lisp
Log Message:
Disassembler for OUT instruction.
--- /project/movitz/cvsroot/movitz/asm-x86.lisp 2008/02/28 20:09:08 1.34
+++ /project/movitz/cvsroot/movitz/asm-x86.lisp 2008/02/28 20:30:09 1.35
@@ -6,7 +6,7 @@
;;;; Author: Frode Vatvedt Fjeld <frodef at acm.org>
;;;; Distribution: See the accompanying file COPYING.
;;;;
-;;;; $Id: asm-x86.lisp,v 1.34 2008/02/28 20:09:08 ffjeld Exp $
+;;;; $Id: asm-x86.lisp,v 1.35 2008/02/28 20:30:09 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
@@ -894,7 +894,7 @@
(segment (code-call (decode-integer code '(uint 16)))))
(values (list operator
segment
- offset)
+ (list offset))
code)))
(defun decode-pc-rel (code operator opcode operand-size address-size rex type)
@@ -1216,11 +1216,13 @@
-(defmacro opcode (opcode &optional fixed-operand &rest extras)
+(defmacro opcode (opcode &optional fixed-operand fixed-operand2 &rest extras)
`(progn
(assembler
(when (and ,@(when fixed-operand
- `((eql , at fixed-operand))))
+ `((eql , at fixed-operand)))
+ ,@(when fixed-operand2
+ `((eql , at fixed-operand2))))
(return-values-when
(encoded-values :opcode ,opcode
, at extras
@@ -1228,7 +1230,8 @@
(disassembler
(define-disassembler (operator ,opcode)
decode-no-operands
- ,(second fixed-operand)))))
+ ,(second fixed-operand)
+ ,(second fixed-operand2)))))
(defmacro opcode* (opcode &rest extras)
`(return-values-when
@@ -1726,7 +1729,8 @@
;;;;;;;;;;; IRET
(define-operator* (:16 :iret :32 :iretd :64 :iretq) ()
- (opcode #xcf () :rex default-rex))
+ (opcode #xcf () ()
+ :rex default-rex))
;;;;;;;;;;; Jcc
@@ -1964,28 +1968,16 @@
;;;;;;;;;;; OUT
(define-operator/8 :outb (src port)
- (when (eq :al src)
- (typecase port
- ((eql :dx)
- (opcode #xee))
- ((uint 8)
- (imm port #xe6 (uint 8) (src :al))))))
+ (opcode #xee (src :al) (port :dx))
+ (imm port #xe6 (uint 8) (src :al)))
(define-operator/16 :outw (src port)
- (when (eq :ax src)
- (typecase port
- ((eql :dx)
- (opcode #xef))
- ((uint 8)
- (imm port #xe7 (uint 8) (src :ax))))))
+ (opcode #xef (src :ax) (port :dx))
+ (imm port #xe7 (uint 8) (src :ax)))
(define-operator/32 :outl (src port)
- (when (eq :eax src)
- (typecase port
- ((eql :dx)
- (opcode #xef))
- ((uint 8)
- (imm port #xe7 (uint 8) (src :eax))))))
+ (opcode #xef (src :eax) (port :dx))
+ (imm port #xe7 (uint 8) (src :eax)))
;;;;;;;;;;; POP
More information about the Movitz-cvs
mailing list