decoder.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. MSP430 Emulator
  3. Copyright (C) 2020 Rudolf Geosits (rgeosits@live.esu.edu)
  4. "MSP430 Emulator" is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. "MSP430 Emulator" is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */
  15. #ifndef _DECODER_H_
  16. #define _DECODER_H_
  17. #include <string.h>
  18. #include <stdio.h>
  19. #include <stdint.h>
  20. #include "registers.h"
  21. #include "../utilities.h"
  22. #include "formatI.h"
  23. #include "formatII.h"
  24. #include "formatIII.h"
  25. int16_t run_constant_generator(uint8_t source, uint8_t as_flag);
  26. void decode(Emulator *emu, uint16_t instruction, bool disassemble);
  27. uint16_t fetch(Emulator *emu);
  28. enum {
  29. EMU_WORD,
  30. EMU_BYTE
  31. };
  32. enum {
  33. EXECUTE = 0,
  34. DISASSEMBLE,
  35. };
  36. #endif