An emulator, assembler, and disassembler for the Sega Game Gear
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

50 рядки
2.8 KiB

  1. /* Copyright (C) 2014-2016 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. Released under the terms of the MIT License. See LICENSE for details. */
  3. #include "mnemonics.h"
  4. static char* instr_mnemonics[256] = {
  5. /* 00 */ "nop", "ld", "ld", "inc", "inc", "dec", "ld", "rlca",
  6. /* 08 */ "ex", "add", "ld", "dec", "inc", "dec", "ld", "rrca",
  7. /* 10 */ "????", "????", "????", "????", "????", "????", "????", "????",
  8. /* 18 */ "????", "????", "????", "????", "????", "????", "????", "????",
  9. /* 20 */ "????", "????", "????", "????", "????", "????", "????", "????",
  10. /* 28 */ "????", "????", "????", "????", "????", "????", "????", "????",
  11. /* 30 */ "????", "????", "????", "????", "????", "????", "????", "????",
  12. /* 38 */ "????", "????", "????", "????", "????", "????", "????", "????",
  13. /* 40 */ "????", "????", "????", "????", "????", "????", "????", "????",
  14. /* 48 */ "????", "????", "????", "????", "????", "????", "????", "????",
  15. /* 50 */ "????", "????", "????", "????", "????", "????", "????", "????",
  16. /* 58 */ "????", "????", "????", "????", "????", "????", "????", "????",
  17. /* 60 */ "????", "????", "????", "????", "????", "????", "????", "????",
  18. /* 68 */ "????", "????", "????", "????", "????", "????", "????", "????",
  19. /* 70 */ "????", "????", "????", "????", "????", "????", "????", "????",
  20. /* 78 */ "????", "????", "????", "????", "????", "????", "????", "????",
  21. /* 80 */ "????", "????", "????", "????", "????", "????", "????", "????",
  22. /* 88 */ "????", "????", "????", "????", "????", "????", "????", "????",
  23. /* 90 */ "????", "????", "????", "????", "????", "????", "????", "????",
  24. /* 98 */ "????", "????", "????", "????", "????", "????", "????", "????",
  25. /* A0 */ "????", "????", "????", "????", "????", "????", "????", "????",
  26. /* A8 */ "????", "????", "????", "????", "????", "????", "????", "????",
  27. /* B0 */ "????", "????", "????", "????", "????", "????", "????", "????",
  28. /* B8 */ "????", "????", "????", "????", "????", "????", "????", "????",
  29. /* C0 */ "????", "????", "????", "????", "????", "????", "????", "????",
  30. /* C8 */ "????", "????", "????", "????", "????", "????", "????", "????",
  31. /* D0 */ "????", "????", "????", "????", "????", "????", "????", "????",
  32. /* D8 */ "????", "????", "????", "????", "????", "????", "????", "????",
  33. /* E0 */ "????", "????", "????", "????", "????", "????", "????", "????",
  34. /* E8 */ "????", "????", "????", "????", "????", "????", "????", "????",
  35. /* F0 */ "????", "????", "????", "????", "????", "????", "????", "????",
  36. /* F8 */ "????", "????", "????", "????", "????", "????", "????", "????"
  37. };
  38. /*
  39. Extract the assembly mnemonic for the given opcode.
  40. The return value is a string literal and should not be freed.
  41. */
  42. char* decode_mnemonic(const uint8_t *bytes)
  43. {
  44. return instr_mnemonics[bytes[0]]; // TODO: extended...
  45. }