state.h 1016 B

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