Пример #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));
            }
Пример #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));
            }
Пример #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());
 }