|
- /* Copyright (C) 2014-2016 Ben Kurtovic <ben.kurtovic@gmail.com>
- Released under the terms of the MIT License. See LICENSE for details. */
-
- #include "mnemonics.h"
-
- static char* instr_mnemonics[256] = {
- /* 00 */ "nop", "ld", "ld", "inc", "inc", "dec", "ld", "rlca",
- /* 08 */ "ex", "add", "ld", "dec", "inc", "dec", "ld", "rrca",
- /* 10 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 18 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 20 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 28 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 30 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 38 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 40 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 48 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 50 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 58 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 60 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 68 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 70 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 78 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 80 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 88 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 90 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* 98 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* A0 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* A8 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* B0 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* B8 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* C0 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* C8 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* D0 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* D8 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* E0 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* E8 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* F0 */ "????", "????", "????", "????", "????", "????", "????", "????",
- /* F8 */ "????", "????", "????", "????", "????", "????", "????", "????"
- };
-
- /*
- Extract the assembly mnemonic for the given opcode.
-
- The return value is a string literal and should not be freed.
- */
- char* decode_mnemonic(const uint8_t *bytes)
- {
- return instr_mnemonics[bytes[0]]; // TODO: extended...
- }
|