home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / me34src.zip / me3 / mc / opcode.h < prev    next >
Text File  |  1995-01-14  |  3KB  |  151 lines

  1. /* opcode.h : opcodes and opcode names for the Mutt Machine
  2.  */
  3.  
  4. /* Craig Durland    Public Domain
  5.  *   Distributed "as is", without warranties of any kind, but comments,
  6.  *     suggestions and bug reports are welcome.
  7.  */
  8.  
  9.     /* extern opcodes */
  10. #define CONCAT         1
  11. #define MSG         2
  12. #define ASK         3
  13. #define INSERT_OBJ     4
  14. #define EXTRACT_EL     5
  15. #define EXTRACT_ELS     6
  16. #define REMOVE_ELS     7
  17.  
  18.     /* op codes */
  19. #define HALT         0
  20. #define DONE         1
  21.  
  22. #define ASKUSER         2
  23.  
  24. #define RVBOOL         3
  25. #define RVNUM8         4
  26. #define RVNUM16         5
  27. #define RVNUM32         6
  28. #define RVSTR         7
  29. #define RVVOID         8
  30.  
  31. #define ADD         9
  32. #define SUB        10
  33. #define MUL        11
  34. #define DIV        12
  35.  
  36. #define CMP        13
  37. #define NOT        14
  38. #define LT        15
  39. #define LTE        16
  40.  
  41. #define JMP        17
  42. #define JMPTRUE        18
  43. #define JMPFALSE    19
  44.  
  45. #define ARG        20
  46. #define NARGS        21
  47. #define PUSHARGS    22
  48.  
  49. #define PUSHRV        23
  50. #define SHOVERV        24
  51. #define DUP        25
  52. #define POP        26
  53.  
  54. #define PUSHTOKEN    27
  55. #define PUSHXT        28
  56. #define PUSHNAME    29
  57. #define PUSHADDR    30
  58. #define FADDR        31
  59.  
  60. #define DOOP        32
  61.  
  62. #define TYPECHECK    33
  63.  
  64. #define LALLOC        34
  65. #define GETLVAR        35
  66. #define GETGVAR        36
  67. #define SETLVAR        37
  68. #define SETGVAR        38
  69.  
  70. #define RVLBASE        39
  71. #define RVGBASE        40
  72. #define GETRVAR        41
  73. #define SETRVAR        42
  74.  
  75. #define CREATE_OBJ    43
  76. #define LEN_OF        44
  77.  
  78. #define CONVERT_TO    45
  79.  
  80. #define STOP        46
  81.  
  82.  
  83. #if OPNAMES
  84.  
  85. char *opname[] =    /* op code names */
  86. {
  87.   "halt",        /* HALT */
  88.   "done",        /* DONE */
  89.  
  90.   "ask-user",        /* ASKUSER */
  91.  
  92.   "set-RV-to",        /* RVBOOL */
  93.   "set-RV-to",        /* RVNUM8 */
  94.   "set-RV-to",        /* RVNUM16 */
  95.   "set-RV-to",        /* RVNUM32 */
  96.   "set-RV-to",        /* RVSTR */
  97.   "set-RV-to-VOID",    /* RVVOID */
  98.  
  99.   "add",        /* ADD */
  100.   "subtract",        /* SUB */
  101.   "multiply",        /* MUL */
  102.   "divide",        /* DIV */
  103.  
  104.   "compare",        /* CMP */
  105.   "not",        /* NOT */
  106.   "<",            /* LT */
  107.   "<=",            /* LTE */
  108.  
  109.   "jmp",
  110.   "jmp-TRUE",        /* JMPTRUE */
  111.   "jmp-FALSE",        /* JMPFALSE */
  112.  
  113.   "arg",        /* ARG */
  114.   "num-args",        /* NARGS */
  115.   "push-args",        /* PUSHARGS */
  116.  
  117.   "push-RV",        /* PUSHRV */
  118.   "shove-RV",        /* SHOVERV */
  119.   "dup",        /* DUP */
  120.   "pop",        /* POP */
  121.  
  122.   "push-token",        /* PUSHTOKEN */
  123.   "push-X-token",    /* PUSHXT */
  124.   "push-name",        /* PUSHNAME */
  125.   "push-address",    /* PUSHADDR */
  126.   "fcn-addr",        /* FADDR */
  127.  
  128.   "do-OP",        /* DOOP */
  129.  
  130.   "typecheck",        /* TYPECHECK */
  131.  
  132.   "lalloc",        /* LALLOC */
  133.   "get-local-var",    /* GETLVAR */
  134.   "get-global-var",    /* GETGVAR */
  135.   "set-local-var",    /* SETLVAR */
  136.   "set-global-var",    /* SETGVAR */
  137.  
  138.   "local-vars",        /* RVLBASE */
  139.   "global-vars",    /* RVGBASE */
  140.   "get-var-rel",    /* GETRVAR */
  141.   "set-var-rel",    /* SETRVAR */
  142.  
  143.   "create-object",    /* CREATE_OBJ */
  144.   "length-of",        /* LEN_OF */
  145.  
  146.   "convert-to",        /* CONVERT_TO */
  147.  
  148.   "stop",        /* STOP */
  149. };
  150. #endif
  151.