state.h 1.0 KB

123456789101112131415161718192021222324252627282930
  1. /****************************************************************************
  2. * dcc project header
  3. * (C) Cristina Cifuentes, Mike van Emmerik
  4. ****************************************************************************/
  5. #pragma once
  6. #include <stdint.h>
  7. #include <cstring>
  8. #include "Enums.h"
  9. /* STATE TABLE */
  10. struct STATE
  11. {
  12. uint32_t IP; /* Offset into Image */
  13. int16_t r[INDEXBASE]; /* Value of segs and AX */
  14. uint8_t f[INDEXBASE]; /* True if r[.] has a value */
  15. struct
  16. { /* For case stmt indexed reg */
  17. uint8_t regi; /* Last conditional jump */
  18. int16_t immed; /* Contents of the previous register */
  19. } JCond;
  20. void setState(uint16_t reg, int16_t value);
  21. void checkStartup();
  22. STATE() : IP(0)
  23. {
  24. JCond.immed=0;
  25. memset(r,0,sizeof(int16_t)*INDEXBASE);
  26. memset(f,0,sizeof(uint8_t)*INDEXBASE);
  27. }
  28. };