?login_element?

Subversion Repositories NedoOS

Rev

Rev 496 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef INTERPRETER_H
  2. #define INTERPRETER_H
  3.  
  4. #include <math.h>
  5. #include <inttypes.h>
  6.  
  7. #include "cmdlist.c"
  8.  
  9. void myprint(char * s);
  10.  
  11. //#define FOR_DEBUGGER
  12.  
  13. using namespace std;
  14. #ifdef FOR_DEBUGGER
  15.     extern uint64_t *pc;
  16.     extern uint64_t *prog;
  17.     #define MAINDISPATCH goto *labels[*pc++]
  18.     #define DISPATCH return -1
  19.     int interpret(uint64_t progpar);
  20. #else
  21.     #define MAINDISPATCH DISPATCH
  22.     #define DISPATCH goto *labels[*pc++]
  23.     int interpret(uint64_t *prog, uint64_t progpar);
  24. #endif //FOR_DEBUGGER
  25.  
  26. #define GETPAR *pc++
  27. #define PUSH(x) datastack[++datastackindex].u = x
  28. #define PUSHFLOAT(x) datastack[++datastackindex].d = x
  29. #define POP datastack[datastackindex--]
  30. #define TOS datastack[datastackindex]
  31. #define PUSHCALLSTACK(x) callstack[++callstackindex] = x
  32. #define POPCALLSTACK callstack[callstackindex--]
  33.  
  34. #define STACKSIZE 256
  35. #define LOCALSSIZE 8192
  36.  
  37. typedef union {
  38.     uint64_t u;
  39.     int64_t i;
  40.     double d;
  41.     uint64_t *p;
  42. } data64bit;
  43.  
  44. extern uint8_t datastackindex;
  45. extern uint8_t callstackindex;
  46. extern data64bit datastack[STACKSIZE];
  47. extern uint64_t callstack[STACKSIZE];
  48.  
  49. uint64_t *loadscript(int state_index, char *waspath);
  50.  
  51.  
  52. #endif // INTERPRETER_H
  53.