public void LoadConst(IAsm a) { StringBuilder sb = new StringBuilder(MyC.MAXSTR); int value = Convert.ToInt32(a.getInsn()); sb.Append("\tldc.i4"); if (value > 127 || value < -128) /* if must use long form */ { sb.Append(" "); } else if (value > 8 || value < -1) /* if must use medium form */ { sb.Append(".s "); } else /* else use short form */ { sb.Append("."); } sb.Append(a.getInsn()); sb.Append("\t//"); sb.Append(a.getICount()); sb.Append("\r\n"); io.Out(sb.ToString()); }
public void LoadConst(IAsm a) { int value = Convert.ToInt32(a.getInsn()); if (value > 127 || value < -128) /* if must use long form */ { il.Emit(OpCodes.Ldc_I4, value); } else if (value > 8 || value < -1) /* if must use medium form */ { il.Emit(OpCodes.Ldc_I4_S, value); } else if (value == -1) { il.Emit(OpCodes.Ldc_I4_M1); } else /* else use short form */ { Object o = opcodehash["ldc.i4." + a.getInsn()]; if (o == null) { Io.ICE("Could not find opcode for (Ldc_I4_" + a.getInsn() + ")"); } il.Emit((OpCode)o); } }
public void Branch(IAsm a) { Object o = opcodehash[a.getInsn()]; if (o == null) { Io.ICE("Instruction branch opcode (" + a.getInsn() + ") not found in hash"); } il.Emit((OpCode)o, (Label)getILLabel(a)); }
public void Insn(IAsm a) { Object o = opcodehash[a.getInsn()]; if (o == null) { Io.ICE("Instruction opcode (" + a.getInsn() + ") not found in hash"); } il.Emit((OpCode)o); }
public void Insn(IAsm a) { StringBuilder sb = new StringBuilder(MyC.MAXSTR); sb.Append("\t"); sb.Append(a.getInsn()); sb.Append("\t//"); sb.Append(a.getICount()); sb.Append("\r\n"); io.Out(sb.ToString()); }
public void Branch(IAsm a) { StringBuilder sb = new StringBuilder(MyC.MAXSTR); sb.Append("\t"); sb.Append(a.getInsn()); sb.Append(" "); sb.Append(a.getLabel()); sb.Append("\t//"); sb.Append(a.getICount()); sb.Append("\r\n"); io.Out(sb.ToString()); }
public void LoadConst(IAsm a) { int value = Convert.ToInt32(a.getInsn()); if (value > 127 || value < -128) /* if must use long form */ { il.Emit(OpCodes.Ldc_I4, value); } else if (value > 8 || value < -1) /* if must use medium form */ { il.Emit(OpCodes.Ldc_I4_S, value); } else if (value == -1) { il.Emit(OpCodes.Ldc_I4_M1); } else /* else use short form */ { Object o = opcodehash["ldc.i4."+a.getInsn()]; if (o == null) Io.ICE("Could not find opcode for (Ldc_I4_" + a.getInsn() + ")"); il.Emit((OpCode) o); } }
public void Branch(IAsm a) { Object o = opcodehash[a.getInsn()]; if (o == null) Io.ICE("Instruction branch opcode (" + a.getInsn() + ") not found in hash"); il.Emit((OpCode) o, (Label) getILLabel(a)); }
public void Insn(IAsm a) { Object o = opcodehash[a.getInsn()]; if (o == null) Io.ICE("Instruction opcode (" + a.getInsn() + ") not found in hash"); il.Emit((OpCode) o); }