comparison lwasm/insn_tfm.c @ 228:560843a951f7

Added compatibility alternatives to TFM
author lost
date Fri, 12 Jun 2009 00:19:03 +0000
parents bae1e3ecdce1
children
comparison
equal deleted inserted replaced
227:4c60c3a09597 228:560843a951f7
107 register_error(as, l, 1, "Unknown operation"); 107 register_error(as, l, 1, "Unknown operation");
108 return; 108 return;
109 } 109 }
110 lwasm_emit(as, l, (r0 << 4) | r1); 110 lwasm_emit(as, l, (r0 << 4) | r1);
111 } 111 }
112
113 OPFUNC(insn_tfmrtor)
114 {
115 int r0, r1;
116 static const char *regs = "D X Y U S A B 0 0 E F ";
117
118 lwasm_emitop(as, l, instab[opnum].ops[0]);
119 // register to register (r0,r1)
120 // registers are in order:
121 // D,X,Y,U,S,PC,W,V
122 // A,B,CC,DP,0,0,E,F
123 r0 = lwasm_lookupreg2(regs, p);
124 if (r0 < 0 || *(*p)++ != ',')
125 {
126 register_error(as, l, 1, "Bad operand");
127 r0 = r1 = 0;
128 }
129 else
130 {
131 r1 = lwasm_lookupreg2(regs, p);
132 if (r1 < 0)
133 {
134 register_error(as, l, 1, "Bad operand");
135 r0 = r1 = 0;
136 }
137 }
138 lwasm_emit(as, l, (r0 << 4) | r1);
139 }