Example #1
0
 public Cr16Rewriter(Cr16Architecture arch, EndianImageReader rdr, ProcessorState state, IStorageBinder binder, IRewriterHost host)
 {
     this.arch   = arch;
     this.rdr    = rdr;
     this.state  = state;
     this.binder = binder;
     this.host   = host;
     this.dasm   = new Cr16cDisassembler(arch, rdr).GetEnumerator();
     this.instr  = null !;
     this.m      = null !;
 }
Example #2
0
        public IEnumerator <RtlInstructionCluster> GetEnumerator()
        {
            while (dasm.MoveNext())
            {
                this.instr  = dasm.Current;
                this.iclass = instr.InstructionClass;
                var rtls = new List <RtlInstruction>();
                this.m = new RtlEmitter(rtls);
                switch (instr.Mnemonic)
                {
                default:
                    host.Warn(instr.Address, "Cr16 instruction {0} not supported yet.", this.instr);
                    EmitUnitTest();
                    goto case Mnemonic.Invalid;

                case Mnemonic.Invalid: m.Invalid(); iclass = InstrClass.Invalid; break;
                }
                yield return(m.MakeCluster(instr.Address, instr.Length, this.iclass));
            }
        }