Rename *ll* and *ul* to ll and ul in intbyterm
[maxima.git] / archive / o / execute.c
blob417f8e9ee01e3f183a83bddc47babfe117b1c997
1 #include "plot.h"
2 #include "emulate.h"
3 #include "const.h"
4 struct value_function
5 { char * body ;
6 struct value *constants;
7 };
8 extern int s_p;
9 extern struct value stack[];
11 enum m_ops {
12 m_real,
13 m_imag,
14 m_conj,
15 m_abs,
16 m_acsc,
17 m_acos,
18 m_tan,
19 m_sin,
20 m_tanh,
21 m_cos,
22 m_asin,
23 m_sinh,
24 m_cosh,
25 m_log,
26 m_factorial,
27 m_and,
28 m_set,
29 m_plus,
30 m_gt,
31 m_lt,
32 m_div,
33 m_ne,
34 m_mult,
35 m_ge,
36 m_eq,
37 m_minus,
38 m_power,
39 m_le,
40 m_or,
41 m_push,
42 m_push_0,
43 m_push_1,
44 m_push_2,
45 m_push_3,
46 m_push_i,
47 m_pushl_0,
48 m_pushl_1,
49 m_pushl_2,
50 m_pushl_3,
51 m_pushl_i,
52 m_pushc_0,
53 m_pushc_1,
54 m_pushc_2,
55 m_pushc_3,
56 m_pushc_4,
57 m_pushc_5,
58 m_pushc_6,
59 m_pushc_7,
60 m_pushc_8,
61 m_pushc_9,
62 m_pushc_i,
63 m_end,
64 m_reserve,
65 m_set_sp,
66 m_set_sp_frame_pointer,
67 m_return,
69 execute_fun(f,n)
70 struct value_function *f;
71 int n;
72 { unsigned char *body;
73 /* frame_pointer points just beyond last frames valid storage */
74 struct value *frame_pointer = &stack[s_p -(n -1)];
75 struct value *constants = f->constants;
76 body = f->body;
77 switch (*body)
79 case m_real: f_real(); break;
80 case m_imag: f_imag(); break;
81 case m_conj: f_conj(); break;
82 case m_abs: f_abs(); break;
83 case m_acsc: f_acsc(); break;
84 case m_acos: f_acos(); break;
85 case m_tan: f_tan(); break;
86 case m_sin: f_sin(); break;
87 case m_tanh: f_tanh(); break;
88 case m_cos: f_cos(); break;
89 case m_asin: f_asin(); break;
90 case m_sinh: f_sinh(); break;
91 case m_cosh: f_cosh(); break;
92 case m_log: f_log(); break;
93 case m_factorial: f_factorial(); break;
94 case m_and: f_and(); break;
95 case m_set: f_set(); break;
96 case m_plus: f_plus(); break;
97 case m_gt: f_gt(); break;
98 case m_lt: f_lt(); break;
99 case m_div: f_div(); break;
100 case m_ne: f_ne(); break;
101 case m_mult: f_mult(); break;
102 case m_ge: f_ge(); break;
103 case m_eq: f_eq(); break;
104 case m_minus: f_minus(); break;
105 case m_power: f_power(); break;
106 case m_le: f_le(); break;
107 case m_or: f_or(); break;
108 case m_push: f_push(); break;
109 case m_push_0: f_push_0(); break;
110 case m_push_1: f_push_1(); break;
111 case m_push_2: f_push_2(); break;
112 case m_push_3: f_push_3(); break;
113 case m_push_i: f_push_i(); break;
114 case m_pushl_0: f_pushl_0(); break;
115 case m_pushl_1: f_pushl_1(); break;
116 case m_pushl_2: f_pushl_2(); break;
117 case m_pushl_3: f_pushl_3(); break;
118 case m_pushl_i: f_pushl_i(); break;
119 case m_pushc_0: f_pushc_0(); break;
120 case m_pushc_1: f_pushc_1(); break;
121 case m_pushc_2: f_pushc_2(); break;
122 case m_pushc_3: f_pushc_3(); break;
123 case m_pushc_4: f_pushc_4(); break;
124 case m_pushc_5: f_pushc_5(); break;
125 case m_pushc_6: f_pushc_6(); break;
126 case m_pushc_7: f_pushc_7(); break;
127 case m_pushc_8: f_pushc_8(); break;
128 case m_pushc_9: f_pushc_9(); break;
129 case m_pushc_i: f_pushc_i(); break;
130 case m_end: f_end(); break;
131 case m_reserve: f_reserve(); break;
132 case m_set_sp: f_set_sp(); break;
133 case m_set_sp_frame_pointer: f_set_sp_frame_pointer(); break;
134 case m_return: f_return(); break;
135 default:
136 abort();
138 END: s_p = frame_pointer -stack -n;
139 pop(frame_pointer);
140 s_p = frame_pointer -stack -1;
141 return 1;