comparison src/pseudo.c @ 95:f3497072ac44

Fixed think-o in rm* ops (reversed pass number test)
author lost
date Sat, 17 Jan 2009 06:57:58 +0000
parents 83ba34ed11b3
children 3dcb12a6f4ff
comparison
equal deleted inserted replaced
94:83ba34ed11b3 95:f3497072ac44
123 123
124 OPFUNC(pseudo_rmb) 124 OPFUNC(pseudo_rmb)
125 { 125 {
126 int r, v; 126 int r, v;
127 127
128 if (as -> passnum == 1) 128 if (as -> passnum == 2)
129 { 129 {
130 as -> addr += l -> nocodelen; 130 as -> addr += l -> nocodelen;
131 return; 131 return;
132 } 132 }
133 r = lwasm_expr_result2(as, l, p, EXPR_PASS1CONST, &v, -1); 133 r = lwasm_expr_result2(as, l, p, EXPR_PASS1CONST, &v, -1);
134 fprintf(stderr, "RMB: v=%d, addr=%d\n", v, as -> addr);
134 if (r != 0) 135 if (r != 0)
135 return; 136 return;
136 l -> nocodelen = v; 137 l -> nocodelen = v;
137 as -> addr += v; 138 as -> addr += v;
138 } 139 }
139 140
140 OPFUNC(pseudo_rmd) 141 OPFUNC(pseudo_rmd)
141 { 142 {
142 int r, v; 143 int r, v;
143 144
144 if (as -> passnum == 1) 145 if (as -> passnum == 2)
145 { 146 {
146 as -> addr += l -> nocodelen; 147 as -> addr += l -> nocodelen;
147 return; 148 return;
148 } 149 }
149 r = lwasm_expr_result2(as, l, p, EXPR_PASS1CONST, &v, 0); 150 r = lwasm_expr_result2(as, l, p, EXPR_PASS1CONST, &v, 0);
156 157
157 OPFUNC(pseudo_rmq) 158 OPFUNC(pseudo_rmq)
158 { 159 {
159 int r, v; 160 int r, v;
160 161
161 if (as -> passnum == 1) 162 if (as -> passnum == 2)
162 { 163 {
163 as -> addr += l -> nocodelen; 164 as -> addr += l -> nocodelen;
164 return; 165 return;
165 } 166 }
166 r = lwasm_expr_result2(as, l, p, EXPR_PASS1CONST, &v, 0); 167 r = lwasm_expr_result2(as, l, p, EXPR_PASS1CONST, &v, 0);