/*
 * Copyright 2020 Tadashi G. Takaoka
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "table_mc68000.h"
#include "entry_mc68000.h"
#include "entry_table.h"
#include "text_mc68000.h"

namespace libasm {
namespace mc68000 {

using namespace libasm::text::mc68000;

#define E3(_opc, _name, _isz, _src, _dst, _ex1, _srcp, _dstp, _ex1p, _osz, _mask) \
    {_opc, Entry::Flags::create(_src, _dst, _ex1, _srcp, _dstp, _ex1p, _osz, _isz, _mask), _name}
#define E2(_opc, _name, _isz, _src, _dst, _srcp, _dstp, _osz, _mask) \
    E3(_opc, _name, _isz, _src, _dst, M_NONE, _srcp, _dstp, OP___, _osz, _mask)
#define A2(_opc, _name, _isz, _src, _dst, _srcp, _dstp, _osz, _mask) \
    E2(_opc, _name, _isz, _src, _dst, _srcp, _dstp, _osz, _mask)
#define E1(_opc, _name, _isz, _src, _srcp, _osz, _mask) \
    E2(_opc, _name, _isz, _src, M_NONE, _srcp, OP___, _osz, _mask)
#define E0(_opc, _name) E1(_opc, _name, ISZ_NONE, M_NONE, OP___, SZ_NONE, CF_0000)
#define X4(_opc, _name, _isz, _src, _dst, _ex1, _ex2, _srcp, _dstp, _ex1p, _osz, _mask, _pval,   \
        _pmask)                                                                                  \
    {_opc,                                                                                       \
            Entry::Flags::create(_src, _dst, _ex1, _ex2, _srcp, _dstp, _ex1p, _osz, _isz, _mask, \
                    _pval, _pmask),                                                              \
            _name}
#define X3(_opc, _name, _isz, _src, _dst, _ex1, _srcp, _dstp, _ex1p, _osz, _mask, _pval, _pmask) \
    X4(_opc, _name, _isz, _src, _dst, _ex1, M_NONE, _srcp, _dstp, _ex1p, _osz, _mask, _pval, _pmask)
#define X2(_opc, _name, _isz, _src, _dst, _srcp, _dstp, _osz, _mask, _pval, _pmask) \
    X3(_opc, _name, _isz, _src, _dst, M_NONE, _srcp, _dstp, OP___, _osz, _mask, _pval, _pmask)
#define X1(_opc, _name, _isz, _src, _srcp, _osz, _mask, _pval, _pmask) \
    X2(_opc, _name, _isz, _src, M_NONE, _srcp, OP___, _osz, _mask, _pval, _pmask)
#define X0(_opc, _name, _mask, _pval, _pmask) \
    X1(_opc, _name, ISZ_NONE, M_NONE, OP___, SZ_NONE, _mask, _pval, _pmask)
#define P3(_opc, _name, _isz, _src, _dst, _ex1, _srcp, _dstp, _ex1p, _osz, _mask, _pval) \
    X3(_opc, _name, _isz, _src, _dst, _ex1, _srcp, _dstp, _ex1p, _osz, _mask, _pval, PF_0000)
#define P2(_opc, _name, _isz, _src, _dst, _srcp, _dstp, _osz, _mask, _pval) \
    P3(_opc, _name, _isz, _src, _dst, M_NONE, _srcp, _dstp, OP___, _osz, _mask, _pval)
#define P1(_opc, _name, _isz, _src, _srcp, _osz, _mask, _pval) \
    P2(_opc, _name, _isz, _src, M_NONE, _srcp, OP___, _osz, _mask, _pval)
#define P0(_opc, _name, _pval) P1(_opc, _name, ISZ_NONE, M_NONE, OP___, SZ_NONE, CF_0000, _pval)

// clang-format off
constexpr Entry MC68000_TABLE[] PROGMEM = {
    E2(0000074, TEXT_ORI,   ISZ_NONE, M_IMDAT, M_CCR,   OP___, OP___, SZ_BYTE, CF_0000),
    E2(0000174, TEXT_ORI,   ISZ_NONE, M_IMDAT, M_SR,    OP___, OP___, SZ_WORD, CF_0000),
    E2(0000000, TEXT_ORI,   ISZ_DATA, M_IMDAT, M_WDATA, OP___, OP_10, SZ_DATA, CF_0377),
    E2(0001074, TEXT_ANDI,  ISZ_NONE, M_IMDAT, M_CCR,   OP___, OP___, SZ_BYTE, CF_0000),
    E2(0001174, TEXT_ANDI,  ISZ_NONE, M_IMDAT, M_SR,    OP___, OP___, SZ_WORD, CF_0000),
    E2(0001000, TEXT_ANDI,  ISZ_DATA, M_IMDAT, M_WDATA, OP___, OP_10, SZ_DATA, CF_0377),
    E2(0110300, TEXT_SUBA,  ISZ_DATA, M_RADDR, M_AREG,  OP_10, OP__3, SZ_ADR8, CF_7477),
    A2(0110374, TEXT_SUBI,  ISZ_DATA, M_IMDAT, M_AREG,  OP___, OP__3, SZ_ADR8, CF_7400),
    E2(0002000, TEXT_SUBI,  ISZ_DATA, M_IMDAT, M_WDATA, OP___, OP_10, SZ_DATA, CF_0377),
    E2(0150300, TEXT_ADDA,  ISZ_DATA, M_RADDR, M_AREG,  OP_10, OP__3, SZ_ADR8, CF_7477),
    A2(0150374, TEXT_ADDI,  ISZ_DATA, M_IMDAT, M_AREG,  OP___, OP__3, SZ_ADR8, CF_7400),
    E2(0003000, TEXT_ADDI,  ISZ_DATA, M_IMDAT, M_WDATA, OP___, OP_10, SZ_DATA, CF_0377),
    E2(0005074, TEXT_EORI,  ISZ_NONE, M_IMDAT, M_CCR,   OP___, OP___, SZ_BYTE, CF_0000),
    E2(0005174, TEXT_EORI,  ISZ_NONE, M_IMDAT, M_SR,    OP___, OP___, SZ_WORD, CF_0000),
    E2(0005000, TEXT_EORI,  ISZ_DATA, M_IMDAT, M_WDATA, OP___, OP_10, SZ_DATA, CF_0377),
    E2(0130300, TEXT_CMPA,  ISZ_DATA, M_RADDR, M_AREG,  OP_10, OP__3, SZ_ADR8, CF_7477),
    A2(0130374, TEXT_CMPI,  ISZ_DATA, M_IMDAT, M_AREG,  OP___, OP__3, SZ_ADR8, CF_7400),
    E2(0006000, TEXT_CMPI,  ISZ_DATA, M_IMDAT, M_WDATA, OP___, OP_10, SZ_DATA, CF_0377),
    E2(0004000, TEXT_BTST,  ISZ_FIXD, M_IMBIT, M_DREG,  OP___, OP__0, SZ_LONG, CF_0007),
    E2(0004000, TEXT_BTST,  ISZ_FIXD, M_IMBIT, M_RMEM,  OP___, OP_10, SZ_BYTE, CF_0077),
    E2(0004100, TEXT_BCHG,  ISZ_FIXD, M_IMBIT, M_DREG,  OP___, OP__0, SZ_LONG, CF_0007),
    E2(0004100, TEXT_BCHG,  ISZ_FIXD, M_IMBIT, M_WMEM,  OP___, OP_10, SZ_BYTE, CF_0077),
    E2(0004200, TEXT_BCLR,  ISZ_FIXD, M_IMBIT, M_DREG,  OP___, OP__0, SZ_LONG, CF_0007),
    E2(0004200, TEXT_BCLR,  ISZ_FIXD, M_IMBIT, M_WMEM,  OP___, OP_10, SZ_BYTE, CF_0077),
    E2(0004300, TEXT_BSET,  ISZ_FIXD, M_IMBIT, M_DREG,  OP___, OP__0, SZ_LONG, CF_0007),
    E2(0004300, TEXT_BSET,  ISZ_FIXD, M_IMBIT, M_WMEM,  OP___, OP_10, SZ_BYTE, CF_0077),
    E2(0000410, TEXT_MOVEP, ISZ_DATA, M_DISP,  M_DREG,  OP__0, OP__3, SZ_ADDR, CF_7107),
    E2(0000610, TEXT_MOVEP, ISZ_DATA, M_DREG,  M_DISP,  OP__3, OP__0, SZ_ADDR, CF_7107),
    E2(0000400, TEXT_BTST,  ISZ_FIXD, M_DREG,  M_DREG,  OP__3, OP__0, SZ_LONG, CF_7007),
    E2(0000400, TEXT_BTST,  ISZ_FIXD, M_DREG,  M_RMEM,  OP__3, OP_10, SZ_BYTE, CF_7077),
    E2(0000500, TEXT_BCHG,  ISZ_FIXD, M_DREG,  M_DREG,  OP__3, OP__0, SZ_LONG, CF_7007),
    E2(0000500, TEXT_BCHG,  ISZ_FIXD, M_DREG,  M_WMEM,  OP__3, OP_10, SZ_BYTE, CF_7077),
    E2(0000600, TEXT_BCLR,  ISZ_FIXD, M_DREG,  M_DREG,  OP__3, OP__0, SZ_LONG, CF_7007),
    E2(0000600, TEXT_BCLR,  ISZ_FIXD, M_DREG,  M_WMEM,  OP__3, OP_10, SZ_BYTE, CF_7077),
    E2(0000700, TEXT_BSET,  ISZ_FIXD, M_DREG,  M_DREG,  OP__3, OP__0, SZ_LONG, CF_7007),
    E2(0000700, TEXT_BSET,  ISZ_FIXD, M_DREG,  M_WMEM,  OP__3, OP_10, SZ_BYTE, CF_7077),
    E2(0020100, TEXT_MOVEA, ISZ_LONG, M_RADDR, M_AREG,  OP_10, OP__3, SZ_LONG, CF_7077),
    E2(0030100, TEXT_MOVEA, ISZ_WORD, M_RADDR, M_AREG,  OP_10, OP__3, SZ_WORD, CF_7077),
    E2(0030100, TEXT_MOVEA, ISZ_FIXD, M_RADDR, M_AREG,  OP_10, OP__3, SZ_WORD, CF_7077),
    A2(0020100, TEXT_MOVE,  ISZ_LONG, M_RADDR, M_AREG,  OP_10, OP__3, SZ_LONG, CF_7077),
    A2(0030100, TEXT_MOVE,  ISZ_WORD, M_RADDR, M_AREG,  OP_10, OP__3, SZ_WORD, CF_7077),
    E2(0042300, TEXT_MOVE,  ISZ_FIXD, M_RDATA, M_CCR,   OP_10, OP___, SZ_WORD, CF_0077),
    E2(0040300, TEXT_MOVE,  ISZ_FIXD, M_SR,    M_WDATA, OP___, OP_10, SZ_WORD, CF_0077),
    E2(0043300, TEXT_MOVE,  ISZ_FIXD, M_RDATA, M_SR,    OP_10, OP___, SZ_WORD, CF_0077),
    E2(0010000, TEXT_MOVE,  ISZ_BYTE, M_RDATA, M_WDATA, OP_10, OP_23, SZ_BYTE, CF_7777),
    E2(0020000, TEXT_MOVE,  ISZ_LONG, M_RADDR, M_WDATA, OP_10, OP_23, SZ_LONG, CF_7777),
    E2(0030000, TEXT_MOVE,  ISZ_WORD, M_RADDR, M_WDATA, OP_10, OP_23, SZ_WORD, CF_7777),
    E1(0040000, TEXT_NEGX,  ISZ_DATA, M_WDATA, OP_10, SZ_DATA, CF_0377),
    E1(0041000, TEXT_CLR,   ISZ_DATA, M_WDATA, OP_10, SZ_DATA, CF_0377),
    E1(0042000, TEXT_NEG,   ISZ_DATA, M_WDATA, OP_10, SZ_DATA, CF_0377),
    E1(0043000, TEXT_NOT,   ISZ_DATA, M_WDATA, OP_10, SZ_DATA, CF_0377),
    E1(0044200, TEXT_EXT,   ISZ_DATA, M_DREG,  OP__0, SZ_ADDR, CF_0107),
    E1(0044000, TEXT_NBCD,  ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0044100, TEXT_SWAP,  ISZ_NONE, M_DREG,  OP__0, SZ_LONG, CF_0007),
    E1(0044100, TEXT_PEA,   ISZ_NONE, M_JADDR, OP_10, SZ_LONG, CF_0077),
    E0(0045374, TEXT_ILLEGAL),
    E1(0045300, TEXT_TAS,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0045000, TEXT_TST,   ISZ_DATA, M_WDATA, OP_10, SZ_DATA, CF_0377),
    E1(0047100, TEXT_TRAP,  ISZ_NONE, M_IMVEC, OP___, SZ_NONE, CF_0017),
    E2(0047120, TEXT_LINK,  ISZ_NONE, M_AREG,  M_IMDSP, OP__0, OP___, SZ_WORD, CF_0007),
    E1(0047130, TEXT_UNLK,  ISZ_NONE, M_AREG,  OP__0, SZ_NONE, CF_0007),
    E2(0047140, TEXT_MOVE,  ISZ_NONE, M_AREG,  M_USP,   OP__0, OP___, SZ_LONG, CF_0007),
    E2(0047150, TEXT_MOVE,  ISZ_NONE, M_USP,   M_AREG,  OP___, OP__0, SZ_LONG, CF_0007),
    E0(0047160, TEXT_RESET),
    E0(0047161, TEXT_NOP),
    E1(0047162, TEXT_STOP,  ISZ_NONE, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E0(0047163, TEXT_RTE),
    E0(0047165, TEXT_RTS),
    E0(0047166, TEXT_TRAPV),
    E0(0047167, TEXT_RTR),
    E1(0047200, TEXT_JSR,   ISZ_NONE, M_JADDR, OP_10, SZ_WORD, CF_0077),
    E1(0047300, TEXT_JMP,   ISZ_NONE, M_JADDR, OP_10, SZ_WORD, CF_0077),
    E2(0044200, TEXT_MOVEM, ISZ_DATA, M_MULT,  M_DADDR, OP___, OP_10, SZ_ADDR, CF_0177),
    E2(0046200, TEXT_MOVEM, ISZ_DATA, M_IADDR, M_MULT,  OP_10, OP___, SZ_ADDR, CF_0177),
    E2(0040700, TEXT_LEA,   ISZ_NONE, M_JADDR, M_AREG,  OP_10, OP__3, SZ_LONG, CF_7077),
    E2(0040600, TEXT_CHK,   ISZ_WORD, M_RDATA, M_DREG,  OP_10, OP__3, SZ_WORD, CF_7077),
    E2(0050310, TEXT_DBT,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0050710, TEXT_DBRA,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0050710, TEXT_DBF,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0051310, TEXT_DBHI,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0051710, TEXT_DBLS,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0052310, TEXT_DBCC,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0052310, TEXT_DBHS,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0052710, TEXT_DBCS,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0052710, TEXT_DBLO,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0053310, TEXT_DBNE,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0053710, TEXT_DBEQ,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0054310, TEXT_DBVC,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0054710, TEXT_DBVS,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0055310, TEXT_DBPL,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0055710, TEXT_DBMI,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0056310, TEXT_DBGE,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0056710, TEXT_DBLT,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0057310, TEXT_DBGT,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E2(0057710, TEXT_DBLE,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007),
    E1(0050300, TEXT_ST,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0050700, TEXT_SF,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0051300, TEXT_SHI,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0051700, TEXT_SLS,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0052300, TEXT_SCC,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0052300, TEXT_SHS,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0052700, TEXT_SCS,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0052700, TEXT_SLO,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0053300, TEXT_SNE,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0053700, TEXT_SEQ,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0054300, TEXT_SVC,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0054700, TEXT_SVS,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0055300, TEXT_SPL,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0055700, TEXT_SMI,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0056300, TEXT_SGE,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0056700, TEXT_SLT,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0057300, TEXT_SGT,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E1(0057700, TEXT_SLE,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077),
    E2(0050000, TEXT_ADDQ,  ISZ_DATA, M_IM3,   M_WADDR, OP__3, OP_10, SZ_DATA, CF_7377),
    E2(0050400, TEXT_SUBQ,  ISZ_DATA, M_IM3,   M_WADDR, OP__3, OP_10, SZ_DATA, CF_7377),
    E1(0060000, TEXT_BRA,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0060000, TEXT_BT,    ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0060400, TEXT_BSR,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0061000, TEXT_BHI,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0061400, TEXT_BLS,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0062000, TEXT_BCC,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0062000, TEXT_BHS,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0062400, TEXT_BCS,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0062400, TEXT_BLO,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0063000, TEXT_BNE,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0063400, TEXT_BEQ,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0064000, TEXT_BVC,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0064400, TEXT_BVS,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0065000, TEXT_BPL,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0065400, TEXT_BMI,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0066000, TEXT_BGE,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0066400, TEXT_BLT,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0067000, TEXT_BGT,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E1(0067400, TEXT_BLE,   ISZ_NONE, M_REL8,  OP___, SZ_BYTE, CF_0377),
    E2(0070000, TEXT_MOVEQ, ISZ_NONE, M_IM8,   M_DREG,  OP___, OP__3, SZ_LONG, CF_7377),
    E2(0100300, TEXT_DIVU,  ISZ_DATA, M_RDATA, M_DREG,  OP_10, OP__3, SZ_WORD, CF_7077),
    E2(0100700, TEXT_DIVS,  ISZ_DATA, M_RDATA, M_DREG,  OP_10, OP__3, SZ_WORD, CF_7077),
    E2(0100000, TEXT_OR,    ISZ_DATA, M_RDATA, M_DREG,  OP_10, OP__3, SZ_DATA, CF_7377),
    E2(0100400, TEXT_SBCD,  ISZ_NONE, M_DREG,  M_DREG,  OP__0, OP__3, SZ_BYTE, CF_7007),
    E2(0100410, TEXT_SBCD,  ISZ_NONE, M_PDEC,  M_PDEC,  OP__0, OP__3, SZ_BYTE, CF_7007),
    E2(0100400, TEXT_OR,    ISZ_DATA, M_DREG,  M_WMEM,  OP__3, OP_10, SZ_DATA, CF_7377),
    E2(0110400, TEXT_SUBX,  ISZ_DATA, M_DREG,  M_DREG,  OP__0, OP__3, SZ_DATA, CF_7307),
    E2(0110410, TEXT_SUBX,  ISZ_DATA, M_PDEC,  M_PDEC,  OP__0, OP__3, SZ_DATA, CF_7307),
    A2(0110300, TEXT_SUB,   ISZ_DATA, M_RADDR, M_AREG,  OP_10, OP__3, SZ_ADR8, CF_7477),
    E2(0110000, TEXT_SUB,   ISZ_DATA, M_RADDR, M_DREG,  OP_10, OP__3, SZ_DATA, CF_7377),
    E2(0110400, TEXT_SUB,   ISZ_DATA, M_DREG,  M_WMEM,  OP__3, OP_10, SZ_DATA, CF_7377),
    E2(0130000, TEXT_CMP,   ISZ_DATA, M_RADDR, M_DREG,  OP_10, OP__3, SZ_DATA, CF_7377),
    E2(0130410, TEXT_CMPM,  ISZ_DATA, M_PINC,  M_PINC,  OP__0, OP__3, SZ_DATA, CF_7307),
    E2(0130400, TEXT_EOR,   ISZ_DATA, M_DREG,  M_WDATA, OP__3, OP_10, SZ_DATA, CF_7377),
    E2(0140300, TEXT_MULU,  ISZ_DATA, M_RDATA, M_DREG,  OP_10, OP__3, SZ_WORD, CF_7077),
    E2(0140700, TEXT_MULS,  ISZ_DATA, M_RDATA, M_DREG,  OP_10, OP__3, SZ_WORD, CF_7077),
    E2(0140000, TEXT_AND,   ISZ_DATA, M_RDATA, M_DREG,  OP_10, OP__3, SZ_DATA, CF_7377),
    E2(0140400, TEXT_ABCD,  ISZ_NONE, M_DREG,  M_DREG,  OP__0, OP__3, SZ_BYTE, CF_7007),
    E2(0140410, TEXT_ABCD,  ISZ_NONE, M_PDEC,  M_PDEC,  OP__0, OP__3, SZ_BYTE, CF_7007),
    E2(0140500, TEXT_EXG,   ISZ_NONE, M_DREG,  M_DREG,  OP__3, OP__0, SZ_LONG, CF_7007),
    E2(0140510, TEXT_EXG,   ISZ_NONE, M_AREG,  M_AREG,  OP__3, OP__0, SZ_LONG, CF_7007),
    E2(0140610, TEXT_EXG,   ISZ_NONE, M_DREG,  M_AREG,  OP__3, OP__0, SZ_LONG, CF_7007),
    E2(0140610, TEXT_EXG,   ISZ_NONE, M_AREG,  M_DREG,  OP__0, OP__3, SZ_LONG, CF_7007),
    E2(0140400, TEXT_AND,   ISZ_DATA, M_DREG,  M_WMEM,  OP__3, OP_10, SZ_DATA, CF_7377),
    E2(0150400, TEXT_ADDX,  ISZ_DATA, M_DREG,  M_DREG,  OP__0, OP__3, SZ_DATA, CF_7307),
    E2(0150410, TEXT_ADDX,  ISZ_DATA, M_PDEC,  M_PDEC,  OP__0, OP__3, SZ_DATA, CF_7307),
    A2(0150300, TEXT_ADD,   ISZ_DATA, M_RADDR, M_AREG,  OP_10, OP__3, SZ_ADR8, CF_7477),
    E2(0150000, TEXT_ADD,   ISZ_DATA, M_RADDR, M_DREG,  OP_10, OP__3, SZ_DATA, CF_7377),
    E2(0150400, TEXT_ADD,   ISZ_DATA, M_DREG,  M_WMEM,  OP__3, OP_10, SZ_DATA, CF_7377),
    E1(0160300, TEXT_ASR,   ISZ_DATA, M_WMEM,  OP_10, SZ_WORD, CF_0077),
    E1(0160700, TEXT_ASL,   ISZ_DATA, M_WMEM,  OP_10, SZ_WORD, CF_0077),
    E1(0161300, TEXT_LSR,   ISZ_DATA, M_WMEM,  OP_10, SZ_WORD, CF_0077),
    E1(0161700, TEXT_LSL,   ISZ_DATA, M_WMEM,  OP_10, SZ_WORD, CF_0077),
    E1(0162300, TEXT_ROXR,  ISZ_DATA, M_WMEM,  OP_10, SZ_WORD, CF_0077),
    E1(0162700, TEXT_ROXL,  ISZ_DATA, M_WMEM,  OP_10, SZ_WORD, CF_0077),
    E1(0163300, TEXT_ROR,   ISZ_DATA, M_WMEM,  OP_10, SZ_WORD, CF_0077),
    E1(0163700, TEXT_ROL,   ISZ_DATA, M_WMEM,  OP_10, SZ_WORD, CF_0077),
    E2(0160000, TEXT_ASR,   ISZ_DATA, M_IM3,   M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160040, TEXT_ASR,   ISZ_DATA, M_DREG,  M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160400, TEXT_ASL,   ISZ_DATA, M_IM3,   M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160440, TEXT_ASL,   ISZ_DATA, M_DREG,  M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160010, TEXT_LSR,   ISZ_DATA, M_IM3,   M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160050, TEXT_LSR,   ISZ_DATA, M_DREG,  M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160410, TEXT_LSL,   ISZ_DATA, M_IM3,   M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160450, TEXT_LSL,   ISZ_DATA, M_DREG,  M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160020, TEXT_ROXR,  ISZ_DATA, M_IM3,   M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160060, TEXT_ROXR,  ISZ_DATA, M_DREG,  M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160420, TEXT_ROXL,  ISZ_DATA, M_IM3,   M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160460, TEXT_ROXL,  ISZ_DATA, M_DREG,  M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160030, TEXT_ROR,   ISZ_DATA, M_IM3,   M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160070, TEXT_ROR,   ISZ_DATA, M_DREG,  M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160430, TEXT_ROL,   ISZ_DATA, M_IM3,   M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
    E2(0160470, TEXT_ROL,   ISZ_DATA, M_DREG,  M_DREG,  OP__3, OP__0, SZ_DATA, CF_7307),
};

constexpr uint8_t MC68000_INDEX[] PROGMEM = {
    152,  // TEXT_ABCD
    153,  // TEXT_ABCD
    161,  // TEXT_ADD
    162,  // TEXT_ADD
    163,  // TEXT_ADD
      9,  // TEXT_ADDA
     10,  // TEXT_ADDI
     11,  // TEXT_ADDI
    113,  // TEXT_ADDQ
    159,  // TEXT_ADDX
    160,  // TEXT_ADDX
    151,  // TEXT_AND
    158,  // TEXT_AND
      3,  // TEXT_ANDI
      4,  // TEXT_ANDI
      5,  // TEXT_ANDI
    165,  // TEXT_ASL
    174,  // TEXT_ASL
    175,  // TEXT_ASL
    164,  // TEXT_ASR
    172,  // TEXT_ASR
    173,  // TEXT_ASR
    120,  // TEXT_BCC
     20,  // TEXT_BCHG
     21,  // TEXT_BCHG
     30,  // TEXT_BCHG
     31,  // TEXT_BCHG
     22,  // TEXT_BCLR
     23,  // TEXT_BCLR
     32,  // TEXT_BCLR
     33,  // TEXT_BCLR
    122,  // TEXT_BCS
    125,  // TEXT_BEQ
    130,  // TEXT_BGE
    132,  // TEXT_BGT
    118,  // TEXT_BHI
    121,  // TEXT_BHS
    133,  // TEXT_BLE
    123,  // TEXT_BLO
    119,  // TEXT_BLS
    131,  // TEXT_BLT
    129,  // TEXT_BMI
    124,  // TEXT_BNE
    128,  // TEXT_BPL
    115,  // TEXT_BRA
     24,  // TEXT_BSET
     25,  // TEXT_BSET
     34,  // TEXT_BSET
     35,  // TEXT_BSET
    117,  // TEXT_BSR
    116,  // TEXT_BT
     18,  // TEXT_BTST
     19,  // TEXT_BTST
     28,  // TEXT_BTST
     29,  // TEXT_BTST
    126,  // TEXT_BVC
    127,  // TEXT_BVS
     75,  // TEXT_CHK
     48,  // TEXT_CLR
    146,  // TEXT_CMP
     15,  // TEXT_CMPA
     16,  // TEXT_CMPI
     17,  // TEXT_CMPI
    147,  // TEXT_CMPM
     81,  // TEXT_DBCC
     83,  // TEXT_DBCS
     86,  // TEXT_DBEQ
     78,  // TEXT_DBF
     91,  // TEXT_DBGE
     93,  // TEXT_DBGT
     79,  // TEXT_DBHI
     82,  // TEXT_DBHS
     94,  // TEXT_DBLE
     84,  // TEXT_DBLO
     80,  // TEXT_DBLS
     92,  // TEXT_DBLT
     90,  // TEXT_DBMI
     85,  // TEXT_DBNE
     89,  // TEXT_DBPL
     77,  // TEXT_DBRA
     76,  // TEXT_DBT
     87,  // TEXT_DBVC
     88,  // TEXT_DBVS
    136,  // TEXT_DIVS
    135,  // TEXT_DIVU
    148,  // TEXT_EOR
     12,  // TEXT_EORI
     13,  // TEXT_EORI
     14,  // TEXT_EORI
    154,  // TEXT_EXG
    155,  // TEXT_EXG
    156,  // TEXT_EXG
    157,  // TEXT_EXG
     51,  // TEXT_EXT
     55,  // TEXT_ILLEGAL
     71,  // TEXT_JMP
     70,  // TEXT_JSR
     74,  // TEXT_LEA
     59,  // TEXT_LINK
    167,  // TEXT_LSL
    178,  // TEXT_LSL
    179,  // TEXT_LSL
    166,  // TEXT_LSR
    176,  // TEXT_LSR
    177,  // TEXT_LSR
     39,  // TEXT_MOVE
     40,  // TEXT_MOVE
     41,  // TEXT_MOVE
     42,  // TEXT_MOVE
     43,  // TEXT_MOVE
     44,  // TEXT_MOVE
     45,  // TEXT_MOVE
     46,  // TEXT_MOVE
     61,  // TEXT_MOVE
     62,  // TEXT_MOVE
     36,  // TEXT_MOVEA
     37,  // TEXT_MOVEA
     38,  // TEXT_MOVEA
     72,  // TEXT_MOVEM
     73,  // TEXT_MOVEM
     26,  // TEXT_MOVEP
     27,  // TEXT_MOVEP
    134,  // TEXT_MOVEQ
    150,  // TEXT_MULS
    149,  // TEXT_MULU
     52,  // TEXT_NBCD
     49,  // TEXT_NEG
     47,  // TEXT_NEGX
     64,  // TEXT_NOP
     50,  // TEXT_NOT
    137,  // TEXT_OR
    140,  // TEXT_OR
      0,  // TEXT_ORI
      1,  // TEXT_ORI
      2,  // TEXT_ORI
     54,  // TEXT_PEA
     63,  // TEXT_RESET
    171,  // TEXT_ROL
    186,  // TEXT_ROL
    187,  // TEXT_ROL
    170,  // TEXT_ROR
    184,  // TEXT_ROR
    185,  // TEXT_ROR
    169,  // TEXT_ROXL
    182,  // TEXT_ROXL
    183,  // TEXT_ROXL
    168,  // TEXT_ROXR
    180,  // TEXT_ROXR
    181,  // TEXT_ROXR
     66,  // TEXT_RTE
     69,  // TEXT_RTR
     67,  // TEXT_RTS
    138,  // TEXT_SBCD
    139,  // TEXT_SBCD
     99,  // TEXT_SCC
    101,  // TEXT_SCS
    104,  // TEXT_SEQ
     96,  // TEXT_SF
    109,  // TEXT_SGE
    111,  // TEXT_SGT
     97,  // TEXT_SHI
    100,  // TEXT_SHS
    112,  // TEXT_SLE
    102,  // TEXT_SLO
     98,  // TEXT_SLS
    110,  // TEXT_SLT
    108,  // TEXT_SMI
    103,  // TEXT_SNE
    107,  // TEXT_SPL
     95,  // TEXT_ST
     65,  // TEXT_STOP
    143,  // TEXT_SUB
    144,  // TEXT_SUB
    145,  // TEXT_SUB
      6,  // TEXT_SUBA
      7,  // TEXT_SUBI
      8,  // TEXT_SUBI
    114,  // TEXT_SUBQ
    141,  // TEXT_SUBX
    142,  // TEXT_SUBX
    105,  // TEXT_SVC
    106,  // TEXT_SVS
     53,  // TEXT_SWAP
     56,  // TEXT_TAS
     58,  // TEXT_TRAP
     68,  // TEXT_TRAPV
     57,  // TEXT_TST
     60,  // TEXT_UNLK
};

constexpr Entry MC68010_TABLE[] PROGMEM = {
    E1(0044110, TEXT_BKPT,  ISZ_NONE, M_IM3,   OP__0, SZ_NONE, CF_0007),
    E2(0041300, TEXT_MOVE,  ISZ_FIXD, M_CCR,   M_WDATA, OP___, OP_10, SZ_WORD, CF_0077),
    E1(0047164, TEXT_RTD,   ISZ_NONE, M_IMDAT, OP___, SZ_WORD, CF_0000),
    X2(0047172, TEXT_MOVEC, ISZ_NONE, M_CREG,  M_GREG,  EX_RC, EX_GR, SZ_LONG, CF_0000, 0x0000, PF_FFFF),
    X2(0047173, TEXT_MOVEC, ISZ_NONE, M_GREG,  M_CREG,  EX_GR, EX_RC, SZ_LONG, CF_0000, 0x0000, PF_FFFF),
    X2(0007000, TEXT_MOVES, ISZ_DATA, M_WMEM,  M_GREG,  OP_10, EX_GR, SZ_DATA, CF_0377, 0x0000, PF_F000),
    X2(0007000, TEXT_MOVES, ISZ_DATA, M_GREG,  M_WMEM,  EX_GR, OP_10, SZ_DATA, CF_0377, 0x0800, PF_F000),
};

constexpr uint8_t MC68010_INDEX[] PROGMEM = {
      0,  // TEXT_BKPT
      1,  // TEXT_MOVE
      3,  // TEXT_MOVEC
      4,  // TEXT_MOVEC
      5,  // TEXT_MOVES
      6,  // TEXT_MOVES
      2,  // TEXT_RTD
};

constexpr Entry MC68020_TABLE[] PROGMEM = {
    X2(0164300, TEXT_BFTST,  ISZ_NONE, M_BITFR, M_BITOW, OP_10, EX_OW, SZ_NONE, CF_0077, 0x0000, PF_0FFF),
    X2(0165300, TEXT_BFCHG,  ISZ_NONE, M_BITFW, M_BITOW, OP_10, EX_OW, SZ_NONE, CF_0077, 0x0000, PF_0FFF),
    X2(0166300, TEXT_BFCLR,  ISZ_NONE, M_BITFW, M_BITOW, OP_10, EX_OW, SZ_NONE, CF_0077, 0x0000, PF_0FFF),
    X2(0167300, TEXT_BFSET,  ISZ_NONE, M_BITFW, M_BITOW, OP_10, EX_OW, SZ_NONE, CF_0077, 0x0000, PF_0FFF),
    X3(0164700, TEXT_BFEXTU, ISZ_NONE, M_BITFR, M_BITOW, M_DREG,  OP_10, EX_OW, EX_DR, SZ_NONE, CF_0077, 0x0000, PF_7FFF),
    X3(0165700, TEXT_BFEXTS, ISZ_NONE, M_BITFR, M_BITOW, M_DREG,  OP_10, EX_OW, EX_DR, SZ_NONE, CF_0077, 0x0000, PF_7FFF),
    X3(0166700, TEXT_BFFFO,  ISZ_NONE, M_BITFR, M_BITOW, M_DREG,  OP_10, EX_OW, EX_DR, SZ_NONE, CF_0077, 0x0000, PF_7FFF),
    X3(0167700, TEXT_BFINS,  ISZ_NONE, M_DREG,  M_BITFW, M_BITOW, EX_DR, OP_10, EX_OW, SZ_NONE, CF_0077, 0x0000, PF_7FFF),
    X3(0004300, TEXT_CAS,    ISZ_DATA, M_DREG,  M_DREG,  M_WMEM,  EX_DC,  EX_DU,  OP_10, SZ_CAS1, CF_3077, 0x0000, PF_01C7),
    X3(0004374, TEXT_CAS2,   ISZ_DATA, M_DPAIR, M_DPAIR, M_PPAIR, EX_DCP, EX_DUP, EX_GR, SZ_CAS2, CF_3000, 0x0000, PF_F1C7),
    E2(0040400, TEXT_CHK,    ISZ_LONG, M_RDATA, M_DREG,  OP_10, OP__3, SZ_LONG, CF_7077),
    X2(0000300, TEXT_CHK2,   ISZ_DATA, M_JADDR, M_GREG,  OP_10, EX_GR, SZ_DATH, CF_3077, 0x0800, PF_F000),
    X2(0000300, TEXT_CMP2,   ISZ_DATA, M_JADDR, M_GREG,  OP_10, EX_GR, SZ_DATH, CF_3077, 0x0000, PF_F000),
    X2(0046100, TEXT_DIVS,   ISZ_LONG, M_RDATA, M_DPAIR, OP_10, EX_QR, SZ_LONG, CF_0077, 0x0C00, PF_7007),
    X2(0046100, TEXT_DIVS,   ISZ_LONG, M_RDATA, M_DREG,  OP_10, EX_QQ, SZ_LONG, CF_0077, 0x0800, PF_7007),
    X2(0046100, TEXT_DIVSL,  ISZ_LONG, M_RDATA, M_DPAIR, OP_10, EX_QR, SZ_LONG, CF_0077, 0x0800, PF_7007),
    X2(0046100, TEXT_DIVU,   ISZ_LONG, M_RDATA, M_DPAIR, OP_10, EX_QR, SZ_LONG, CF_0077, 0x0400, PF_7007),
    X2(0046100, TEXT_DIVU,   ISZ_LONG, M_RDATA, M_DREG,  OP_10, EX_QQ, SZ_LONG, CF_0077, 0x0000, PF_7007),
    X2(0046100, TEXT_DIVUL,  ISZ_LONG, M_RDATA, M_DPAIR, OP_10, EX_QR, SZ_LONG, CF_0077, 0x0000, PF_7007),
    E2(0044010, TEXT_LINK,   ISZ_LONG, M_AREG,  M_IMDAT, OP__0, OP___, SZ_LONG, CF_0007),
    X2(0046000, TEXT_MULS,   ISZ_LONG, M_RDATA, M_DPAIR, OP_10, EX_QR, SZ_LONG, CF_0077, 0x0C00, PF_7007),
    X2(0046000, TEXT_MULS,   ISZ_LONG, M_RDATA, M_DREG,  OP_10, EX_DR, SZ_LONG, CF_0077, 0x0800, PF_7007),
    X2(0046000, TEXT_MULU,   ISZ_LONG, M_RDATA, M_DPAIR, OP_10, EX_QR, SZ_LONG, CF_0077, 0x0400, PF_7007),
    X2(0046000, TEXT_MULU,   ISZ_LONG, M_RDATA, M_DREG,  OP_10, EX_DR, SZ_LONG, CF_0077, 0x0000, PF_7007),
    E3(0100500, TEXT_PACK,   ISZ_NONE, M_DREG,  M_DREG,  M_IMDAT, OP__0, OP__3, OP___, SZ_WORD, CF_7007),
    E3(0100510, TEXT_PACK,   ISZ_NONE, M_PDEC,  M_PDEC,  M_IMDAT, OP__0, OP__3, OP___, SZ_WORD, CF_7007),
    E1(0052373, TEXT_TRAPCC, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0052773, TEXT_TRAPCS, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0053773, TEXT_TRAPEQ, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0050773, TEXT_TRAPF,  ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0056373, TEXT_TRAPGE, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0057373, TEXT_TRAPGT, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0051373, TEXT_TRAPHI, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0052373, TEXT_TRAPHS, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0057773, TEXT_TRAPLE, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0052773, TEXT_TRAPLO, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0051773, TEXT_TRAPLS, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0056773, TEXT_TRAPLT, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0055773, TEXT_TRAPMI, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0053373, TEXT_TRAPNE, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0055373, TEXT_TRAPPL, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0050373, TEXT_TRAPT,  ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0054373, TEXT_TRAPVC, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0054773, TEXT_TRAPVS, ISZ_LONG, M_IMDAT, OP___, SZ_LONG, CF_0000),
    E1(0052372, TEXT_TRAPCC, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0052772, TEXT_TRAPCS, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0053772, TEXT_TRAPEQ, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0050772, TEXT_TRAPF,  ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0056372, TEXT_TRAPGE, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0057372, TEXT_TRAPGT, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0051372, TEXT_TRAPHI, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0052372, TEXT_TRAPHS, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0057772, TEXT_TRAPLE, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0052772, TEXT_TRAPLO, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0051772, TEXT_TRAPLS, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0056772, TEXT_TRAPLT, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0055772, TEXT_TRAPMI, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0053372, TEXT_TRAPNE, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0055372, TEXT_TRAPPL, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0050372, TEXT_TRAPT,  ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0054372, TEXT_TRAPVC, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E1(0054772, TEXT_TRAPVS, ISZ_WORD, M_IMDAT, OP___, SZ_WORD, CF_0000),
    E0(0052374, TEXT_TRAPCC),
    E0(0052774, TEXT_TRAPCS),
    E0(0053774, TEXT_TRAPEQ),
    E0(0050774, TEXT_TRAPF),
    E0(0056374, TEXT_TRAPGE),
    E0(0057374, TEXT_TRAPGT),
    E0(0051374, TEXT_TRAPHI),
    E0(0052374, TEXT_TRAPHS),
    E0(0057774, TEXT_TRAPLE),
    E0(0052774, TEXT_TRAPLO),
    E0(0051774, TEXT_TRAPLS),
    E0(0056774, TEXT_TRAPLT),
    E0(0055774, TEXT_TRAPMI),
    E0(0053374, TEXT_TRAPNE),
    E0(0055374, TEXT_TRAPPL),
    E0(0050374, TEXT_TRAPT),
    E0(0054374, TEXT_TRAPVC),
    E0(0054774, TEXT_TRAPVS),
    E3(0100600, TEXT_UNPK,   ISZ_NONE, M_DREG,  M_DREG,  M_IMDAT, OP__0, OP__3, OP___, SZ_WORD, CF_7007),
    E3(0100610, TEXT_UNPK,   ISZ_NONE, M_PDEC,  M_PDEC,  M_IMDAT, OP__0, OP__3, OP___, SZ_WORD, CF_7007),
};

constexpr uint8_t MC68020_INDEX[] PROGMEM = {
      1,  // TEXT_BFCHG
      2,  // TEXT_BFCLR
      5,  // TEXT_BFEXTS
      4,  // TEXT_BFEXTU
      6,  // TEXT_BFFFO
      7,  // TEXT_BFINS
      3,  // TEXT_BFSET
      0,  // TEXT_BFTST
      8,  // TEXT_CAS
      9,  // TEXT_CAS2
     10,  // TEXT_CHK
     11,  // TEXT_CHK2
     12,  // TEXT_CMP2
     13,  // TEXT_DIVS
     14,  // TEXT_DIVS
     15,  // TEXT_DIVSL
     16,  // TEXT_DIVU
     17,  // TEXT_DIVU
     18,  // TEXT_DIVUL
     19,  // TEXT_LINK
     20,  // TEXT_MULS
     21,  // TEXT_MULS
     22,  // TEXT_MULU
     23,  // TEXT_MULU
     24,  // TEXT_PACK
     25,  // TEXT_PACK
     26,  // TEXT_TRAPCC
     44,  // TEXT_TRAPCC
     62,  // TEXT_TRAPCC
     27,  // TEXT_TRAPCS
     45,  // TEXT_TRAPCS
     63,  // TEXT_TRAPCS
     28,  // TEXT_TRAPEQ
     46,  // TEXT_TRAPEQ
     64,  // TEXT_TRAPEQ
     29,  // TEXT_TRAPF
     47,  // TEXT_TRAPF
     65,  // TEXT_TRAPF
     30,  // TEXT_TRAPGE
     48,  // TEXT_TRAPGE
     66,  // TEXT_TRAPGE
     31,  // TEXT_TRAPGT
     49,  // TEXT_TRAPGT
     67,  // TEXT_TRAPGT
     32,  // TEXT_TRAPHI
     50,  // TEXT_TRAPHI
     68,  // TEXT_TRAPHI
     33,  // TEXT_TRAPHS
     51,  // TEXT_TRAPHS
     69,  // TEXT_TRAPHS
     34,  // TEXT_TRAPLE
     52,  // TEXT_TRAPLE
     70,  // TEXT_TRAPLE
     35,  // TEXT_TRAPLO
     53,  // TEXT_TRAPLO
     71,  // TEXT_TRAPLO
     36,  // TEXT_TRAPLS
     54,  // TEXT_TRAPLS
     72,  // TEXT_TRAPLS
     37,  // TEXT_TRAPLT
     55,  // TEXT_TRAPLT
     73,  // TEXT_TRAPLT
     38,  // TEXT_TRAPMI
     56,  // TEXT_TRAPMI
     74,  // TEXT_TRAPMI
     39,  // TEXT_TRAPNE
     57,  // TEXT_TRAPNE
     75,  // TEXT_TRAPNE
     40,  // TEXT_TRAPPL
     58,  // TEXT_TRAPPL
     76,  // TEXT_TRAPPL
     41,  // TEXT_TRAPT
     59,  // TEXT_TRAPT
     77,  // TEXT_TRAPT
     42,  // TEXT_TRAPVC
     60,  // TEXT_TRAPVC
     78,  // TEXT_TRAPVC
     43,  // TEXT_TRAPVS
     61,  // TEXT_TRAPVS
     79,  // TEXT_TRAPVS
     80,  // TEXT_UNPK
     81,  // TEXT_UNPK
};

constexpr Entry MC68020_MODULE[] PROGMEM = {
    E2(0003300, TEXT_CALLM,  ISZ_NONE, M_IMDAT, M_JADDR, OP___, OP_10, SZ_BYTE, CF_0077),
    E1(0003310, TEXT_RTM,    ISZ_NONE, M_AREG,  OP__0, SZ_NONE, CF_0007),
    E1(0003300, TEXT_RTM,    ISZ_NONE, M_DREG,  OP__0, SZ_NONE, CF_0007),
};

constexpr uint8_t MC68020_MODULE_INDEX[] PROGMEM = {
      0,  // TEXT_CALLM
      1,  // TEXT_RTM
      2,  // TEXT_RTM
};

constexpr Entry MC68040_TABLE[] PROGMEM = {
    X2(0173040, TEXT_MOVE16, ISZ_NONE, M_PINC,  M_PINC,  OP__0, EX_GR, SZ_NONE, CF_0007, 0x0000, PF_F000),
    E2(0173000, TEXT_MOVE16, ISZ_NONE, M_PINC,  M_ALONG, OP__0, OP___, SZ_NONE, CF_0007),
    E2(0173010, TEXT_MOVE16, ISZ_NONE, M_ALONG, M_PINC,  OP___, OP__0, SZ_NONE, CF_0007),
    E2(0173020, TEXT_MOVE16, ISZ_NONE, M_AIND,  M_ALONG, OP__0, OP___, SZ_NONE, CF_0007),
    E2(0173030, TEXT_MOVE16, ISZ_NONE, M_ALONG, M_AIND,  OP___, OP__0, SZ_NONE, CF_0007),
    E2(0172010, TEXT_CINVL,  ISZ_NONE, M_CACHE, M_AIND,  OP___, OP__0, SZ_NONE, CF_0307),
    E2(0172020, TEXT_CINVP,  ISZ_NONE, M_CACHE, M_AIND,  OP___, OP__0, SZ_NONE, CF_0307),
    E1(0172030, TEXT_CINVA,  ISZ_NONE, M_CACHE, OP___,   SZ_NONE, CF_0300),
    E2(0172050, TEXT_CPUSHL, ISZ_NONE, M_CACHE, M_AIND,  OP___, OP__0, SZ_NONE, CF_0307),
    E2(0172060, TEXT_CPUSHP, ISZ_NONE, M_CACHE, M_AIND,  OP___, OP__0, SZ_NONE, CF_0307),
    E1(0172070, TEXT_CPUSHA, ISZ_NONE, M_CACHE, OP___,   SZ_NONE, CF_0300),
};

constexpr uint8_t MC68040_INDEX[] PROGMEM = {
      7,  // TEXT_CINVA
      5,  // TEXT_CINVL
      6,  // TEXT_CINVP
     10,  // TEXT_CPUSHA
      8,  // TEXT_CPUSHL
      9,  // TEXT_CPUSHP
      0,  // TEXT_MOVE16
      1,  // TEXT_MOVE16
      2,  // TEXT_MOVE16
      3,  // TEXT_MOVE16
      4,  // TEXT_MOVE16
};

#if !defined(LIBASM_MC68000_NOFPU)

constexpr Entry FPU_COMMON[] PROGMEM = {
    X2(0xF200, TEXT_FMOVE,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0000, PF_1F80),
    X2(0xF200, TEXT_FSQRT,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0004, PF_1F80),
    X2(0xF200, TEXT_FABS,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0018, PF_1F80),
    X2(0xF200, TEXT_FNEG,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x001A, PF_1F80),
    X2(0xF200, TEXT_FDIV,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0020, PF_1F80),
    X2(0xF200, TEXT_FADD,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0022, PF_1F80),
    X2(0xF200, TEXT_FMUL,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0023, PF_1F80),
    X2(0xF200, TEXT_FSGLDIV, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0024, PF_1F80),
    X2(0xF200, TEXT_FSGLMUL, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0027, PF_1F80),
    X2(0xF200, TEXT_FSUB,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0028, PF_1F80),
    X2(0xF200, TEXT_FCMP,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0038, PF_1F80),
    X1(0xF200, TEXT_FTST,    ISZ_FIXD, M_FPREG, EX_RX, SZ_XTND, CF_0000, 0x003A, PF_1C00),
    X2(0xF200, TEXT_FMOVE,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4000, PF_0380),
    X2(0xF200, TEXT_FSQRT,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4004, PF_0380),
    X2(0xF200, TEXT_FABS,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4018, PF_0380),
    X2(0xF200, TEXT_FNEG,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x401A, PF_0380),
    X2(0xF200, TEXT_FDIV,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4020, PF_0380),
    X2(0xF200, TEXT_FADD,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4022, PF_0380),
    X2(0xF200, TEXT_FMUL,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4023, PF_0380),
    X2(0xF200, TEXT_FSGLDIV, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4024, PF_0380),
    X2(0xF200, TEXT_FSGLMUL, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4027, PF_0380),
    X2(0xF200, TEXT_FSUB,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4028, PF_0380),
    X2(0xF200, TEXT_FCMP,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4038, PF_0380),
    P1(0xF200, TEXT_FTST,    ISZ_FDAT, M_RDATA, OP_10,   SZ_FDAT, CF_0077, 0x403A),
    X3(0xF200, TEXT_FMOVE,   ISZ_FIXD, M_FPREG, M_WDATA, M_KFACT, EX_RY, OP_10, EX_SK, SZ_PBCD, CF_0077, 0x6C00, PF_03FF),
    X3(0xF200, TEXT_FMOVE,   ISZ_FIXD, M_FPREG, M_WDATA, M_KDREG, EX_RY, OP_10, EX_DK, SZ_PBCD, CF_0077, 0x7C00, PF_03F0),
    X2(0xF200, TEXT_FMOVE,   ISZ_FDAT, M_FPREG, M_WDATA, EX_RY, OP_10, SZ_FDAT, CF_0077, 0x6000, PF_0380),
    X2(0xF200, TEXT_FMOVE,   ISZ_FIXD, M_RADDR, M_FPIAR, OP_10, OP___, SZ_LONG, CF_0077, 0x8400, PF_0000),
    X2(0xF200, TEXT_FMOVE,   ISZ_FIXD, M_RADDR, M_FPSR,  OP_10, OP___, SZ_LONG, CF_0077, 0x8800, PF_0000),
    X2(0xF200, TEXT_FMOVE,   ISZ_FIXD, M_RADDR, M_FPCR,  OP_10, OP___, SZ_LONG, CF_0077, 0x9000, PF_0000),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_AREG,  M_FPIAR, OP_10, OP___, SZ_LONG, CF_0077, 0x8400, PF_0000),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_DREG,  M_FPIAR, OP_10, OP___, SZ_LONG, CF_0077, 0x8400, PF_0000),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_DREG,  M_FPSR,  OP_10, OP___, SZ_LONG, CF_0077, 0x8800, PF_0000),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_DREG,  M_FPCR,  OP_10, OP___, SZ_LONG, CF_0077, 0x9000, PF_0000),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_RADDR, M_FCMLT, OP_10, EX_RX, SZ_LONG, CF_0077, 0x8000, PF_1C00),
    X2(0xF200, TEXT_FMOVE,   ISZ_FIXD, M_FPIAR, M_WADDR, OP___, OP_10, SZ_LONG, CF_0077, 0xA400, PF_0000),
    X2(0xF200, TEXT_FMOVE,   ISZ_FIXD, M_FPSR,  M_WADDR, OP___, OP_10, SZ_LONG, CF_0077, 0xA800, PF_0000),
    X2(0xF200, TEXT_FMOVE,   ISZ_FIXD, M_FPCR,  M_WADDR, OP___, OP_10, SZ_LONG, CF_0077, 0xB000, PF_0000),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_FPIAR, M_AREG,  OP___, OP_10, SZ_LONG, CF_0077, 0xA400, PF_0000),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_FPIAR, M_DREG,  OP___, OP_10, SZ_LONG, CF_0077, 0xA400, PF_0000),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_FPSR,  M_DREG,  OP___, OP_10, SZ_LONG, CF_0077, 0xA800, PF_0000),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_FPCR,  M_DREG,  OP___, OP_10, SZ_LONG, CF_0077, 0xB000, PF_0000),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_FCMLT, M_WADDR, EX_RX, OP_10, SZ_LONG, CF_0077, 0xA000, PF_1C00),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_FPMLT, M_DADDR, EX_SL, OP_10, SZ_XTND, CF_0077, 0xE000, PF_00FF),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_DREG,  M_DADDR, EX_DL, OP_10, SZ_XTND, CF_0077, 0xE800, PF_0070),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_FPMLT, M_DADDR, EX_SL, OP_10, SZ_XTND, CF_0077, 0xF000, PF_00FF),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_DREG,  M_DADDR, EX_DL, OP_10, SZ_XTND, CF_0077, 0xF800, PF_0070),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_IADDR, M_FPMLT, OP_10, EX_SL, SZ_XTND, CF_0077, 0xC000, PF_00FF),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_IADDR, M_DREG,  OP_10, EX_DL, SZ_XTND, CF_0077, 0xC800, PF_0070),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_IADDR, M_FPMLT, OP_10, EX_SL, SZ_XTND, CF_0077, 0xD000, PF_00FF),
    X2(0xF200, TEXT_FMOVEM,  ISZ_FIXD, M_IADDR, M_DREG,  OP_10, EX_DL, SZ_XTND, CF_0077, 0xD800, PF_0070),
    X2(0xF200, TEXT_FSQRT,   ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0004, PF_1C00),
    X2(0xF200, TEXT_FABS,    ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0018, PF_1C00),
    X2(0xF200, TEXT_FNEG,    ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x001A, PF_1C00),
    E1(0xF300, TEXT_FSAVE,    ISZ_NONE, M_DADDR, OP_10, SZ_NONE, CF_0077),
    E1(0xF340, TEXT_FRESTORE, ISZ_NONE, M_IADDR, OP_10, SZ_NONE, CF_0077),
};

constexpr uint8_t FPU_COMMON_INDEX[] PROGMEM = {
      2,  // TEXT_FABS
     14,  // TEXT_FABS
     52,  // TEXT_FABS
      5,  // TEXT_FADD
     17,  // TEXT_FADD
     10,  // TEXT_FCMP
     22,  // TEXT_FCMP
      4,  // TEXT_FDIV
     16,  // TEXT_FDIV
      0,  // TEXT_FMOVE
     12,  // TEXT_FMOVE
     24,  // TEXT_FMOVE
     25,  // TEXT_FMOVE
     26,  // TEXT_FMOVE
     27,  // TEXT_FMOVE
     28,  // TEXT_FMOVE
     29,  // TEXT_FMOVE
     35,  // TEXT_FMOVE
     36,  // TEXT_FMOVE
     37,  // TEXT_FMOVE
     30,  // TEXT_FMOVEM
     31,  // TEXT_FMOVEM
     32,  // TEXT_FMOVEM
     33,  // TEXT_FMOVEM
     34,  // TEXT_FMOVEM
     38,  // TEXT_FMOVEM
     39,  // TEXT_FMOVEM
     40,  // TEXT_FMOVEM
     41,  // TEXT_FMOVEM
     42,  // TEXT_FMOVEM
     43,  // TEXT_FMOVEM
     44,  // TEXT_FMOVEM
     45,  // TEXT_FMOVEM
     46,  // TEXT_FMOVEM
     47,  // TEXT_FMOVEM
     48,  // TEXT_FMOVEM
     49,  // TEXT_FMOVEM
     50,  // TEXT_FMOVEM
      6,  // TEXT_FMUL
     18,  // TEXT_FMUL
      3,  // TEXT_FNEG
     15,  // TEXT_FNEG
     53,  // TEXT_FNEG
     55,  // TEXT_FRESTORE
     54,  // TEXT_FSAVE
      7,  // TEXT_FSGLDIV
     19,  // TEXT_FSGLDIV
      8,  // TEXT_FSGLMUL
     20,  // TEXT_FSGLMUL
      1,  // TEXT_FSQRT
     13,  // TEXT_FSQRT
     51,  // TEXT_FSQRT
      9,  // TEXT_FSUB
     21,  // TEXT_FSUB
     11,  // TEXT_FTST
     23,  // TEXT_FTST
};

constexpr Entry MC68881_TABLE[] PROGMEM = {
    X2(0xF200, TEXT_FINT,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0001, PF_1F80),
    X2(0xF200, TEXT_FSINH,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0002, PF_1F80),
    X2(0xF200, TEXT_FINTRZ,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0003, PF_1F80),
    X2(0xF200, TEXT_FLOGNP1, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0006, PF_1F80),
    X2(0xF200, TEXT_FETOXM1, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0008, PF_1F80),
    X2(0xF200, TEXT_FTANH,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0009, PF_1F80),
    X2(0xF200, TEXT_FATAN,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x000A, PF_1F80),
    X2(0xF200, TEXT_FASIN,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x000C, PF_1F80),
    X2(0xF200, TEXT_FATANH,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x000D, PF_1F80),
    X2(0xF200, TEXT_FSIN,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x000E, PF_1F80),
    X2(0xF200, TEXT_FTAN,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x000F, PF_1F80),
    X2(0xF200, TEXT_FETOX,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0010, PF_1F80),
    X2(0xF200, TEXT_FTWOTOX, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0011, PF_1F80),
    X2(0xF200, TEXT_FTENTOX, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0012, PF_1F80),
    X2(0xF200, TEXT_FLOGN,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0014, PF_1F80),
    X2(0xF200, TEXT_FLOG10,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0015, PF_1F80),
    X2(0xF200, TEXT_FLOG2,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0016, PF_1F80),
    X2(0xF200, TEXT_FCOSH,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0019, PF_1F80),
    X2(0xF200, TEXT_FNEG,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x001A, PF_1F80),
    X2(0xF200, TEXT_FACOS,   ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x001C, PF_1F80),
    X2(0xF200, TEXT_FCOS,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x001D, PF_1F80),
    X2(0xF200, TEXT_FGETEXP, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x001E, PF_1F80),
    X2(0xF200, TEXT_FGETMAN, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x001F, PF_1F80),
    X2(0xF200, TEXT_FMOD,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0021, PF_1F80),
    X2(0xF200, TEXT_FREM,    ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0025, PF_1F80),
    X2(0xF200, TEXT_FSCALE,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0026, PF_1F80),
    X2(0xF200, TEXT_FSINCOS, ISZ_FIXD, M_FPREG, M_FSICO, EX_RX, EX_SC, SZ_XTND, CF_0000, 0x0030, PF_1F87),
    X2(0xF200, TEXT_FINT,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4001, PF_0380),
    X2(0xF200, TEXT_FSINH,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4002, PF_0380),
    X2(0xF200, TEXT_FINTRZ,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4003, PF_0380),
    X2(0xF200, TEXT_FLOGNP1, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4006, PF_0380),
    X2(0xF200, TEXT_FETOXM1, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4008, PF_0380),
    X2(0xF200, TEXT_FTANH,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4009, PF_0380),
    X2(0xF200, TEXT_FATAN,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x400A, PF_0380),
    X2(0xF200, TEXT_FASIN,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x400C, PF_0380),
    X2(0xF200, TEXT_FATANH,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x400D, PF_0380),
    X2(0xF200, TEXT_FSIN,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x400E, PF_0380),
    X2(0xF200, TEXT_FTAN,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x400F, PF_0380),
    X2(0xF200, TEXT_FETOX,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4010, PF_0380),
    X2(0xF200, TEXT_FTWOTOX, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4011, PF_0380),
    X2(0xF200, TEXT_FTENTOX, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4012, PF_0380),
    X2(0xF200, TEXT_FLOGN,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4014, PF_0380),
    X2(0xF200, TEXT_FLOG10,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4015, PF_0380),
    X2(0xF200, TEXT_FLOG2,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4016, PF_0380),
    X2(0xF200, TEXT_FCOSH,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4019, PF_0380),
    X2(0xF200, TEXT_FACOS,   ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x401C, PF_0380),
    X2(0xF200, TEXT_FCOS,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x401D, PF_0380),
    X2(0xF200, TEXT_FGETEXP, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x401E, PF_0380),
    X2(0xF200, TEXT_FGETMAN, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x401F, PF_0380),
    X2(0xF200, TEXT_FMOD,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4021, PF_0380),
    X2(0xF200, TEXT_FREM,    ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4025, PF_0380),
    X2(0xF200, TEXT_FSCALE,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4026, PF_0380),
    X2(0xF200, TEXT_FSINCOS, ISZ_FDAT, M_RDATA, M_FSICO, OP_10, EX_SC, SZ_FDAT, CF_0077, 0x4030, PF_0387),
    X2(0xF200, TEXT_FINT,    ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0001, PF_1C00),
    X2(0xF200, TEXT_FSINH,   ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0002, PF_1C00),
    X2(0xF200, TEXT_FINTRZ,  ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0003, PF_1C00),
    X2(0xF200, TEXT_FLOGNP1, ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0006, PF_1C00),
    X2(0xF200, TEXT_FETOXM1, ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0008, PF_1C00),
    X2(0xF200, TEXT_FTANH,   ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0009, PF_1C00),
    X2(0xF200, TEXT_FATAN,   ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x000A, PF_1C00),
    X2(0xF200, TEXT_FASIN,   ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x000C, PF_1C00),
    X2(0xF200, TEXT_FATANH,  ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x000D, PF_1C00),
    X2(0xF200, TEXT_FSIN,    ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x000E, PF_1C00),
    X2(0xF200, TEXT_FTAN,    ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x000F, PF_1C00),
    X2(0xF200, TEXT_FETOX,   ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0010, PF_1C00),
    X2(0xF200, TEXT_FTWOTOX, ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0011, PF_1C00),
    X2(0xF200, TEXT_FTENTOX, ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0012, PF_1C00),
    X2(0xF200, TEXT_FLOGN,   ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0014, PF_1C00),
    X2(0xF200, TEXT_FLOG10,  ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0015, PF_1C00),
    X2(0xF200, TEXT_FLOG2,   ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0016, PF_1C00),
    X2(0xF200, TEXT_FCOSH,   ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0019, PF_1C00),
    X2(0xF200, TEXT_FACOS,   ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x001C, PF_1C00),
    X2(0xF200, TEXT_FCOS,    ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x001D, PF_1C00),
    X2(0xF200, TEXT_FGETEXP, ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x001E, PF_1C00),
    X2(0xF200, TEXT_FGETMAN, ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x001F, PF_1C00),
    X2(0xF200, TEXT_FMOVECR, ISZ_FIXD, M_IMROM, M_FPREG, EX_SK, EX_RY, SZ_XTND, CF_0000, 0x5C00, PF_03FF),
};

constexpr uint8_t MC68881_INDEX[] PROGMEM = {
     19,  // TEXT_FACOS
     45,  // TEXT_FACOS
     71,  // TEXT_FACOS
      7,  // TEXT_FASIN
     34,  // TEXT_FASIN
     60,  // TEXT_FASIN
      6,  // TEXT_FATAN
     33,  // TEXT_FATAN
     59,  // TEXT_FATAN
      8,  // TEXT_FATANH
     35,  // TEXT_FATANH
     61,  // TEXT_FATANH
     20,  // TEXT_FCOS
     46,  // TEXT_FCOS
     72,  // TEXT_FCOS
     17,  // TEXT_FCOSH
     44,  // TEXT_FCOSH
     70,  // TEXT_FCOSH
     11,  // TEXT_FETOX
     38,  // TEXT_FETOX
     64,  // TEXT_FETOX
      4,  // TEXT_FETOXM1
     31,  // TEXT_FETOXM1
     57,  // TEXT_FETOXM1
     21,  // TEXT_FGETEXP
     47,  // TEXT_FGETEXP
     73,  // TEXT_FGETEXP
     22,  // TEXT_FGETMAN
     48,  // TEXT_FGETMAN
     74,  // TEXT_FGETMAN
      0,  // TEXT_FINT
     27,  // TEXT_FINT
     53,  // TEXT_FINT
      2,  // TEXT_FINTRZ
     29,  // TEXT_FINTRZ
     55,  // TEXT_FINTRZ
     15,  // TEXT_FLOG10
     42,  // TEXT_FLOG10
     68,  // TEXT_FLOG10
     16,  // TEXT_FLOG2
     43,  // TEXT_FLOG2
     69,  // TEXT_FLOG2
     14,  // TEXT_FLOGN
     41,  // TEXT_FLOGN
     67,  // TEXT_FLOGN
      3,  // TEXT_FLOGNP1
     30,  // TEXT_FLOGNP1
     56,  // TEXT_FLOGNP1
     23,  // TEXT_FMOD
     49,  // TEXT_FMOD
     75,  // TEXT_FMOVECR
     18,  // TEXT_FNEG
     24,  // TEXT_FREM
     50,  // TEXT_FREM
     25,  // TEXT_FSCALE
     51,  // TEXT_FSCALE
      9,  // TEXT_FSIN
     36,  // TEXT_FSIN
     62,  // TEXT_FSIN
     26,  // TEXT_FSINCOS
     52,  // TEXT_FSINCOS
      1,  // TEXT_FSINH
     28,  // TEXT_FSINH
     54,  // TEXT_FSINH
     10,  // TEXT_FTAN
     37,  // TEXT_FTAN
     63,  // TEXT_FTAN
      5,  // TEXT_FTANH
     32,  // TEXT_FTANH
     58,  // TEXT_FTANH
     13,  // TEXT_FTENTOX
     40,  // TEXT_FTENTOX
     66,  // TEXT_FTENTOX
     12,  // TEXT_FTWOTOX
     39,  // TEXT_FTWOTOX
     65,  // TEXT_FTWOTOX
};

constexpr Entry FPU_BRANCH[] PROGMEM = {
    E1(0xF280, TEXT_FBF,      ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    X0(0xF280, TEXT_FNOP,     CF_0000,  0x0000,  PF_0000),
    E1(0xF281, TEXT_FBEQ,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF282, TEXT_FBOGT,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF283, TEXT_FBOGE,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF284, TEXT_FBOLT,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF285, TEXT_FBOLE,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF286, TEXT_FBOGL,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF287, TEXT_FBOR,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF288, TEXT_FBUN,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF289, TEXT_FBUEQ,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF28A, TEXT_FBUGT,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF28B, TEXT_FBUGE,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF28C, TEXT_FBULT,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF28D, TEXT_FBULE,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF28E, TEXT_FBNE,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF28F, TEXT_FBT,      ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF290, TEXT_FBSF,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF291, TEXT_FBSEQ,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF292, TEXT_FBGT,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF293, TEXT_FBGE,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF294, TEXT_FBLT,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF295, TEXT_FBLE,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF296, TEXT_FBGL,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF297, TEXT_FBGLE,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF298, TEXT_FBNGLE,   ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF299, TEXT_FBNGL,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF29A, TEXT_FBNLE,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF29B, TEXT_FBNLT,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF29C, TEXT_FBNGE,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF29D, TEXT_FBNGT,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF29E, TEXT_FBSNE,    ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    E1(0xF29F, TEXT_FBST,     ISZ_NONE, M_REL32, OP___, SZ_LONG, CF_0100),
    P2(0xF248, TEXT_FDBF,     ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0000),
    P2(0xF248, TEXT_FDBEQ,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0001),
    P2(0xF248, TEXT_FDBOGT,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0002),
    P2(0xF248, TEXT_FDBOGE,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0003),
    P2(0xF248, TEXT_FDBOLT,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0004),
    P2(0xF248, TEXT_FDBOLE,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0005),
    P2(0xF248, TEXT_FDBOGL,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0006),
    P2(0xF248, TEXT_FDBOR,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0007),
    P2(0xF248, TEXT_FDBUN,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0008),
    P2(0xF248, TEXT_FDBUEQ,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0009),
    P2(0xF248, TEXT_FDBUGT,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000A),
    P2(0xF248, TEXT_FDBUGE,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000B),
    P2(0xF248, TEXT_FDBULT,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000C),
    P2(0xF248, TEXT_FDBULE,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000D),
    P2(0xF248, TEXT_FDBNE,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000E),
    P2(0xF248, TEXT_FDBT,     ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000F),
    P2(0xF248, TEXT_FDBSF,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0010),
    P2(0xF248, TEXT_FDBSEQ,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0011),
    P2(0xF248, TEXT_FDBGT,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0012),
    P2(0xF248, TEXT_FDBGE,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0013),
    P2(0xF248, TEXT_FDBLT,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0014),
    P2(0xF248, TEXT_FDBLE,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0015),
    P2(0xF248, TEXT_FDBGL,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0016),
    P2(0xF248, TEXT_FDBGLE,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0017),
    P2(0xF248, TEXT_FDBNGLE,  ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0018),
    P2(0xF248, TEXT_FDBNGL,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0019),
    P2(0xF248, TEXT_FDBNLE,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x001A),
    P2(0xF248, TEXT_FDBNLT,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x001B),
    P2(0xF248, TEXT_FDBNGE,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x001C),
    P2(0xF248, TEXT_FDBNGT,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x001D),
    P2(0xF248, TEXT_FDBSNE,   ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x001E),
    P2(0xF248, TEXT_FDBST,    ISZ_NONE, M_DREG,  M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x001F),
};

constexpr uint8_t FPU_BRANCH_INDEX[] PROGMEM = {
      2,  // TEXT_FBEQ
      0,  // TEXT_FBF
     20,  // TEXT_FBGE
     23,  // TEXT_FBGL
     24,  // TEXT_FBGLE
     19,  // TEXT_FBGT
     22,  // TEXT_FBLE
     21,  // TEXT_FBLT
     15,  // TEXT_FBNE
     29,  // TEXT_FBNGE
     26,  // TEXT_FBNGL
     25,  // TEXT_FBNGLE
     30,  // TEXT_FBNGT
     27,  // TEXT_FBNLE
     28,  // TEXT_FBNLT
      4,  // TEXT_FBOGE
      7,  // TEXT_FBOGL
      3,  // TEXT_FBOGT
      6,  // TEXT_FBOLE
      5,  // TEXT_FBOLT
      8,  // TEXT_FBOR
     18,  // TEXT_FBSEQ
     17,  // TEXT_FBSF
     31,  // TEXT_FBSNE
     32,  // TEXT_FBST
     16,  // TEXT_FBT
     10,  // TEXT_FBUEQ
     12,  // TEXT_FBUGE
     11,  // TEXT_FBUGT
     14,  // TEXT_FBULE
     13,  // TEXT_FBULT
      9,  // TEXT_FBUN
     34,  // TEXT_FDBEQ
     33,  // TEXT_FDBF
     52,  // TEXT_FDBGE
     55,  // TEXT_FDBGL
     56,  // TEXT_FDBGLE
     51,  // TEXT_FDBGT
     54,  // TEXT_FDBLE
     53,  // TEXT_FDBLT
     47,  // TEXT_FDBNE
     61,  // TEXT_FDBNGE
     58,  // TEXT_FDBNGL
     57,  // TEXT_FDBNGLE
     62,  // TEXT_FDBNGT
     59,  // TEXT_FDBNLE
     60,  // TEXT_FDBNLT
     36,  // TEXT_FDBOGE
     39,  // TEXT_FDBOGL
     35,  // TEXT_FDBOGT
     38,  // TEXT_FDBOLE
     37,  // TEXT_FDBOLT
     40,  // TEXT_FDBOR
     50,  // TEXT_FDBSEQ
     49,  // TEXT_FDBSF
     63,  // TEXT_FDBSNE
     64,  // TEXT_FDBST
     48,  // TEXT_FDBT
     42,  // TEXT_FDBUEQ
     44,  // TEXT_FDBUGE
     43,  // TEXT_FDBUGT
     46,  // TEXT_FDBULE
     45,  // TEXT_FDBULT
     41,  // TEXT_FDBUN
      1,  // TEXT_FNOP
};

constexpr Entry FPU_TRAP[] = {
    P1(0xF240, TEXT_FSF,      ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0000),
    P1(0xF240, TEXT_FSEQ,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0001),
    P1(0xF240, TEXT_FSOGT,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0002),
    P1(0xF240, TEXT_FSOGE,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0003),
    P1(0xF240, TEXT_FSOLT,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0004),
    P1(0xF240, TEXT_FSOLE,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0005),
    P1(0xF240, TEXT_FSOGL,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0006),
    P1(0xF240, TEXT_FSOR,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0007),
    P1(0xF240, TEXT_FSUN,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0008),
    P1(0xF240, TEXT_FSUEQ,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0009),
    P1(0xF240, TEXT_FSUGT,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000A),
    P1(0xF240, TEXT_FSUGE,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000B),
    P1(0xF240, TEXT_FSULT,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000C),
    P1(0xF240, TEXT_FSULE,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000D),
    P1(0xF240, TEXT_FSNE,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000E),
    P1(0xF240, TEXT_FST,      ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000F),
    P1(0xF240, TEXT_FSSF,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0010),
    P1(0xF240, TEXT_FSSEQ,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0011),
    P1(0xF240, TEXT_FSGT,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0012),
    P1(0xF240, TEXT_FSGE,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0013),
    P1(0xF240, TEXT_FSLT,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0014),
    P1(0xF240, TEXT_FSLE,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0015),
    P1(0xF240, TEXT_FSGL,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0016),
    P1(0xF240, TEXT_FSGLE,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0017),
    P1(0xF240, TEXT_FSNGLE,   ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0018),
    P1(0xF240, TEXT_FSNGL,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0019),
    P1(0xF240, TEXT_FSNLE,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x001A),
    P1(0xF240, TEXT_FSNLT,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x001B),
    P1(0xF240, TEXT_FSNGE,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x001C),
    P1(0xF240, TEXT_FSNGT,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x001D),
    P1(0xF240, TEXT_FSSNE,    ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x001E),
    P1(0xF240, TEXT_FSST,     ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x001F),
    P1(0xF27A, TEXT_FTRAPF,    ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0000),
    P1(0xF27A, TEXT_FTRAPEQ,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0001),
    P1(0xF27A, TEXT_FTRAPOGT,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0002),
    P1(0xF27A, TEXT_FTRAPOGE,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0003),
    P1(0xF27A, TEXT_FTRAPOLT,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0004),
    P1(0xF27A, TEXT_FTRAPOLE,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0005),
    P1(0xF27A, TEXT_FTRAPOGL,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0006),
    P1(0xF27A, TEXT_FTRAPOR,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0007),
    P1(0xF27A, TEXT_FTRAPUN,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0008),
    P1(0xF27A, TEXT_FTRAPUEQ,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0009),
    P1(0xF27A, TEXT_FTRAPUGT,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000A),
    P1(0xF27A, TEXT_FTRAPUGE,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000B),
    P1(0xF27A, TEXT_FTRAPULT,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000C),
    P1(0xF27A, TEXT_FTRAPULE,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000D),
    P1(0xF27A, TEXT_FTRAPNE,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000E),
    P1(0xF27A, TEXT_FTRAPT,    ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000F),
    P1(0xF27A, TEXT_FTRAPSF,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0010),
    P1(0xF27A, TEXT_FTRAPSEQ,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0011),
    P1(0xF27A, TEXT_FTRAPGT,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0012),
    P1(0xF27A, TEXT_FTRAPGE,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0013),
    P1(0xF27A, TEXT_FTRAPLT,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0014),
    P1(0xF27A, TEXT_FTRAPLE,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0015),
    P1(0xF27A, TEXT_FTRAPGL,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0016),
    P1(0xF27A, TEXT_FTRAPGLE,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0017),
    P1(0xF27A, TEXT_FTRAPNGLE, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0018),
    P1(0xF27A, TEXT_FTRAPNGL,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0019),
    P1(0xF27A, TEXT_FTRAPNLE,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x001A),
    P1(0xF27A, TEXT_FTRAPNLT,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x001B),
    P1(0xF27A, TEXT_FTRAPNGE,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x001C),
    P1(0xF27A, TEXT_FTRAPNGT,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x001D),
    P1(0xF27A, TEXT_FTRAPSNE,  ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x001E),
    P1(0xF27A, TEXT_FTRAPST,   ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x001F),
    P1(0xF27B, TEXT_FTRAPF,    ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0000),
    P1(0xF27B, TEXT_FTRAPEQ,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0001),
    P1(0xF27B, TEXT_FTRAPOGT,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0002),
    P1(0xF27B, TEXT_FTRAPOGE,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0003),
    P1(0xF27B, TEXT_FTRAPOLT,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0004),
    P1(0xF27B, TEXT_FTRAPOLE,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0005),
    P1(0xF27B, TEXT_FTRAPOGL,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0006),
    P1(0xF27B, TEXT_FTRAPOR,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0007),
    P1(0xF27B, TEXT_FTRAPUN,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0008),
    P1(0xF27B, TEXT_FTRAPUEQ,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0009),
    P1(0xF27B, TEXT_FTRAPUGT,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000A),
    P1(0xF27B, TEXT_FTRAPUGE,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000B),
    P1(0xF27B, TEXT_FTRAPULT,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000C),
    P1(0xF27B, TEXT_FTRAPULE,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000D),
    P1(0xF27B, TEXT_FTRAPNE,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000E),
    P1(0xF27B, TEXT_FTRAPT,    ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000F),
    P1(0xF27B, TEXT_FTRAPSF,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0010),
    P1(0xF27B, TEXT_FTRAPSEQ,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0011),
    P1(0xF27B, TEXT_FTRAPGT,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0012),
    P1(0xF27B, TEXT_FTRAPGE,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0013),
    P1(0xF27B, TEXT_FTRAPLT,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0014),
    P1(0xF27B, TEXT_FTRAPLE,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0015),
    P1(0xF27B, TEXT_FTRAPGL,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0016),
    P1(0xF27B, TEXT_FTRAPGLE,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0017),
    P1(0xF27B, TEXT_FTRAPNGLE, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0018),
    P1(0xF27B, TEXT_FTRAPNGL,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0019),
    P1(0xF27B, TEXT_FTRAPNLE,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x001A),
    P1(0xF27B, TEXT_FTRAPNLT,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x001B),
    P1(0xF27B, TEXT_FTRAPNGE,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x001C),
    P1(0xF27B, TEXT_FTRAPNGT,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x001D),
    P1(0xF27B, TEXT_FTRAPSNE,  ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x001E),
    P1(0xF27B, TEXT_FTRAPST,   ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x001F),
    P0(0xF27C, TEXT_FTRAPF,    0x0000),
    P0(0xF27C, TEXT_FTRAPEQ,   0x0001),
    P0(0xF27C, TEXT_FTRAPOGT,  0x0002),
    P0(0xF27C, TEXT_FTRAPOGE,  0x0003),
    P0(0xF27C, TEXT_FTRAPOLT,  0x0004),
    P0(0xF27C, TEXT_FTRAPOLE,  0x0005),
    P0(0xF27C, TEXT_FTRAPOGL,  0x0006),
    P0(0xF27C, TEXT_FTRAPOR,   0x0007),
    P0(0xF27C, TEXT_FTRAPUN,   0x0008),
    P0(0xF27C, TEXT_FTRAPUEQ,  0x0009),
    P0(0xF27C, TEXT_FTRAPUGT,  0x000A),
    P0(0xF27C, TEXT_FTRAPUGE,  0x000B),
    P0(0xF27C, TEXT_FTRAPULT,  0x000C),
    P0(0xF27C, TEXT_FTRAPULE,  0x000D),
    P0(0xF27C, TEXT_FTRAPNE,   0x000E),
    P0(0xF27C, TEXT_FTRAPT,    0x000F),
    P0(0xF27C, TEXT_FTRAPSF,   0x0010),
    P0(0xF27C, TEXT_FTRAPSEQ,  0x0011),
    P0(0xF27C, TEXT_FTRAPGT,   0x0012),
    P0(0xF27C, TEXT_FTRAPGE,   0x0013),
    P0(0xF27C, TEXT_FTRAPLT,   0x0014),
    P0(0xF27C, TEXT_FTRAPLE,   0x0015),
    P0(0xF27C, TEXT_FTRAPGL,   0x0016),
    P0(0xF27C, TEXT_FTRAPGLE,  0x0017),
    P0(0xF27C, TEXT_FTRAPNGLE, 0x0018),
    P0(0xF27C, TEXT_FTRAPNGL,  0x0019),
    P0(0xF27C, TEXT_FTRAPNLE,  0x001A),
    P0(0xF27C, TEXT_FTRAPNLT,  0x001B),
    P0(0xF27C, TEXT_FTRAPNGE,  0x001C),
    P0(0xF27C, TEXT_FTRAPNGT,  0x001D),
    P0(0xF27C, TEXT_FTRAPSNE,  0x001E),
    P0(0xF27C, TEXT_FTRAPST,   0x001F),
};

constexpr uint8_t FPU_TRAP_INDEX[] PROGMEM = {
      1,  // TEXT_FSEQ
      0,  // TEXT_FSF
     19,  // TEXT_FSGE
     22,  // TEXT_FSGL
     23,  // TEXT_FSGLE
     18,  // TEXT_FSGT
     21,  // TEXT_FSLE
     20,  // TEXT_FSLT
     14,  // TEXT_FSNE
     28,  // TEXT_FSNGE
     25,  // TEXT_FSNGL
     24,  // TEXT_FSNGLE
     29,  // TEXT_FSNGT
     26,  // TEXT_FSNLE
     27,  // TEXT_FSNLT
      3,  // TEXT_FSOGE
      6,  // TEXT_FSOGL
      2,  // TEXT_FSOGT
      5,  // TEXT_FSOLE
      4,  // TEXT_FSOLT
      7,  // TEXT_FSOR
     17,  // TEXT_FSSEQ
     16,  // TEXT_FSSF
     30,  // TEXT_FSSNE
     31,  // TEXT_FSST
     15,  // TEXT_FST
      9,  // TEXT_FSUEQ
     11,  // TEXT_FSUGE
     10,  // TEXT_FSUGT
     13,  // TEXT_FSULE
     12,  // TEXT_FSULT
      8,  // TEXT_FSUN
     33,  // TEXT_FTRAPEQ
     65,  // TEXT_FTRAPEQ
     97,  // TEXT_FTRAPEQ
     32,  // TEXT_FTRAPF
     64,  // TEXT_FTRAPF
     96,  // TEXT_FTRAPF
     51,  // TEXT_FTRAPGE
     83,  // TEXT_FTRAPGE
    115,  // TEXT_FTRAPGE
     54,  // TEXT_FTRAPGL
     86,  // TEXT_FTRAPGL
    118,  // TEXT_FTRAPGL
     55,  // TEXT_FTRAPGLE
     87,  // TEXT_FTRAPGLE
    119,  // TEXT_FTRAPGLE
     50,  // TEXT_FTRAPGT
     82,  // TEXT_FTRAPGT
    114,  // TEXT_FTRAPGT
     53,  // TEXT_FTRAPLE
     85,  // TEXT_FTRAPLE
    117,  // TEXT_FTRAPLE
     52,  // TEXT_FTRAPLT
     84,  // TEXT_FTRAPLT
    116,  // TEXT_FTRAPLT
     46,  // TEXT_FTRAPNE
     78,  // TEXT_FTRAPNE
    110,  // TEXT_FTRAPNE
     60,  // TEXT_FTRAPNGE
     92,  // TEXT_FTRAPNGE
    124,  // TEXT_FTRAPNGE
     57,  // TEXT_FTRAPNGL
     89,  // TEXT_FTRAPNGL
    121,  // TEXT_FTRAPNGL
     56,  // TEXT_FTRAPNGLE
     88,  // TEXT_FTRAPNGLE
    120,  // TEXT_FTRAPNGLE
     61,  // TEXT_FTRAPNGT
     93,  // TEXT_FTRAPNGT
    125,  // TEXT_FTRAPNGT
     58,  // TEXT_FTRAPNLE
     90,  // TEXT_FTRAPNLE
    122,  // TEXT_FTRAPNLE
     59,  // TEXT_FTRAPNLT
     91,  // TEXT_FTRAPNLT
    123,  // TEXT_FTRAPNLT
     35,  // TEXT_FTRAPOGE
     67,  // TEXT_FTRAPOGE
     99,  // TEXT_FTRAPOGE
     38,  // TEXT_FTRAPOGL
     70,  // TEXT_FTRAPOGL
    102,  // TEXT_FTRAPOGL
     34,  // TEXT_FTRAPOGT
     66,  // TEXT_FTRAPOGT
     98,  // TEXT_FTRAPOGT
     37,  // TEXT_FTRAPOLE
     69,  // TEXT_FTRAPOLE
    101,  // TEXT_FTRAPOLE
     36,  // TEXT_FTRAPOLT
     68,  // TEXT_FTRAPOLT
    100,  // TEXT_FTRAPOLT
     39,  // TEXT_FTRAPOR
     71,  // TEXT_FTRAPOR
    103,  // TEXT_FTRAPOR
     49,  // TEXT_FTRAPSEQ
     81,  // TEXT_FTRAPSEQ
    113,  // TEXT_FTRAPSEQ
     48,  // TEXT_FTRAPSF
     80,  // TEXT_FTRAPSF
    112,  // TEXT_FTRAPSF
     62,  // TEXT_FTRAPSNE
     94,  // TEXT_FTRAPSNE
    126,  // TEXT_FTRAPSNE
     63,  // TEXT_FTRAPST
     95,  // TEXT_FTRAPST
    127,  // TEXT_FTRAPST
     47,  // TEXT_FTRAPT
     79,  // TEXT_FTRAPT
    111,  // TEXT_FTRAPT
     41,  // TEXT_FTRAPUEQ
     73,  // TEXT_FTRAPUEQ
    105,  // TEXT_FTRAPUEQ
     43,  // TEXT_FTRAPUGE
     75,  // TEXT_FTRAPUGE
    107,  // TEXT_FTRAPUGE
     42,  // TEXT_FTRAPUGT
     74,  // TEXT_FTRAPUGT
    106,  // TEXT_FTRAPUGT
     45,  // TEXT_FTRAPULE
     77,  // TEXT_FTRAPULE
    109,  // TEXT_FTRAPULE
     44,  // TEXT_FTRAPULT
     76,  // TEXT_FTRAPULT
    108,  // TEXT_FTRAPULT
     40,  // TEXT_FTRAPUN
     72,  // TEXT_FTRAPUN
    104,  // TEXT_FTRAPUN
};

constexpr Entry MC68040_FPU_TABLE[] = {
    X2(0xF200, TEXT_FSMOVE, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0040, PF_1F80),
    X2(0xF200, TEXT_FSSQRT, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0041, PF_1F80),
    X2(0xF200, TEXT_FDMOVE, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0044, PF_1F80),
    X2(0xF200, TEXT_FDSQRT, ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0045, PF_1F80),
    X2(0xF200, TEXT_FSABS,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0058, PF_1F80),
    X2(0xF200, TEXT_FDABS,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x005C, PF_1F80),
    X2(0xF200, TEXT_FSNEG,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x005A, PF_1F80),
    X2(0xF200, TEXT_FDNEG,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x005E, PF_1F80),
    X2(0xF200, TEXT_FSDIV,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0060, PF_1F80),
    X2(0xF200, TEXT_FSADD,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0062, PF_1F80),
    X2(0xF200, TEXT_FSMUL,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0063, PF_1F80),
    X2(0xF200, TEXT_FDDIV,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0064, PF_1F80),
    X2(0xF200, TEXT_FDADD,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0066, PF_1F80),
    X2(0xF200, TEXT_FDMUL,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0067, PF_1F80),
    X2(0xF200, TEXT_FSSUB,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x0068, PF_1F80),
    X2(0xF200, TEXT_FDSUB,  ISZ_FIXD, M_FPREG, M_FPREG, EX_RX, EX_RY, SZ_XTND, CF_0000, 0x006C, PF_1F80),
    X2(0xF200, TEXT_FSSQRT, ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0041, PF_1C00),
    X2(0xF200, TEXT_FDSQRT, ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0045, PF_1C00),
    X2(0xF200, TEXT_FSABS,  ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x0058, PF_1C00),
    X2(0xF200, TEXT_FDABS,  ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x005C, PF_1C00),
    X2(0xF200, TEXT_FSNEG,  ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x005A, PF_1C00),
    X2(0xF200, TEXT_FDNEG,  ISZ_FIXD, M_FPREG, M_NONE,  EX_RX, OP___, SZ_XTND, CF_0000, 0x005E, PF_1C00),
    X2(0xF200, TEXT_FSMOVE, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4040, PF_0380),
    X2(0xF200, TEXT_FSSQRT, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4041, PF_0380),
    X2(0xF200, TEXT_FDMOVE, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4044, PF_0380),
    X2(0xF200, TEXT_FDSQRT, ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4045, PF_0380),
    X2(0xF200, TEXT_FSABS,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4058, PF_0380),
    X2(0xF200, TEXT_FDABS,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x405C, PF_0380),
    X2(0xF200, TEXT_FSNEG,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x405A, PF_0380),
    X2(0xF200, TEXT_FDNEG,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x405E, PF_0380),
    X2(0xF200, TEXT_FSDIV,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4060, PF_0380),
    X2(0xF200, TEXT_FSADD,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4062, PF_0380),
    X2(0xF200, TEXT_FSMUL,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4063, PF_0380),
    X2(0xF200, TEXT_FDDIV,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4064, PF_0380),
    X2(0xF200, TEXT_FDADD,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4066, PF_0380),
    X2(0xF200, TEXT_FDMUL,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4067, PF_0380),
    X2(0xF200, TEXT_FSSUB,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x4068, PF_0380),
    X2(0xF200, TEXT_FDSUB,  ISZ_FDAT, M_RDATA, M_FPREG, OP_10, EX_RY, SZ_FDAT, CF_0077, 0x406C, PF_0380),
};

constexpr uint8_t MC68040_FPU_INDEX[] = {
      5,  // TEXT_FDABS
     19,  // TEXT_FDABS
     27,  // TEXT_FDABS
     12,  // TEXT_FDADD
     34,  // TEXT_FDADD
     11,  // TEXT_FDDIV
     33,  // TEXT_FDDIV
      2,  // TEXT_FDMOVE
     24,  // TEXT_FDMOVE
     13,  // TEXT_FDMUL
     35,  // TEXT_FDMUL
      7,  // TEXT_FDNEG
     21,  // TEXT_FDNEG
     29,  // TEXT_FDNEG
      3,  // TEXT_FDSQRT
     17,  // TEXT_FDSQRT
     25,  // TEXT_FDSQRT
     15,  // TEXT_FDSUB
     37,  // TEXT_FDSUB
      4,  // TEXT_FSABS
     18,  // TEXT_FSABS
     26,  // TEXT_FSABS
      9,  // TEXT_FSADD
     31,  // TEXT_FSADD
      8,  // TEXT_FSDIV
     30,  // TEXT_FSDIV
      0,  // TEXT_FSMOVE
     22,  // TEXT_FSMOVE
     10,  // TEXT_FSMUL
     32,  // TEXT_FSMUL
      6,  // TEXT_FSNEG
     20,  // TEXT_FSNEG
     28,  // TEXT_FSNEG
      1,  // TEXT_FSSQRT
     16,  // TEXT_FSSQRT
     23,  // TEXT_FSSQRT
     14,  // TEXT_FSSUB
     36,  // TEXT_FSSUB
};

#endif

#if !defined(LIBASM_MC68000_NOPMMU)

constexpr Entry MC68851_TABLE[] PROGMEM = {
    X0(0xF000, TEXT_PFLUSHA,  CF_0077, 0x2400, PF_0000),
    X2(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_IMFC,  M_IMFM, EX_PFC,  EX_PFM, SZ_NONE, CF_0077, 0x3010, PF_01EF),
    X2(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_DREG,  M_IMFM, EX_DC,   EX_PFM, SZ_NONE, CF_0077, 0x3008, PF_01E7),
    X2(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_PFC,   M_IMFM, EX_PFC,  EX_PFM, SZ_NONE, CF_0077, 0x3000, PF_01E7),
    X2(0xF000, TEXT_PFLUSHS,  ISZ_NONE, M_IMFC,  M_IMFM, EX_PFC,  EX_PFM, SZ_NONE, CF_0077, 0x3410, PF_01EF),
    X2(0xF000, TEXT_PFLUSHS,  ISZ_NONE, M_DREG,  M_IMFM, EX_DC,   EX_PFM, SZ_NONE, CF_0077, 0x3408, PF_01E7),
    X2(0xF000, TEXT_PFLUSHS,  ISZ_NONE, M_PFC,   M_IMFM, EX_PFC,  EX_PFM, SZ_NONE, CF_0077, 0x3400, PF_01E7),
    X3(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_IMFC,  M_IMFM, M_PADDR, EX_PFC, EX_PFM, OP_10, SZ_NONE, CF_0077, 0x3810, PF_01EF),
    X3(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_DREG,  M_IMFM, M_PADDR, EX_DC,  EX_PFM, OP_10, SZ_NONE, CF_0077, 0x3808, PF_01E7),
    X3(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_PFC,   M_IMFM, M_PADDR, EX_PFC, EX_PFM, OP_10, SZ_NONE, CF_0077, 0x3800, PF_01E7),
    X3(0xF000, TEXT_PFLUSHS,  ISZ_NONE, M_IMFC,  M_IMFM, M_PADDR, EX_PFC, EX_PFM, OP_10, SZ_NONE, CF_0077, 0x3C10, PF_01EF),
    X3(0xF000, TEXT_PFLUSHS,  ISZ_NONE, M_DREG,  M_IMFM, M_PADDR, EX_DC,  EX_PFM, OP_10, SZ_NONE, CF_0077, 0x3C08, PF_01E7),
    X3(0xF000, TEXT_PFLUSHS,  ISZ_NONE, M_PFC,   M_IMFM, M_PADDR, EX_PFC, EX_PFM, OP_10, SZ_NONE, CF_0077, 0x3C00, PF_01E7),
    P1(0xF000, TEXT_PFLUSHR,  ISZ_NONE, M_MROOT, OP_10,  SZ_QUAD, CF_0077, 0xA000),
    X2(0xF000, TEXT_PLOADR,   ISZ_NONE, M_IMFC,  M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x2210, PF_000F),
    X2(0xF000, TEXT_PLOADR,   ISZ_NONE, M_DREG,  M_PADDR, EX_DC,  OP_10, SZ_NONE, CF_0077, 0x2208, PF_0007),
    X2(0xF000, TEXT_PLOADR,   ISZ_NONE, M_PFC,   M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x2200, PF_0007),
    X2(0xF000, TEXT_PLOADW,   ISZ_NONE, M_IMFC,  M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x2010, PF_000F),
    X2(0xF000, TEXT_PLOADW,   ISZ_NONE, M_DREG,  M_PADDR, EX_DC,  OP_10, SZ_NONE, CF_0077, 0x2008, PF_0007),
    X2(0xF000, TEXT_PLOADW,   ISZ_NONE, M_PFC,   M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x2000, PF_0007),
    X2(0xF000, TEXT_PMOVE,    ISZ_FIXD, M_PREG,  M_WADDR, EX_PR,  OP_10, SZ_PMMU, CF_0077, 0x4200, PF_3C1C),
    X2(0xF000, TEXT_PMOVE,    ISZ_FIXD, M_RADDR, M_PREG,  OP_10,  EX_PR, SZ_PMMU, CF_0077, 0x4000, PF_3C1C),
    X3(0xF000, TEXT_PTESTR,   ISZ_NONE, M_IMFC,  M_PADDR, M_IMLV, EX_PFC, OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8210, PF_1C0F),
    X3(0xF000, TEXT_PTESTR,   ISZ_NONE, M_DREG,  M_PADDR, M_IMLV, EX_DC,  OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8208, PF_1C07),
    X3(0xF000, TEXT_PTESTR,   ISZ_NONE, M_PFC,   M_PADDR, M_IMLV, EX_PFC, OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8200, PF_1C07),
    X3(0xF000, TEXT_PTESTW,   ISZ_NONE, M_IMFC,  M_PADDR, M_IMLV, EX_PFC, OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8010, PF_1C0F),
    X3(0xF000, TEXT_PTESTW,   ISZ_NONE, M_DREG,  M_PADDR, M_IMLV, EX_DC,  OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8008, PF_1C07),
    X3(0xF000, TEXT_PTESTW,   ISZ_NONE, M_PFC,   M_PADDR, M_IMLV, EX_PFC, OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8000, PF_1C07),
    X4(0xF000, TEXT_PTESTR,   ISZ_NONE, M_IMFC,  M_PADDR, M_IMLV, M_AREG, EX_PFC, OP_10, EX_RX, SZ_NONE, CF_0077, 0x8310, PF_1CEF),
    X4(0xF000, TEXT_PTESTR,   ISZ_NONE, M_DREG,  M_PADDR, M_IMLV, M_AREG, EX_DC,  OP_10, EX_RX, SZ_NONE, CF_0077, 0x8308, PF_1CE7),
    X4(0xF000, TEXT_PTESTR,   ISZ_NONE, M_PFC,   M_PADDR, M_IMLV, M_AREG, EX_PFC, OP_10, EX_RX, SZ_NONE, CF_0077, 0x8300, PF_1CE7),
    X4(0xF000, TEXT_PTESTW,   ISZ_NONE, M_IMFC,  M_PADDR, M_IMLV, M_AREG, EX_PFC, OP_10, EX_RX, SZ_NONE, CF_0077, 0x8110, PF_1CEF),
    X4(0xF000, TEXT_PTESTW,   ISZ_NONE, M_DREG,  M_PADDR, M_IMLV, M_AREG, EX_DC,  OP_10, EX_RX, SZ_NONE, CF_0077, 0x8108, PF_1CE7),
    X4(0xF000, TEXT_PTESTW,   ISZ_NONE, M_PFC,   M_PADDR, M_IMLV, M_AREG, EX_PFC, OP_10, EX_RX, SZ_NONE, CF_0077, 0x8100, PF_1CE7),
    P2(0xF000, TEXT_PVALID,   ISZ_NONE, M_PVAL,  M_PADDR, OP___,  OP_10, SZ_LONG, CF_0077, 0x2800),
    X2(0xF000, TEXT_PVALID,   ISZ_NONE, M_AREG,  M_PADDR, EX_DC,  OP_10, SZ_LONG, CF_0077, 0x2C00, PF_0007),
    E1(0xF140, TEXT_PRESTORE, ISZ_NONE, M_IADDR, OP_10,  SZ_NONE, CF_0077),
    E1(0xF100, TEXT_PSAVE,    ISZ_NONE, M_DADDR, OP_10,  SZ_NONE, CF_0077),
};

constexpr uint8_t MC68851_INDEX[] PROGMEM = {
      1,  // TEXT_PFLUSH
      2,  // TEXT_PFLUSH
      3,  // TEXT_PFLUSH
      7,  // TEXT_PFLUSH
      8,  // TEXT_PFLUSH
      9,  // TEXT_PFLUSH
      0,  // TEXT_PFLUSHA
     13,  // TEXT_PFLUSHR
      4,  // TEXT_PFLUSHS
      5,  // TEXT_PFLUSHS
      6,  // TEXT_PFLUSHS
     10,  // TEXT_PFLUSHS
     11,  // TEXT_PFLUSHS
     12,  // TEXT_PFLUSHS
     14,  // TEXT_PLOADR
     15,  // TEXT_PLOADR
     16,  // TEXT_PLOADR
     17,  // TEXT_PLOADW
     18,  // TEXT_PLOADW
     19,  // TEXT_PLOADW
     20,  // TEXT_PMOVE
     21,  // TEXT_PMOVE
     36,  // TEXT_PRESTORE
     37,  // TEXT_PSAVE
     22,  // TEXT_PTESTR
     23,  // TEXT_PTESTR
     24,  // TEXT_PTESTR
     28,  // TEXT_PTESTR
     29,  // TEXT_PTESTR
     30,  // TEXT_PTESTR
     25,  // TEXT_PTESTW
     26,  // TEXT_PTESTW
     27,  // TEXT_PTESTW
     31,  // TEXT_PTESTW
     32,  // TEXT_PTESTW
     33,  // TEXT_PTESTW
     34,  // TEXT_PVALID
     35,  // TEXT_PVALID
};

constexpr Entry MC68851_BRANCH[] PROGMEM = {
    E1(0xF080, TEXT_PBBS,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF081, TEXT_PBBC,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF082, TEXT_PBLS,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF083, TEXT_PBLC,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF084, TEXT_PBSS,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF085, TEXT_PBSC,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF086, TEXT_PBAS,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF087, TEXT_PBAC,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF088, TEXT_PBWS,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF089, TEXT_PBWC,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF08A, TEXT_PBIS,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF08B, TEXT_PBIC,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF08C, TEXT_PBGS,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF08D, TEXT_PBGC,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF08E, TEXT_PBCS,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    E1(0xF08F, TEXT_PBCC,  ISZ_NONE, M_REL32, OP___ ,SZ_LONG, CF_0100),
    P2(0xF048, TEXT_PDBBS, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0000),
    P2(0xF048, TEXT_PDBBC, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0001),
    P2(0xF048, TEXT_PDBLS, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0002),
    P2(0xF048, TEXT_PDBLC, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0003),
    P2(0xF048, TEXT_PDBSS, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0004),
    P2(0xF048, TEXT_PDBSC, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0005),
    P2(0xF048, TEXT_PDBAS, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0006),
    P2(0xF048, TEXT_PDBAC, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0007),
    P2(0xF048, TEXT_PDBWS, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0008),
    P2(0xF048, TEXT_PDBWC, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x0009),
    P2(0xF048, TEXT_PDBIS, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000A),
    P2(0xF048, TEXT_PDBIC, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000B),
    P2(0xF048, TEXT_PDBGS, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000C),
    P2(0xF048, TEXT_PDBGC, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000D),
    P2(0xF048, TEXT_PDBCS, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000E),
    P2(0xF048, TEXT_PDBCC, ISZ_NONE, M_DREG, M_REL16, OP__0, OP___, SZ_WORD, CF_0007, 0x000F),
};

constexpr uint8_t MC68851_BRANCH_INDEX[] PROGMEM = {
      7,  // TEXT_PBAC
      6,  // TEXT_PBAS
      1,  // TEXT_PBBC
      0,  // TEXT_PBBS
     15,  // TEXT_PBCC
     14,  // TEXT_PBCS
     13,  // TEXT_PBGC
     12,  // TEXT_PBGS
     11,  // TEXT_PBIC
     10,  // TEXT_PBIS
      3,  // TEXT_PBLC
      2,  // TEXT_PBLS
      5,  // TEXT_PBSC
      4,  // TEXT_PBSS
      9,  // TEXT_PBWC
      8,  // TEXT_PBWS
     23,  // TEXT_PDBAC
     22,  // TEXT_PDBAS
     17,  // TEXT_PDBBC
     16,  // TEXT_PDBBS
     31,  // TEXT_PDBCC
     30,  // TEXT_PDBCS
     29,  // TEXT_PDBGC
     28,  // TEXT_PDBGS
     27,  // TEXT_PDBIC
     26,  // TEXT_PDBIS
     19,  // TEXT_PDBLC
     18,  // TEXT_PDBLS
     21,  // TEXT_PDBSC
     20,  // TEXT_PDBSS
     25,  // TEXT_PDBWC
     24,  // TEXT_PDBWS
};

constexpr Entry MC68851_TRAP[] PROGMEM = {
    P1(0xF040, TEXT_PSBS, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0000),
    P1(0xF040, TEXT_PSBC, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0001),
    P1(0xF040, TEXT_PSLS, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0002),
    P1(0xF040, TEXT_PSLC, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0003),
    P1(0xF040, TEXT_PSSS, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0004),
    P1(0xF040, TEXT_PSSC, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0005),
    P1(0xF040, TEXT_PSAS, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0006),
    P1(0xF040, TEXT_PSAC, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0007),
    P1(0xF040, TEXT_PSWS, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0008),
    P1(0xF040, TEXT_PSWC, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x0009),
    P1(0xF040, TEXT_PSIS, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000A),
    P1(0xF040, TEXT_PSIC, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000B),
    P1(0xF040, TEXT_PSGS, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000C),
    P1(0xF040, TEXT_PSGC, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000D),
    P1(0xF040, TEXT_PSCS, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000E),
    P1(0xF040, TEXT_PSCC, ISZ_NONE, M_WDATA, OP_10, SZ_BYTE, CF_0077, 0x000F),
    P1(0xF07A, TEXT_PTRAPBS, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0000),
    P1(0xF07A, TEXT_PTRAPBC, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0001),
    P1(0xF07A, TEXT_PTRAPLS, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0002),
    P1(0xF07A, TEXT_PTRAPLC, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0003),
    P1(0xF07A, TEXT_PTRAPSS, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0004),
    P1(0xF07A, TEXT_PTRAPSC, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0005),
    P1(0xF07A, TEXT_PTRAPAS, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0006),
    P1(0xF07A, TEXT_PTRAPAC, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0007),
    P1(0xF07A, TEXT_PTRAPWS, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0008),
    P1(0xF07A, TEXT_PTRAPWC, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x0009),
    P1(0xF07A, TEXT_PTRAPIS, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000A),
    P1(0xF07A, TEXT_PTRAPIC, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000B),
    P1(0xF07A, TEXT_PTRAPGS, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000C),
    P1(0xF07A, TEXT_PTRAPGC, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000D),
    P1(0xF07A, TEXT_PTRAPCS, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000E),
    P1(0xF07A, TEXT_PTRAPCC, ISZ_FIXD, M_IMDAT, OP___, SZ_WORD, CF_0000, 0x000F),
    P1(0xF07B, TEXT_PTRAPBS, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0000),
    P1(0xF07B, TEXT_PTRAPBC, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0001),
    P1(0xF07B, TEXT_PTRAPLS, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0002),
    P1(0xF07B, TEXT_PTRAPLC, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0003),
    P1(0xF07B, TEXT_PTRAPSS, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0004),
    P1(0xF07B, TEXT_PTRAPSC, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0005),
    P1(0xF07B, TEXT_PTRAPAS, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0006),
    P1(0xF07B, TEXT_PTRAPAC, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0007),
    P1(0xF07B, TEXT_PTRAPWS, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0008),
    P1(0xF07B, TEXT_PTRAPWC, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x0009),
    P1(0xF07B, TEXT_PTRAPIS, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000A),
    P1(0xF07B, TEXT_PTRAPIC, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000B),
    P1(0xF07B, TEXT_PTRAPGS, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000C),
    P1(0xF07B, TEXT_PTRAPGC, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000D),
    P1(0xF07B, TEXT_PTRAPCS, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000E),
    P1(0xF07B, TEXT_PTRAPCC, ISZ_FIXD, M_IMDAT, OP___, SZ_LONG, CF_0000, 0x000F),
    P0(0xF07C, TEXT_PTRAPBS, 0x0000),
    P0(0xF07C, TEXT_PTRAPBC, 0x0001),
    P0(0xF07C, TEXT_PTRAPLS, 0x0002),
    P0(0xF07C, TEXT_PTRAPLC, 0x0003),
    P0(0xF07C, TEXT_PTRAPSS, 0x0004),
    P0(0xF07C, TEXT_PTRAPSC, 0x0005),
    P0(0xF07C, TEXT_PTRAPAS, 0x0006),
    P0(0xF07C, TEXT_PTRAPAC, 0x0007),
    P0(0xF07C, TEXT_PTRAPWS, 0x0008),
    P0(0xF07C, TEXT_PTRAPWC, 0x0009),
    P0(0xF07C, TEXT_PTRAPIS, 0x000A),
    P0(0xF07C, TEXT_PTRAPIC, 0x000B),
    P0(0xF07C, TEXT_PTRAPGS, 0x000C),
    P0(0xF07C, TEXT_PTRAPGC, 0x000D),
    P0(0xF07C, TEXT_PTRAPCS, 0x000E),
    P0(0xF07C, TEXT_PTRAPCC, 0x000F),
};

constexpr uint8_t MC68851_TRAP_INDEX[] PROGMEM = {
      7,  // TEXT_PSAC
      6,  // TEXT_PSAS
      1,  // TEXT_PSBC
      0,  // TEXT_PSBS
     15,  // TEXT_PSCC
     14,  // TEXT_PSCS
     13,  // TEXT_PSGC
     12,  // TEXT_PSGS
     11,  // TEXT_PSIC
     10,  // TEXT_PSIS
      3,  // TEXT_PSLC
      2,  // TEXT_PSLS
      5,  // TEXT_PSSC
      4,  // TEXT_PSSS
      9,  // TEXT_PSWC
      8,  // TEXT_PSWS
     23,  // TEXT_PTRAPAC
     39,  // TEXT_PTRAPAC
     55,  // TEXT_PTRAPAC
     22,  // TEXT_PTRAPAS
     38,  // TEXT_PTRAPAS
     54,  // TEXT_PTRAPAS
     17,  // TEXT_PTRAPBC
     33,  // TEXT_PTRAPBC
     49,  // TEXT_PTRAPBC
     16,  // TEXT_PTRAPBS
     32,  // TEXT_PTRAPBS
     48,  // TEXT_PTRAPBS
     31,  // TEXT_PTRAPCC
     47,  // TEXT_PTRAPCC
     63,  // TEXT_PTRAPCC
     30,  // TEXT_PTRAPCS
     46,  // TEXT_PTRAPCS
     62,  // TEXT_PTRAPCS
     29,  // TEXT_PTRAPGC
     45,  // TEXT_PTRAPGC
     61,  // TEXT_PTRAPGC
     28,  // TEXT_PTRAPGS
     44,  // TEXT_PTRAPGS
     60,  // TEXT_PTRAPGS
     27,  // TEXT_PTRAPIC
     43,  // TEXT_PTRAPIC
     59,  // TEXT_PTRAPIC
     26,  // TEXT_PTRAPIS
     42,  // TEXT_PTRAPIS
     58,  // TEXT_PTRAPIS
     19,  // TEXT_PTRAPLC
     35,  // TEXT_PTRAPLC
     51,  // TEXT_PTRAPLC
     18,  // TEXT_PTRAPLS
     34,  // TEXT_PTRAPLS
     50,  // TEXT_PTRAPLS
     21,  // TEXT_PTRAPSC
     37,  // TEXT_PTRAPSC
     53,  // TEXT_PTRAPSC
     20,  // TEXT_PTRAPSS
     36,  // TEXT_PTRAPSS
     52,  // TEXT_PTRAPSS
     25,  // TEXT_PTRAPWC
     41,  // TEXT_PTRAPWC
     57,  // TEXT_PTRAPWC
     24,  // TEXT_PTRAPWS
     40,  // TEXT_PTRAPWS
     56,  // TEXT_PTRAPWS
};

constexpr Entry MC68030_PMMU_TABLE[] PROGMEM = {
    X0(0xF000, TEXT_PFLUSHA,  CF_0077,  0x2400,  PF_0000),
    X2(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_IMFC,  M_IMFM, EX_PFC,  EX_PFM, SZ_NONE, CF_0077, 0x3010, PF_01EF),
    X2(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_DREG,  M_IMFM, EX_DC,   EX_PFM, SZ_NONE, CF_0077, 0x3008, PF_01E7),
    X2(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_PFC,   M_IMFM, EX_PFC,  EX_PFM, SZ_NONE, CF_0077, 0x3000, PF_01E7),
    X3(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_IMFC,  M_IMFM, M_PADDR, EX_PFC, EX_PFM, OP_10, SZ_NONE, CF_0077, 0x3810, PF_01EF),
    X3(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_DREG,  M_IMFM, M_PADDR, EX_DC,  EX_PFM, OP_10, SZ_NONE, CF_0077, 0x3808, PF_01E7),
    X3(0xF000, TEXT_PFLUSH,   ISZ_NONE, M_PFC,   M_IMFM, M_PADDR, EX_PFC, EX_PFM, OP_10, SZ_NONE, CF_0077, 0x3800, PF_01E7),
    X2(0xF000, TEXT_PLOADR,   ISZ_NONE, M_IMFC,  M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x2210, PF_000F),
    X2(0xF000, TEXT_PLOADR,   ISZ_NONE, M_DREG,  M_PADDR, EX_DC,  OP_10, SZ_NONE, CF_0077, 0x2208, PF_0007),
    X2(0xF000, TEXT_PLOADR,   ISZ_NONE, M_PFC,   M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x2200, PF_0007),
    X2(0xF000, TEXT_PLOADW,   ISZ_NONE, M_IMFC,  M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x2010, PF_000F),
    X2(0xF000, TEXT_PLOADW,   ISZ_NONE, M_DREG,  M_PADDR, EX_DC,  OP_10, SZ_NONE, CF_0077, 0x2008, PF_0007),
    X2(0xF000, TEXT_PLOADW,   ISZ_NONE, M_PFC,   M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x2000, PF_0007),
    X2(0xF000, TEXT_PMOVE,    ISZ_FIXD, M_PADDR, M_PREG,  OP_10,  EX_PR, SZ_PMMU, CF_0077, 0x4000, PF_1C00),
    X2(0xF000, TEXT_PMOVE,    ISZ_FIXD, M_PADDR, M_PREG,  OP_10,  EX_PR, SZ_PMMU, CF_0077, 0x6000, PF_1C00),
    X2(0xF000, TEXT_PMOVE,    ISZ_FIXD, M_PADDR, M_PREG,  OP_10,  EX_PR, SZ_PMMU, CF_0077, 0x0000, PF_1C00),
    X2(0xF000, TEXT_PMOVE,    ISZ_FIXD, M_PREG,  M_PADDR, EX_PR,  OP_10, SZ_PMMU, CF_0077, 0x4200, PF_1C00),
    X2(0xF000, TEXT_PMOVE,    ISZ_FIXD, M_PREG,  M_PADDR, EX_PR,  OP_10, SZ_PMMU, CF_0077, 0x6200, PF_1C00),
    X2(0xF000, TEXT_PMOVE,    ISZ_FIXD, M_PREG,  M_PADDR, EX_PR,  OP_10, SZ_PMMU, CF_0077, 0x0200, PF_1C00),
    X2(0xF000, TEXT_PMOVEFD,  ISZ_FIXD, M_PADDR, M_PREG,  OP_10,  EX_PR, SZ_PMMU, CF_0077, 0x4100, PF_1C00),
    X2(0xF000, TEXT_PMOVEFD,  ISZ_FIXD, M_PADDR, M_PREG,  OP_10,  EX_PR, SZ_PMMU, CF_0077, 0x0100, PF_1C00),
    X3(0xF000, TEXT_PTESTR,   ISZ_NONE, M_IMFC,  M_PADDR, M_IMLV, EX_PFC, OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8210, PF_1C0F),
    X3(0xF000, TEXT_PTESTR,   ISZ_NONE, M_DREG,  M_PADDR, M_IMLV, EX_DC,  OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8208, PF_1C07),
    X3(0xF000, TEXT_PTESTR,   ISZ_NONE, M_PFC,   M_PADDR, M_IMLV, EX_PFC, OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8200, PF_1C07),
    X3(0xF000, TEXT_PTESTW,   ISZ_NONE, M_IMFC,  M_PADDR, M_IMLV, EX_PFC, OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8010, PF_1C0F),
    X3(0xF000, TEXT_PTESTW,   ISZ_NONE, M_DREG,  M_PADDR, M_IMLV, EX_DC,  OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8008, PF_1C07),
    X3(0xF000, TEXT_PTESTW,   ISZ_NONE, M_PFC,   M_PADDR, M_IMLV, EX_PFC, OP_10,  EX_RX, SZ_NONE, CF_0077, 0x8000, PF_1C07),
    X4(0xF000, TEXT_PTESTR,   ISZ_NONE, M_IMFC,  M_PADDR, M_IMLV, M_AREG, EX_PFC, OP_10, EX_RX, SZ_NONE, CF_0077, 0x8310, PF_1CEF),
    X4(0xF000, TEXT_PTESTR,   ISZ_NONE, M_DREG,  M_PADDR, M_IMLV, M_AREG, EX_DC,  OP_10, EX_RX, SZ_NONE, CF_0077, 0x8308, PF_1CE7),
    X4(0xF000, TEXT_PTESTR,   ISZ_NONE, M_PFC,   M_PADDR, M_IMLV, M_AREG, EX_PFC, OP_10, EX_RX, SZ_NONE, CF_0077, 0x8300, PF_1CE7),
    X4(0xF000, TEXT_PTESTW,   ISZ_NONE, M_IMFC,  M_PADDR, M_IMLV, M_AREG, EX_PFC, OP_10, EX_RX, SZ_NONE, CF_0077, 0x8110, PF_1CEF),
    X4(0xF000, TEXT_PTESTW,   ISZ_NONE, M_DREG,  M_PADDR, M_IMLV, M_AREG, EX_DC,  OP_10, EX_RX, SZ_NONE, CF_0077, 0x8108, PF_1CE7),
    X4(0xF000, TEXT_PTESTW,   ISZ_NONE, M_PFC,   M_PADDR, M_IMLV, M_AREG, EX_PFC, OP_10, EX_RX, SZ_NONE, CF_0077, 0x8100, PF_1CE7),
};

constexpr uint8_t MC68030_PMMU_INDEX[] PROGMEM = {
      1,  // TEXT_PFLUSH
      2,  // TEXT_PFLUSH
      3,  // TEXT_PFLUSH
      4,  // TEXT_PFLUSH
      5,  // TEXT_PFLUSH
      6,  // TEXT_PFLUSH
      0,  // TEXT_PFLUSHA
      7,  // TEXT_PLOADR
      8,  // TEXT_PLOADR
      9,  // TEXT_PLOADR
     10,  // TEXT_PLOADW
     11,  // TEXT_PLOADW
     12,  // TEXT_PLOADW
     13,  // TEXT_PMOVE
     14,  // TEXT_PMOVE
     15,  // TEXT_PMOVE
     16,  // TEXT_PMOVE
     17,  // TEXT_PMOVE
     18,  // TEXT_PMOVE
     19,  // TEXT_PMOVEFD
     20,  // TEXT_PMOVEFD
     21,  // TEXT_PTESTR
     22,  // TEXT_PTESTR
     23,  // TEXT_PTESTR
     27,  // TEXT_PTESTR
     28,  // TEXT_PTESTR
     29,  // TEXT_PTESTR
     24,  // TEXT_PTESTW
     25,  // TEXT_PTESTW
     26,  // TEXT_PTESTW
     30,  // TEXT_PTESTW
     31,  // TEXT_PTESTW
     32,  // TEXT_PTESTW
};

constexpr Entry MC68EC030_PMMU_TABLE[] PROGMEM = {
    X2(0xF000, TEXT_PMOVE,  ISZ_FIXD, M_PADDR, M_PREG,  OP_10,  EX_PR, SZ_PMMU, CF_0077, 0x0000, PF_1C00),
    X2(0xF000, TEXT_PMOVE,  ISZ_FIXD, M_PADDR, M_PREG,  OP_10,  EX_PR, SZ_PMMU, CF_0077, 0x6000, PF_1C00),
    X2(0xF000, TEXT_PMOVE,  ISZ_FIXD, M_PREG,  M_PADDR, EX_PR,  OP_10, SZ_PMMU, CF_0077, 0x0200, PF_1C00),
    X2(0xF000, TEXT_PMOVE,  ISZ_FIXD, M_PREG,  M_PADDR, EX_PR,  OP_10, SZ_PMMU, CF_0077, 0x6200, PF_1C00),
    X2(0xF000, TEXT_PTESTR, ISZ_NONE, M_IMFC,  M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x8210, PF_000F),
    X2(0xF000, TEXT_PTESTR, ISZ_NONE, M_DREG,  M_PADDR, EX_DC,  OP_10, SZ_NONE, CF_0077, 0x8208, PF_0007),
    X2(0xF000, TEXT_PTESTR, ISZ_NONE, M_PFC,   M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x8200, PF_0007),
    X2(0xF000, TEXT_PTESTW, ISZ_NONE, M_IMFC,  M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x8010, PF_000F),
    X2(0xF000, TEXT_PTESTW, ISZ_NONE, M_DREG,  M_PADDR, EX_DC,  OP_10, SZ_NONE, CF_0077, 0x8008, PF_0007),
    X2(0xF000, TEXT_PTESTW, ISZ_NONE, M_PFC,   M_PADDR, EX_PFC, OP_10, SZ_NONE, CF_0077, 0x8000, PF_0007),
};

constexpr uint8_t MC68EC030_PMMU_INDEX[] PROGMEM = {
      0,  // TEXT_PMOVE
      1,  // TEXT_PMOVE
      2,  // TEXT_PMOVE
      3,  // TEXT_PMOVE
      4,  // TEXT_PTESTR
      5,  // TEXT_PTESTR
      6,  // TEXT_PTESTR
      7,  // TEXT_PTESTW
      8,  // TEXT_PTESTW
      9,  // TEXT_PTESTW
};

constexpr Entry MC68040_PMMU_TABLE[] PROGMEM = {
    E1(0172400, TEXT_PFLUSHN,  ISZ_NONE, M_AIND,  OP__0,  SZ_NONE, CF_0007),
    E1(0172410, TEXT_PFLUSH,   ISZ_NONE, M_AIND,  OP__0,  SZ_NONE, CF_0007),
    E0(0172420, TEXT_PFLUSHAN),
    E0(0172430, TEXT_PFLUSHA),
    E1(0172510, TEXT_PTESTW,   ISZ_NONE, M_AIND,  OP__0,  SZ_NONE, CF_0007),
    E1(0172550, TEXT_PTESTR,   ISZ_NONE, M_AIND,  OP__0,  SZ_NONE, CF_0007),
};

constexpr uint8_t MC68040_PMMU_INDEX[] PROGMEM = {
      1,  // TEXT_PFLUSH
      3,  // TEXT_PFLUSHA
      2,  // TEXT_PFLUSHAN
      0,  // TEXT_PFLUSHN
      5,  // TEXT_PTESTR
      4,  // TEXT_PTESTW
};

#endif
// clang-format on

using EntryPage = entry::TableBase<Entry>;

constexpr EntryPage MC68000_PAGES[] PROGMEM = {
        {ARRAY_RANGE(MC68000_TABLE), ARRAY_RANGE(MC68000_INDEX)},
};

constexpr EntryPage MC68010_PAGES[] PROGMEM = {
        {ARRAY_RANGE(MC68010_TABLE), ARRAY_RANGE(MC68010_INDEX)},
        {ARRAY_RANGE(MC68000_TABLE), ARRAY_RANGE(MC68000_INDEX)},
};

constexpr EntryPage MC68020_PAGES[] PROGMEM = {
        {ARRAY_RANGE(MC68020_TABLE), ARRAY_RANGE(MC68020_INDEX)},
        {ARRAY_RANGE(MC68010_TABLE), ARRAY_RANGE(MC68010_INDEX)},
        {ARRAY_RANGE(MC68000_TABLE), ARRAY_RANGE(MC68000_INDEX)},
        {ARRAY_RANGE(MC68020_MODULE), ARRAY_RANGE(MC68020_MODULE_INDEX)},
};

constexpr EntryPage MC68030_PAGES[] PROGMEM = {
        {ARRAY_RANGE(MC68020_TABLE), ARRAY_RANGE(MC68020_INDEX)},
        {ARRAY_RANGE(MC68010_TABLE), ARRAY_RANGE(MC68010_INDEX)},
        {ARRAY_RANGE(MC68000_TABLE), ARRAY_RANGE(MC68000_INDEX)},
};

constexpr EntryPage MC68040_PAGES[] PROGMEM = {
        {ARRAY_RANGE(MC68040_TABLE), ARRAY_RANGE(MC68040_INDEX)},
        {ARRAY_RANGE(MC68020_TABLE), ARRAY_RANGE(MC68020_INDEX)},
        {ARRAY_RANGE(MC68010_TABLE), ARRAY_RANGE(MC68010_INDEX)},
        {ARRAY_RANGE(MC68000_TABLE), ARRAY_RANGE(MC68000_INDEX)},
};

#if !defined(LIBASM_MC68000_NOFPU)
constexpr EntryPage MC68881_PAGES[] PROGMEM = {
        {ARRAY_RANGE(FPU_COMMON), ARRAY_RANGE(FPU_COMMON_INDEX)},
        {ARRAY_RANGE(MC68881_TABLE), ARRAY_RANGE(MC68881_INDEX)},
        {ARRAY_RANGE(FPU_BRANCH), ARRAY_RANGE(FPU_BRANCH_INDEX)},
        {ARRAY_RANGE(FPU_TRAP), ARRAY_RANGE(FPU_TRAP_INDEX)},
};

constexpr EntryPage MC68040_FPU_PAGES[] PROGMEM = {
        {ARRAY_RANGE(FPU_COMMON), ARRAY_RANGE(FPU_COMMON_INDEX)},
        {ARRAY_RANGE(MC68040_FPU_TABLE), ARRAY_RANGE(MC68040_FPU_INDEX)},
        {ARRAY_RANGE(FPU_BRANCH), ARRAY_RANGE(FPU_BRANCH_INDEX)},
        {ARRAY_RANGE(FPU_TRAP), ARRAY_RANGE(FPU_TRAP_INDEX)},
};
#endif

#if !defined(LIBASM_MC68000_NOPMMU)
constexpr EntryPage MC68851_PAGES[] PROGMEM = {
        {ARRAY_RANGE(MC68851_TABLE), ARRAY_RANGE(MC68851_INDEX)},
        {ARRAY_RANGE(MC68851_BRANCH), ARRAY_RANGE(MC68851_BRANCH_INDEX)},
        {ARRAY_RANGE(MC68851_TRAP), ARRAY_RANGE(MC68851_TRAP_INDEX)},
};

constexpr EntryPage MC68EC030_PMMU_PAGES[] PROGMEM = {
        {ARRAY_RANGE(MC68EC030_PMMU_TABLE), ARRAY_RANGE(MC68EC030_PMMU_INDEX)},
};

constexpr EntryPage MC68030_PMMU_PAGES[] PROGMEM = {
        {ARRAY_RANGE(MC68030_PMMU_TABLE), ARRAY_RANGE(MC68030_PMMU_INDEX)},
};

constexpr EntryPage MC68040_PMMU_PAGES[] PROGMEM = {
        {ARRAY_RANGE(MC68040_PMMU_TABLE), ARRAY_RANGE(MC68040_PMMU_INDEX)},
};
#endif

using Cpu = entry::CpuBase<CpuType, EntryPage>;

constexpr Cpu CPU_TABLE[] PROGMEM = {
        {MC68000, TEXT_CPU_68000, ARRAY_RANGE(MC68000_PAGES)},
        {MC68010, TEXT_CPU_68010, ARRAY_RANGE(MC68010_PAGES)},
        {MC68020, TEXT_CPU_68020, ARRAY_RANGE(MC68020_PAGES)},
        {MC68030, TEXT_CPU_68030, ARRAY_RANGE(MC68030_PAGES)},
        {MC68040, TEXT_CPU_68040, ARRAY_RANGE(MC68040_PAGES)},
};

const Cpu *cpu(CpuType cpuType) {
    return Cpu::search(cpuType, ARRAY_RANGE(CPU_TABLE));
}

#define EMPTY_RANGE(a) ARRAY_BEGIN(a), ARRAY_BEGIN(a)

#if !defined(LIBASM_MC68000_NOFPU)
using Fpu = entry::CpuBase<FpuType, EntryPage>;

constexpr Fpu FPU_TABLE[] PROGMEM = {
        {FPU_MC68881, TEXT_FPU_68881, ARRAY_RANGE(MC68881_PAGES)},
        {FPU_MC68040, TEXT_CPU_68040, ARRAY_RANGE(MC68040_FPU_PAGES)},
        {FPU_NONE, TEXT_none, EMPTY_RANGE(MC68881_PAGES)},
};

const Fpu *fpu(FpuType fpuType) {
    return Fpu::search(fpuType, ARRAY_RANGE(FPU_TABLE));
}
#endif

#if !defined(LIBASM_MC68000_NOPMMU)
using Pmmu = entry::CpuBase<PmmuType, EntryPage>;

constexpr Pmmu PMMU_TABLE[] PROGMEM = {
        {PMMU_MC68EC030, TEXT_PMMU_68EC030, ARRAY_RANGE(MC68EC030_PMMU_PAGES)},
        {PMMU_MC68EC040, TEXT_PMMU_68EC040, EMPTY_RANGE(MC68040_PMMU_PAGES)},
        {PMMU_MC68851, TEXT_PMMU_68851, ARRAY_RANGE(MC68851_PAGES)},
        {PMMU_MC68030, TEXT_CPU_68030, ARRAY_RANGE(MC68030_PMMU_PAGES)},
        {PMMU_MC68040, TEXT_CPU_68040, ARRAY_RANGE(MC68040_PMMU_PAGES)},
        {PMMU_NONE, TEXT_none, EMPTY_RANGE(MC68851_PAGES)},
};

const Pmmu *pmmu(PmmuType pmmuType) {
    return Pmmu::search(pmmuType, ARRAY_RANGE(PMMU_TABLE));
}
#endif

bool hasOperand(const CpuSpec &cpuSpec, AsmInsn &insn) {
    cpu(cpuSpec.cpu)->searchName(insn, Cpu::acceptAll<AsmInsn, Entry>);
#if !defined(LIBASM_MC68000_NOFPU)
    if (!insn.isOK())
        fpu(cpuSpec.fpu)->searchName(insn, Cpu::acceptAll<AsmInsn, Entry>);
#endif
#if !defined(LIBASM_MC68000_NOPMMU)
    if (!insn.isOK())
        pmmu(cpuSpec.pmmu)->searchName(insn, Cpu::acceptAll<AsmInsn, Entry>);
#endif
    return insn.isOK() && insn.src() != M_NONE;
}

bool genericAddressing(AddrMode mode) {
    return mode >= M_RADDR && mode <= M_DADDR;
}

bool miscImmediate(AddrMode mode) {
    if (mode == M_IMBIT || mode == M_IM3 || mode == M_IM8 || mode == M_IMVEC || mode == M_IMDSP)
        return true;
#if !defined(LIBASM_MC68000_NOFPU)
    if (mode == M_IMROM)
        return true;
#endif
#if !defined(LIBASM_MC68000_NOPMMU)
    if (mode == M_IMFC || mode == M_IMFM || mode == M_IMLV)
        return true;
#endif
    return false;
}

bool acceptMode(AddrMode opr, AddrMode table, OprSize size) {
    if (opr == table)
        return true;
    if (opr == M_DREG)
        return genericAddressing(table) || table == M_MULT || table == M_GREG;
    if (opr == M_AREG)
        return genericAddressing(table) || table == M_MULT || table == M_GREG;
    if (opr == M_IMDAT)
        return genericAddressing(table) || miscImmediate(table);
    if (opr >= M_AIND && opr <= M_PCIDX)
        return genericAddressing(table);
    if (opr == M_LABEL)
        return table == M_REL8 || table == M_REL16 || table == M_REL32;
    if (opr == M_USP)
        return table == M_CREG;
#if !defined(LIBASM_MC68000_NOFPU)
    if (opr == M_IMFLT)
        return genericAddressing(table) && size == SZ_FDAT;
    if (opr == M_FPREG)
        return table == M_FPMLT;
    if (opr == M_FPCR || opr == M_FPSR || opr == M_FPIAR)
        return table == M_FCMLT;
    if (opr == M_NONE)
        return table == M_KFACT;
#endif
#if !defined(LIBASM_MC68000_NOPMMU)
    if (opr == M_PADDR || opr == M_MROOT)
        return genericAddressing(table);
    if (opr == M_PREG)
        return table == M_PVAL;
    if (opr == M_CREG)
        return table == M_PFC;
#endif
    return false;
}

bool acceptSize(const AsmInsn &insn, const Entry::Flags &flags) {
    const auto insnSize = insn.insnSize();
    const auto opr = flags.oprSize();
    if (insnSize == InsnSize(opr))
        return true;
    const auto src = flags.src();
    if (src == M_REL8 || src == M_REL16 || src == M_REL32 || flags.dst() == M_REL16)
        return insnSize == ISZ_NONE || insnSize == ISZ_BYTE || insnSize == ISZ_SNGL ||
               insnSize == ISZ_WORD || insnSize == ISZ_LONG || insnSize == ISZ_XTND;
    if (insnSize == ISZ_BYTE)
        return opr == SZ_DATA
#if !defined(LIBASM_MC68000_NOFPU)
               || opr == SZ_FDAT
#endif
               || opr == SZ_DATH || opr == SZ_CAS1
#if !defined(LIBASM_MC68000_NOPMMU)
               || opr == SZ_PMMU
#endif
                ;
    if (insnSize == ISZ_WORD || insnSize == ISZ_LONG)
        return opr == SZ_DATA || opr == SZ_ADDR || opr == SZ_ADR8
#if !defined(LIBASM_MC68000_NOFPU)
               || opr == SZ_FDAT
#endif
               || opr == SZ_DATH || opr == SZ_CAS1 || opr == SZ_CAS2
#if !defined(LIBASM_MC68000_NOPMMU)
               || opr == SZ_PMMU
#endif
                ;
#if !defined(LIBASM_MC68000_NOPMMU)
    if (insnSize == ISZ_QUAD)
        return opr == SZ_PMMU;
#endif
#if !defined(LIBASM_MC68000_NOFPU)
    if (insnSize == ISZ_SNGL || insnSize == ISZ_DUBL || insnSize == ISZ_XTND ||
            insnSize == ISZ_PBCD)
        return opr == SZ_FDAT;
#endif
    if (insnSize == ISZ_NONE) {
        const auto table = flags.insnSize();
        return opr == SZ_DATA || opr == SZ_ADDR || opr == SZ_ADR8 || opr == SZ_WORD ||
               table == ISZ_NONE || table == ISZ_FIXD;
    }
    return false;
}

bool acceptModes(AsmInsn &insn, const Entry *entry) {
    const auto table = entry->readFlags();
    return acceptMode(insn.srcOp.mode, table.src(), table.oprSize()) &&
           acceptMode(insn.dstOp.mode, table.dst(), table.oprSize()) &&
           acceptMode(insn.ex1Op.mode, table.ex1(), table.oprSize()) &&
#if !defined(LIBASM_MC68000_NOPMMU)
           acceptMode(insn.ex2Op.mode, table.ex2(), table.oprSize()) &&
#endif
           acceptSize(insn, table);
}

void pageSetup(AsmInsn &, const EntryPage *) {}

void readCode(AsmInsn &insn, const Entry *entry_P, const EntryPage *) {
    insn.setOpCode(entry_P->readOpCode());
    insn.setFlags(entry_P->readFlags());
    if (insn.hasPostVal())
        insn.setPostfix(insn.postVal());
}

Error searchName(const CpuSpec &cpuSpec, AsmInsn &insn) {
    cpu(cpuSpec.cpu)->searchName(insn, acceptModes, pageSetup, readCode);
#if !defined(LIBASM_MC68000_NOFPU)
    if (insn.getError() == UNKNOWN_INSTRUCTION) {
        fpu(cpuSpec.fpu)->searchName(insn, acceptModes, pageSetup, readCode);
        if (insn.getError() != UNKNOWN_INSTRUCTION) {
            const auto opc = (insn.opCode() & ~07000) | (cpuSpec.fpuCid << 9);
            insn.setOpCode(opc);
        }
    }
#endif
#if !defined(LIBASM_MC68000_NOPMMU)
    if (insn.getError() == UNKNOWN_INSTRUCTION) {
        pmmu(cpuSpec.pmmu)->searchName(insn, acceptModes, pageSetup, readCode);
    }
#endif
    return insn.getError();
}

bool invalidModeReg(Config::opcode_t opc, AddrMode addrMode, OprPos pos, OprSize size) {
    uint8_t mode, reg;
    if (pos == OP_10) {
        mode = (opc >> 3) & 7;
        reg = (opc >> 0) & 7;
    } else if (pos == OP_23) {
        mode = (opc >> 6) & 7;
        reg = (opc >> 9) & 7;
    } else {
        return false;
    }
    if (mode < 7) {
        // | Dn |  1 | (An) | (An)+ | -(An) | (n,An) | (n,An,Xn) |
        if (addrMode == M_RDATA || addrMode == M_WDATA)
            return mode == 1;
        // |  0 |  1 | (An) | (An)+ | -(An) | (*,An) | (*,An,Xn) |
        if (addrMode == M_RMEM || addrMode == M_WMEM || addrMode == M_MROOT)
            return mode < 2;
        // |  0 |  1 | (An) |   3   |   4   | (n,An) | (n,An,Xn) |
        if (addrMode == M_JADDR || addrMode == M_PADDR)
            return mode < 2 || mode == 3 || mode == 4;
        // |  0 |  1 | (An) | (An)+ |   4   | (n,An) | (n,An,Xn) |
        if (addrMode == M_IADDR)
            return mode < 2 || mode == 4;
        // |  0 |  1 | (An) |   3   | -(An) | (n,An) | (n,An,Xn) |
        if (addrMode == M_DADDR)
            return mode < 2 || mode == 3;
        // | Dn |  1 | (An) |   3   |   4   | (n,An) | (n,An,Xn) |
        if (addrMode == M_BITFR || addrMode == M_BITFW)
            return mode == 1 || mode == 3 || mode == 4;
        // | Dn | An*| (An) | (An)+ | -(An) | (n,An) | (n,An,Xn) |
        // M_WADDR, M_RADDR
        if (mode == 1 && size == SZ_DATA) {  // no BYTE size for An
            const auto insnSize = (opc >> 6) & 3;
            return insnSize == 0 || insnSize == 3;
        }
        return false;
    }
    // mode == 7
    if (reg >= 5)
        return true;
    // | (n).W | (n).L | (n,PC) | (n,PC,Xn) | #n |
    if (addrMode == M_RADDR || addrMode == M_RDATA || addrMode == M_MROOT)
        return false;
    // | (n).W | (n).L | (n,PC) | (n,PC,Xn) |  4 |
    if (addrMode == M_RMEM || addrMode == M_JADDR || addrMode == M_IADDR || addrMode == M_BITFR)
        return reg == 4;
    // | (n).W | (n).L |    2   |     3     |  4 |
    // M_WADDR, M_WDATA, M_WFIAR, M_WMEM, M_DADDR, M_BITFW, M_PADDR
    return reg >= 2;
}

bool invalidSize(Config::opcode_t opc, OprSize size) {
    if (size == SZ_DATA)
        return ((opc >> 6) & 3) == 3;
    const auto sz = (opc >> 9) & 3;
    if (size == SZ_DATH && sz == 3)
        return true;
    if (size == SZ_CAS1 && sz == 0)
        return true;
    if (size == SZ_CAS2 && sz < 2)
        return true;
    return false;
}

bool matchOpCode(DisInsn &insn, const Entry *entry, const EntryPage *) {
    auto opc = insn.opCode();
    const auto flags = entry->readFlags();
    if ((opc & ~flags.insnMask()) != entry->readOpCode())
        return false;
    // Check illegal addressing mode
    if (invalidModeReg(opc, flags.src(), flags.srcPos(), flags.oprSize()))
        return false;
    if (invalidModeReg(opc, flags.dst(), flags.dstPos(), flags.oprSize()))
        return false;
    if (invalidModeReg(opc, flags.ex1(), flags.ex1Pos(), flags.oprSize()))
        return false;
    if (invalidSize(opc, flags.oprSize()))
        return false;
    if (!flags.hasPostVal())
        return true;
    insn.readPostfix();
    auto post = insn.postfix();
#if !defined(LIBASM_MC68000_NOFPU)
    if (flags.oprSize() == SZ_FDAT) {
        const auto oprSize = (post >> 10) & 7;
        if (oprSize == 7)
            return false;  // illegal float format
        post &= ~(7 << 10);
    }
#endif
    if (flags.dstPos() == EX_QQ) {
        if (((post >> 12) & 7) != (post & 7))
            return false;  // for DIV[SU].L Dq
    }
    post &= ~flags.postMask();
    return post == flags.postVal();
}

Error searchOpCode(const CpuSpec &cpuSpec, DisInsn &insn, StrBuffer &out) {
    cpu(cpuSpec.cpu)->searchOpCode(insn, out, matchOpCode);
#if !defined(LIBASM_MC68000_NOFPU)
    if (insn.getError() == UNKNOWN_INSTRUCTION) {
        const auto opc = insn.opCode();
        if ((opc & 0xFE00) == (0xF000 | (cpuSpec.fpuCid << 9))) {
            // set default FPU coprocessor id
            insn.setOpCode((opc & ~07000) | 01000);
            fpu(cpuSpec.fpu)->searchOpCode(insn, out, matchOpCode);
            insn.setOpCode(opc);
        }
    }
#endif
#if !defined(LIBASM_MC68000_NOPMMU)
    if (insn.getError() == UNKNOWN_INSTRUCTION) {
        pmmu(cpuSpec.pmmu)->searchOpCode(insn, out, matchOpCode);
    }
#endif
    if (insn.getError() == UNKNOWN_INSTRUCTION)
        insn.nameBuffer().reset();
    return insn.getError();
}

const /*PROGMEM*/ char *TableMc68000::listCpu_P() const {
    return TEXT_MC68000_LIST;
}

const /*PROGMEM*/ char *TableMc68000::cpuName_P(CpuType cpuType) const {
    return cpu(cpuType)->name_P();
}

Error TableMc68000::searchCpuName(StrScanner &name, CpuType &cpuType) const {
    name.iexpectText_P(TEXT_CPU_MC68000, 2);
    auto t = Cpu::search(name, ARRAY_RANGE(CPU_TABLE));
    if (t) {
        cpuType = t->readCpuType();
        return OK;
    }
    return UNSUPPORTED_CPU;
}

void Config::setCpuType(CpuType cpuType) {
    _cpuSpec.cpu = cpuType;
    ConfigImpl::setCpuType(cpuType);
    setFpuType(_cpuSpec.fpu == FPU_NONE ? FPU_NONE : FPU_ON);
    setPmmuType(_cpuSpec.pmmu == PMMU_NONE ? PMMU_NONE : PMMU_ON);
}

const /*PROGMEM*/ char *Config::fpu_P() const {
    return fpu(_cpuSpec.fpu)->name_P();
}

Error Config::setFpuType(FpuType fpuType) {
    if (fpuType == FPU_NONE) {
        _cpuSpec.fpu = FPU_NONE;
        return OK;
    }
#if !defined(LIBASM_MC68000_NOFPU)
    if (fpuType == FPU_ON) {
        _cpuSpec.fpu = (_cpuSpec.cpu < MC68040) ? FPU_MC68881 : FPU_MC68040;
        return OK;
    }
    if (fpuType == FPU_MC68881 && _cpuSpec.cpu < MC68040) {
        _cpuSpec.fpu = FPU_MC68881;
        return OK;
    }
    if (fpuType == FPU_MC68040 && _cpuSpec.cpu == MC68040) {
        _cpuSpec.fpu = FPU_MC68040;
        return OK;
    }
    _cpuSpec.fpu = FPU_NONE;
#endif
    return UNKNOWN_OPERAND;
}

Error Config::setFpuName(StrScanner &scan) {
    if (scan.expectFalse())
        return setFpuType(FPU_NONE);
#if !defined(LIBASM_MC68000_NOFPU)
    if (scan.expectTrue())
        return setFpuType(FPU_ON);
    if (scan.iequals_P(TEXT_FPU_68881) || scan.iequals_P(TEXT_FPU_MC68881))
        return setFpuType(FPU_MC68881);
    if (scan.iequals_P(TEXT_CPU_68040) || scan.iequals_P(TEXT_CPU_MC68040))
        return setFpuType(FPU_MC68040);
#endif
    return UNKNOWN_OPERAND;
}

const /*PROGMEM*/ char *Config::pmmu_P() const {
    return pmmu(_cpuSpec.pmmu)->name_P();
}

Error Config::setPmmuType(PmmuType pmmuType) {
    if (pmmuType == PMMU_NONE) {
        if (_cpuSpec.cpu == MC68030) {
            _cpuSpec.pmmu = PMMU_MC68EC030;
        } else if (_cpuSpec.cpu == MC68040) {
            _cpuSpec.pmmu = PMMU_MC68EC040;
        } else {
            _cpuSpec.pmmu = PMMU_NONE;
        }
        return OK;
    }
#if !defined(LIBASM_MC68000_NOPMMU)
    if (pmmuType == PMMU_ON) {
        if (_cpuSpec.cpu == MC68020) {
            _cpuSpec.pmmu = PMMU_MC68851;
            return OK;
        }
        if (_cpuSpec.cpu == MC68030) {
            _cpuSpec.pmmu = PMMU_MC68030;
            return OK;
        }
        if (_cpuSpec.cpu == MC68040) {
            _cpuSpec.pmmu = PMMU_MC68040;
            return OK;
        }
    } else if (pmmuType == PMMU_MC68851) {
        if (_cpuSpec.cpu == MC68020) {
            _cpuSpec.pmmu = PMMU_MC68851;
            return OK;
        }
    } else if (pmmuType == PMMU_MC68030) {
        if (_cpuSpec.cpu == MC68030) {
            _cpuSpec.pmmu = PMMU_MC68030;
            return OK;
        }
    } else if (pmmuType == PMMU_MC68040) {
        if (_cpuSpec.cpu == MC68040) {
            _cpuSpec.pmmu = PMMU_MC68040;
            return OK;
        }
    }
#endif
    _cpuSpec.pmmu = PMMU_NONE;
    return UNKNOWN_OPERAND;
}

Error Config::setPmmuName(StrScanner &scan) {
    if (scan.expectFalse())
        return setPmmuType(PMMU_NONE);
#if !defined(LIBASM_MC68000_NOPMMU)
    if (scan.expectTrue())
        return setPmmuType(PMMU_ON);
    if (scan.iequals_P(TEXT_PMMU_MC68851))
        return setPmmuType(PMMU_MC68851);
    if (scan.iequals_P(TEXT_CPU_MC68030) || scan.iequals_P(TEXT_CPU_MC68030))
        return setPmmuType(PMMU_MC68030);
    if (scan.iequals_P(TEXT_CPU_MC68040) || scan.iequals_P(TEXT_CPU_MC68040))
        return setPmmuType(PMMU_MC68040);
#endif
    return UNKNOWN_OPERAND;
}

const TableMc68000 TABLE;

}  // namespace mc68000
}  // namespace libasm

// Local Variables:
// mode: c++
// c-basic-offset: 4
// tab-width: 4
// End:
// vim: set ft=cpp et ts=4 sw=4:
