Exemplo n.º 1
0
            public override RiscVInstruction Decode(RiscVDisassembler dasm, uint wInstr)
            {
                var slot = (int)((wInstr >> shift) & mask);

                if (!subcodes.TryGetValue(slot, out Decoder decoder))
                {
                    return(dasm.MakeInvalid());
                }
                return(decoder.Decode(dasm, wInstr));
            }
Exemplo n.º 2
0
            public override RiscVInstruction Decode(RiscVDisassembler dasm, uint hInstr)
            {
                if (!dasm.rdr.TryReadUInt16(out ushort hiword))
                {
                    return(dasm.MakeInvalid());
                }
                uint wInstr = (uint)hiword << 16;

                wInstr |= hInstr;
                var slot = (wInstr >> 2) & 0x1F;

                return(w32decoders[slot].Decode(dasm, wInstr));
            }
Exemplo n.º 3
0
 public override RiscVInstruction Decode(RiscVDisassembler dasm, uint wInstr)
 {
     dasm.state.instr.iclass = InstrClass.Linear;
     dasm.state.instr.opcode = opcode;
     dasm.state.ops.Clear();
     foreach (var m in mutators)
     {
         if (!m(wInstr, dasm))
         {
             return(dasm.MakeInvalid());
         }
     }
     return(dasm.MakeInstruction());
 }