state.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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.regi=0;
  25. JCond.immed=0;
  26. memset(r,0,sizeof(int16_t)*INDEXBASE);
  27. memset(f,0,sizeof(uint8_t)*INDEXBASE);
  28. }
  29. };