Exemple #1
0
 public GameboyRewriter(GameboyArchitecture 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 GameboyDisassembler(arch, rdr).GetEnumerator();
     this.rtls   = new List <RtlInstruction>();
     this.m      = new RtlEmitter(rtls);
     this.instr  = default !;
Exemple #2
0
 protected override void DoRender(MachineInstructionRenderer renderer, MachineInstructionRendererOptions options)
 {
     renderer.WriteString(StackRegister.Name);
     if (Offset > 0)
     {
         renderer.WriteChar('+');
         GameboyInstruction.RenderIntelHexNumber(Offset, renderer);
     }
     else if (Offset < 0)
     {
         renderer.WriteChar('-');
         GameboyInstruction.RenderIntelHexNumber(-Offset, renderer);
     }
 }
Exemple #3
0
 protected override void DoRender(MachineInstructionRenderer renderer, MachineInstructionRendererOptions options)
 {
     Debug.Assert(!PostDecrement || !PostIncrement);
     renderer.WriteChar('(');
     if (Base != null)
     {
         renderer.WriteString(Base.Name);
     }
     else
     {
         var number = Offset;
         GameboyInstruction.RenderIntelHexNumber(number, renderer);
     }
     if (PostDecrement)
     {
         renderer.WriteChar('-');
     }
     else if (PostIncrement)
     {
         renderer.WriteChar('+');
     }
     renderer.WriteChar(')');
 }