| 1 | /* Table of opcodes for the Motorola M88k family.
|
|---|
| 2 | Copyright 1989, 1990, 1991, 1993, 2001 Free Software Foundation, Inc.
|
|---|
| 3 |
|
|---|
| 4 | This file is part of GDB and GAS.
|
|---|
| 5 |
|
|---|
| 6 | This program is free software; you can redistribute it and/or modify
|
|---|
| 7 | it under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 2 of the License, or
|
|---|
| 9 | (at your option) any later version.
|
|---|
| 10 |
|
|---|
| 11 | This program is distributed in the hope that it will be useful,
|
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | GNU General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with this program; if not, write to the Free Software
|
|---|
| 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|---|
| 19 |
|
|---|
| 20 | /*
|
|---|
| 21 | * Disassembler Instruction Table
|
|---|
| 22 | *
|
|---|
| 23 | * The first field of the table is the opcode field. If an opcode
|
|---|
| 24 | * is specified which has any non-opcode bits on, a system error
|
|---|
| 25 | * will occur when the system attempts the install it into the
|
|---|
| 26 | * instruction table. The second parameter is a pointer to the
|
|---|
| 27 | * instruction mnemonic. Each operand is specified by offset, width,
|
|---|
| 28 | * and type. The offset is the bit number of the least significant
|
|---|
| 29 | * bit of the operand with bit 0 being the least significant bit of
|
|---|
| 30 | * the instruction. The width is the number of bits used to specify
|
|---|
| 31 | * the operand. The type specifies the output format to be used for
|
|---|
| 32 | * the operand. The valid formats are: register, register indirect,
|
|---|
| 33 | * hex constant, and bit field specification. The last field is a
|
|---|
| 34 | * pointer to the next instruction in the linked list. These pointers
|
|---|
| 35 | * are initialized by init_disasm().
|
|---|
| 36 | *
|
|---|
| 37 | * Revision History
|
|---|
| 38 | *
|
|---|
| 39 | * Revision 1.0 11/08/85 Creation date
|
|---|
| 40 | * 1.1 02/05/86 Updated instruction mnemonic table MD
|
|---|
| 41 | * 1.2 06/16/86 Updated SIM_FLAGS for floating point
|
|---|
| 42 | * 1.3 09/20/86 Updated for new encoding
|
|---|
| 43 | * 05/11/89 R. Trawick adapted from Motorola disassembler
|
|---|
| 44 | */
|
|---|
| 45 |
|
|---|
| 46 | #include <stdio.h>
|
|---|
| 47 |
|
|---|
| 48 | /* Define the number of bits in the primary opcode field of the instruction,
|
|---|
| 49 | the destination field, the source 1 and source 2 fields. */
|
|---|
| 50 |
|
|---|
| 51 | /* Size of opcode field. */
|
|---|
| 52 | #define OP 8
|
|---|
| 53 |
|
|---|
| 54 | /* Size of destination. */
|
|---|
| 55 | #define DEST 6
|
|---|
| 56 |
|
|---|
| 57 | /* Size of source1. */
|
|---|
| 58 | #define SOURCE1 6
|
|---|
| 59 |
|
|---|
| 60 | /* Size of source2. */
|
|---|
| 61 | #define SOURCE2 6
|
|---|
| 62 |
|
|---|
| 63 | /* Number of registers. */
|
|---|
| 64 | #define REGs 32
|
|---|
| 65 |
|
|---|
| 66 | /* Type definitions. */
|
|---|
| 67 |
|
|---|
| 68 | typedef unsigned int UINT;
|
|---|
| 69 | #define WORD long
|
|---|
| 70 | #define FLAG unsigned
|
|---|
| 71 | #define STATE short
|
|---|
| 72 |
|
|---|
| 73 | /* The next four equates define the priorities that the various classes
|
|---|
| 74 | * of instructions have regarding writing results back into registers and
|
|---|
| 75 | * signalling exceptions. */
|
|---|
| 76 |
|
|---|
| 77 | /* PMEM is also defined in <sys/param.h> on Delta 88's. Sigh! */
|
|---|
| 78 | #undef PMEM
|
|---|
| 79 |
|
|---|
| 80 | /* Integer priority. */
|
|---|
| 81 | #define PINT 0
|
|---|
| 82 |
|
|---|
| 83 | /* Floating point priority. */
|
|---|
| 84 | #define PFLT 1
|
|---|
| 85 |
|
|---|
| 86 | /* Memory priority. */
|
|---|
| 87 | #define PMEM 2
|
|---|
| 88 |
|
|---|
| 89 | /* Not applicable, instruction doesn't write to regs. */
|
|---|
| 90 | #define NA 3
|
|---|
| 91 |
|
|---|
| 92 | /* Highest of these priorities. */
|
|---|
| 93 | #define HIPRI 3
|
|---|
| 94 |
|
|---|
| 95 | /* The instruction registers are an artificial mechanism to speed up
|
|---|
| 96 | * simulator execution. In the real processor, an instruction register
|
|---|
| 97 | * is 32 bits wide. In the simulator, the 32 bit instruction is kept in
|
|---|
| 98 | * a structure field called rawop, and the instruction is partially decoded,
|
|---|
| 99 | * and split into various fields and flags which make up the other fields
|
|---|
| 100 | * of the structure.
|
|---|
| 101 | * The partial decode is done when the instructions are initially loaded
|
|---|
| 102 | * into simulator memory. The simulator code memory is not an array of
|
|---|
| 103 | * 32 bit words, but is an array of instruction register structures.
|
|---|
| 104 | * Yes this wastes memory, but it executes much quicker.
|
|---|
| 105 | */
|
|---|
| 106 |
|
|---|
| 107 | struct IR_FIELDS
|
|---|
| 108 | {
|
|---|
| 109 | unsigned op:OP,
|
|---|
| 110 | dest: DEST,
|
|---|
| 111 | src1: SOURCE1,
|
|---|
| 112 | src2: SOURCE2;
|
|---|
| 113 | int ltncy,
|
|---|
| 114 | extime,
|
|---|
| 115 | /* Writeback priority. */
|
|---|
| 116 | wb_pri;
|
|---|
| 117 | /* Immediate size. */
|
|---|
| 118 | unsigned imm_flags:2,
|
|---|
| 119 | /* Register source 1 used. */
|
|---|
| 120 | rs1_used:1,
|
|---|
| 121 | /* Register source 2 used. */
|
|---|
|
|---|