1 ;;;;------------------------------------------------------------------
3 ;;;; Copyright (C) 2000, 2002,
4 ;;;; Department of Computer Science, University of Tromso, Norway
6 ;;;; Filename: instr-mul-div.lisp
7 ;;;; Description: Multiplication and division instructions
8 ;;;; Author: Frode Vatvedt Fjeld <frodef@acm.org>
9 ;;;; Created at: Mon Jan 31 21:12:11 2000
10 ;;;; Distribution: See the accompanying file COPYING.
12 ;;;; $Id: instr-mul-div.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
14 ;;;;------------------------------------------------------------------
16 (in-package "IA-X86-INSTR")
20 (def-instr mul
(instruction))
21 (def-instr mulb
(mul) (:digit
(#xf6
4) 0 (r/m8 ax al
)))
22 (def-instr mulw
(mul) (:digit
(#xf7
4) 0 (r/m16 ax dx
) :operand-mode
:16-bit
))
23 (def-instr mull
(mul) (:digit
(#xf7
4) 0 (r/m32 eax edx
) :operand-mode
:32-bit
))
27 (def-instr imul
(instruction))
28 (def-instr imulb
(imul)
29 (:digit
(#xf6
5) 0 (r/m8 ax al
)))
31 (def-instr imulw
(imul)
32 (:digit
(#xf7
5) 0 (r/m16 ax dx
) :operand-mode
:16-bit
)
33 (:r
#c
(#x0faf
2) (r/m16 r16
) :operand-mode
:16-bit
)
34 (:r-imm
#x6b
1 (imm8 r
/m16 r16
) :operand-mode
:16-bit
)
35 (:r-imm
#x69
2 (imm16 r
/m16 r16
) :operand-mode
:16-bit
))
37 (def-instr imull
(imul)
38 (:digit
(#xf7
5) 0 (r/m32 eax edx
) :operand-mode
:32-bit
)
39 (:r
#c
(#x0faf
2) (r/m32 r32
) :operand-mode
:32-bit
)
40 (:r-imm
#x6b
1 (simm8 r
/m32 r32
) :operand-mode
:32-bit
)
41 (:r-imm
#x69
4 (simm32 r
/m32 r32
) :operand-mode
:32-bit
))
45 (def-instr div
(instruction))
48 ;; divide AX by r/m8 into AL, AH
49 (:digit
(#xf6
6) 0 (r/m8 ax
)))
51 ;; divide DX:AX by r/m16 into AX, DX
52 (:digit
(#xf7
6) 0 (r/m16 ax dx
) :operand-mode
:16-bit
))
54 ;; divide EDX:EAX by r/m32 into EAX, EDX
55 (:digit
(#xf7
6) 0 (r/m32 eax edx
) :operand-mode
:32-bit
))
59 (def-instr idiv
(instruction))
60 (def-instr idivb
(idiv)
61 ;; divide AX by r/m8 into AL, AH
62 (:digit
(#xf6
7) 0 (r/m8 ax
)))
63 (def-instr idivw
(idiv)
64 ;; divide DX:AX by r/m16 into AX, DX
65 (:digit
(#xf7
7) 0 (r/m16 ax dx
) :operand-mode
:16-bit
))
66 (def-instr idivl
(idiv)
67 ;; divide EDX:EAX by r/m32 into EAX, EDX
68 (:digit
(#xf7
7) 0 (r/m32 eax edx
) :operand-mode
:32-bit
))