sim-main.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* Example synacor simulator.
  2. Copyright (C) 2005-2022 Free Software Foundation, Inc.
  3. Contributed by Mike Frysinger.
  4. This file is part of simulators.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #ifndef SIM_MAIN_H
  16. #define SIM_MAIN_H
  17. #include "sim-basics.h"
  18. #include "sim-base.h"
  19. struct _sim_cpu {
  20. /* ... simulator specific members ... */
  21. uint16_t regs[8];
  22. sim_cia pc;
  23. /* This isn't a real register, and the stack is not directly addressable,
  24. so use memory outside of the 16-bit address space. */
  25. uint32_t sp;
  26. sim_cpu_base base;
  27. };
  28. extern void step_once (SIM_CPU *);
  29. extern void initialize_cpu (SIM_DESC, SIM_CPU *);
  30. #endif