utilities.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 _UTILITIES_H_
  16. #define _UTILITIES_H_
  17. #include <stdio.h>
  18. #include <stdint.h>
  19. #include <string.h>
  20. #include <stdlib.h>
  21. #include "cpu/registers.h"
  22. #include "memory/memspace.h"
  23. void reg_num_to_name(uint8_t source_reg, char *reg_name);
  24. int16_t *get_reg_ptr(Emulator *emu, uint8_t reg);
  25. uint16_t *get_stack_ptr(Emulator *emu);
  26. uint16_t *get_addr_ptr(uint16_t virt_addr);
  27. int8_t reg_name_to_num(char *name);
  28. void load_bootloader(uint16_t virt_addr);
  29. void load_firmware(Emulator *emu, char *file_name, uint16_t virt_addr);
  30. void display_help(Emulator *emu);
  31. #endif