Beispiel #1
0
        public void LoadConst(IAsm a)
        {
            StringBuilder sb    = new StringBuilder(Io.MAXSTR);
            int           value = Convert.ToInt32(a.getInsn());

            sb.Append("\tldc.i4");
            if (value > 127 || value < -128)
            {
                sb.Append(" ");
            }
            else if (value > 8 || value < -1)
            {
                sb.Append(".s ");
            }
            else
            {
                sb.Append(".");
            }
            sb.Append(a.getInsn());
            sb.Append("\t\t\t\t\t//");
            sb.Append(a.getICount());
            sb.Append("\r\n");

            io.Out(sb.ToString());
        }
Beispiel #2
0
        public void LoadConst(IAsm a)
        {
            int value = Convert.ToInt32(a.getInsn());

            if (value > 127 || value < -128)
            {
                il.Emit(OpCodes.Ldc_I4, value);
            }
            else if (value > 8 || value < -1)
            {
                il.Emit(OpCodes.Ldc_I4_S, Convert.ToSByte(value));
            }
            else if (value == -1)
            {
                il.Emit(OpCodes.Ldc_I4_M1);
            }
            else
            {
                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);
            }
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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));
        }
Beispiel #6
0
        public void Insn(IAsm a)
        {
            StringBuilder sb = new StringBuilder(Io.MAXSTR);

            sb.Append("\t");
            sb.Append(a.getInsn());
            sb.Append("\t\t\t\t\t//");
            sb.Append(a.getICount());
            sb.Append("\r\n");
            io.Out(sb.ToString());
        }
Beispiel #7
0
 public void Branch(IAsm a)
 {
     StringBuilder sb = new StringBuilder(Io.MAXSTR);
     sb.Append("\t");
     sb.Append(a.getInsn());
     sb.Append(" ");
     sb.Append(a.getLabel());
     sb.Append("\t\t\t\t\t//");
     sb.Append(a.getICount());
     sb.Append("\r\n");
     io.Out(sb.ToString());
 }
Beispiel #8
0
        public void LoadConst(IAsm a)
        {
            StringBuilder sb = new StringBuilder(Io.MAXSTR);
            int value = Convert.ToInt32(a.getInsn());

            sb.Append("\tldc.i4");
            if (value > 127 || value < -128) {
                sb.Append(" ");
            } else if (value > 8 || value < -1) {
                sb.Append(".s ");
            } else {
                sb.Append(".");
            }
            sb.Append(a.getInsn());
            sb.Append("\t\t\t\t\t//");
            sb.Append(a.getICount());
            sb.Append("\r\n");

            io.Out(sb.ToString());
        }
Beispiel #9
0
        public void LoadConst(IAsm a)
        {
            int value = Convert.ToInt32(a.getInsn());

            if (value > 127 || value < -128) {
                il.Emit(OpCodes.Ldc_I4, value);
            } else if (value > 8 || value < -1) {
                il.Emit(OpCodes.Ldc_I4_S, Convert.ToSByte(value));
            } else if (value == -1) {
                il.Emit(OpCodes.Ldc_I4_M1);
            } else {
                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);
            }
        }
Beispiel #10
0
        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);
        }