/[movitz]/ia-x86/instr-and-or.lisp
ViewVC logotype

Contents of /ia-x86/instr-and-or.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Mon Jun 21 07:33:00 2004 UTC (9 years, 9 months ago) by ffjeld
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +4 -4 lines
Minor edits.
1 ;;;;------------------------------------------------------------------
2 ;;;;
3 ;;;; Copyright (C) 2001-2004,
4 ;;;; Department of Computer Science, University of Tromso, Norway
5 ;;;;
6 ;;;; Filename: instr-and-or.lisp
7 ;;;; Description: Bitwise boolean operations.
8 ;;;; Author: Frode Vatvedt Fjeld <frodef@acm.org>
9 ;;;; Created at: Tue Feb 1 17:39:09 2000
10 ;;;; Distribution: See the accompanying file COPYING.
11 ;;;;
12 ;;;; $Id: instr-and-or.lisp,v 1.3 2004/06/21 07:33:00 ffjeld Exp $
13 ;;;;
14 ;;;;------------------------------------------------------------------
15
16 (in-package #:ia-x86-instr)
17
18 ;;; ----------------------------------------------------------------
19 ;;; AND [IISR page 11-64]
20 ;;; ----------------------------------------------------------------
21
22 (def-instr and (instruction))
23
24 (def-instr andb (and)
25 (:plain #x24 (0 1) (imm8 al))
26 (:digit (#x80 4) 1 (imm8 r/m8))
27 (:r #x20 (r8 r/m8))
28 (:r #x22 (r/m8 r8)))
29
30 (def-instr andw (and)
31 (:plain #x25 (0 2) (imm16 ax) :operand-mode :16-bit)
32 (:digit (#x81 4) 2 (imm16 r/m16) :operand-mode :16-bit)
33 (:digit (#x83 4) 1 (simm8 r/m16) :operand-mode :16-bit)
34 (:r #x21 (r16 r/m16) :operand-mode :16-bit)
35 (:r #x23 (r/m16 r16) :operand-mode :16-bit))
36
37 (def-instr andl (and)
38 (:plain #x25 (0 4) (imm32 eax) :operand-mode :32-bit)
39 (:digit (#x81 4) 4 (imm32 r/m32) :operand-mode :32-bit)
40 (:digit (#x83 4) 1 (simm8 r/m32) :operand-mode :32-bit)
41 (:r #x21 (r32 r/m32) :operand-mode :32-bit)
42 (:r #x23 (r/m32 r32) :operand-mode :32-bit))
43
44 ;;; ----------------------------------------------------------------
45 ;;; OR [IISR page 11-301]
46 ;;; ----------------------------------------------------------------
47
48 (def-instr or (instruction))
49
50 (def-instr orb (or)
51 (:plain #x0c (0 1) (imm8 al))
52 (:digit (#x80 1) 1 (imm8 r/m8))
53 (:r #x08 (r8 r/m8))
54 (:r #x0a (r/m8 r8)))
55
56 (def-instr orw (or)
57 (:plain #x0d (0 2) (imm16 ax) :operand-mode :16-bit)
58 (:digit (#x81 1) 2 (imm16 r/m16) :operand-mode :16-bit)
59 (:digit (#x83 1) 1 (simm8 r/m16) :operand-mode :16-bit)
60 (:r #x09 (r16 r/m16) :operand-mode :16-bit)
61 (:r #x0b (r/m16 r16) :operand-mode :16-bit))
62
63 (def-instr orl (or)
64 (:plain #x0d (0 4) (imm32 eax) :operand-mode :32-bit)
65 (:digit (#x81 1) 4 (imm32 r/m32) :operand-mode :32-bit)
66 (:digit (#x83 1) 1 (simm8 r/m32) :operand-mode :32-bit)
67 (:r #x09 (r32 r/m32) :operand-mode :32-bit)
68 (:r #x0b (r/m32 r32) :operand-mode :32-bit))
69
70 ;;; ----------------------------------------------------------------
71 ;;; XOR [IISR page 11-392]
72 ;;; ----------------------------------------------------------------
73
74 (def-instr xor (instruction))
75
76 (def-instr xorb (xor)
77 (:plain #x34 (0 1) (imm8 al))
78 (:digit (#x80 6) 1 (imm8 r/m8))
79 (:r #x30 (r8 r/m8))
80 (:r #x32 (r/m8 r8)))
81
82 (def-instr xorw (xor)
83 (:plain #x35 (0 2) (imm16 ax) :operand-mode :16-bit)
84 (:digit (#x81 6) 2 (imm16 r/m16) :operand-mode :16-bit)
85 (:digit (#x83 6) 1 (simm8 r/m16) :operand-mode :16-bit)
86 (:r #x31 (r16 r/m16) :operand-mode :16-bit)
87 (:r #x33 (r/m16 r16) :operand-mode :16-bit))
88
89 (def-instr xorl (xor)
90 (:plain #x35 (0 4) (imm32 eax) :operand-mode :32-bit)
91 (:digit (#x81 6) 4 (imm32 r/m32) :operand-mode :32-bit)
92 (:digit (#x83 6) 1 (simm8 r/m32) :operand-mode :32-bit)
93 (:r #x31 (r32 r/m32) :operand-mode :32-bit)
94 (:r #x33 (r/m32 r32) :operand-mode :32-bit))
95
96 ;;; ----------------------------------------------------------------
97 ;;; NOT [IISR page 11-299]
98 ;;; ----------------------------------------------------------------
99
100 (def-instr not (instruction))
101 (def-instr notb (not) (:digit (#xf6 2) 0 (r/m8)))
102 (def-instr notw (not) (:digit (#xf7 2) 0 (r/m16) :operand-mode :16-bit))
103 (def-instr notl (not) (:digit (#xf7 2) 0 (r/m32) :operand-mode :32-bit))
104

  ViewVC Help
Powered by ViewVC 1.1.5