RequireOpcodeFlag() публичный статический Метод

public static RequireOpcodeFlag ( OpcodeFlag flag, OpcodeFlag acceptable ) : void
flag OpcodeFlag
acceptable OpcodeFlag
Результат void
Пример #1
0
        private List <ushort> AssembleLOD(List <string> param, OpcodeFlag opcodeFlag, ParserState state)
        {
            Guard.RequireParamCountExact(param, 2);
            Guard.RequireOpcodeFlag(opcodeFlag, new[] { OpcodeFlag.BitWidth8, OpcodeFlag.BitWidth16 });

            return(state.Parser.AssembleALU(0x0080, param[0], param[1], opcodeFlag, state));
        }
Пример #2
0
 private List <ushort> AssembleSLP(List <string> param, OpcodeFlag opcodeFlag, ParserState state)
 {
     Guard.RequireParamCountExact(param, 0);
     Guard.RequireOpcodeFlag(opcodeFlag, new[] { OpcodeFlag.BitWidth16 });
     return(new List <ushort> {
         0x04B4
     });
 }
Пример #3
0
 private List <ushort> AssembleJMP(List <string> param, OpcodeFlag opcodeFlag, ParserState state)
 {
     Guard.RequireOpcodeFlag(opcodeFlag, new[] { OpcodeFlag.BitWidth16 });
     if (opcodeFlag.HasFlag(OpcodeFlag.FarJump))
     {
         Guard.RequireParamCountMinMax(param, 1, 2);
         return(state.Parser.AssembleJMI(0x01B8, param[0], param.Count == 2 ? param[1] : null, state));
     }
     Guard.RequireParamCountExact(param, 1);
     return(state.Parser.AssembleJMI(0x00B8, param[0], null, state));
 }
Пример #4
0
        private List <ushort> AssembleSTO(List <string> param, OpcodeFlag opcodeFlag, ParserState state)
        {
            Guard.RequireParamCountExact(param, 2);
            Guard.RequireOpcodeFlag(opcodeFlag, new[] { OpcodeFlag.BitWidth8, OpcodeFlag.BitWidth16 });

            List <ushort> code = state.Parser.AssembleALU(0x0088, param[0], param[1], opcodeFlag, state);

            if ((code[0] & 0xF000) == 0x1000) // no sto register - should lod r0, r1, not sto r0, r1
            {
                throw new Exception("Store register instructions not supported");
            }
            if ((code[0] & 0xFE00) == 0x0000) // no sto immediate.
            {
                throw new Exception("Store immediate instructions not supported");
            }
            return(code);
        }
Пример #5
0
 private List <ushort> AssembleMDI(List <string> param, OpcodeFlag opcodeFlag, ParserState state)
 {
     Guard.RequireParamCountExact(param, 2);
     Guard.RequireOpcodeFlag(opcodeFlag, state.Parser.flag8or16);
     return(state.Parser.AssembleALU(0x0058, param[0], param[1], opcodeFlag, state));
 }
Пример #6
0
 private List <ushort> AssembleHWQ(List <string> param, OpcodeFlag opcodeFlag, ParserState state)
 {
     Guard.RequireParamCountExact(param, 1);
     Guard.RequireOpcodeFlag(opcodeFlag, new[] { OpcodeFlag.BitWidth16 });
     return(state.Parser.AssembleHWI(0x00BA, param[0]));
 }
Пример #7
0
 private List <ushort> AssemblePOP(List <string> param, OpcodeFlag opcodeFlag, ParserState state)
 {
     Guard.RequireParamCountMinMax(param, 1, 13);
     Guard.RequireOpcodeFlag(opcodeFlag, new[] { OpcodeFlag.BitWidth16 });
     return(state.Parser.AssembleSTK(0x00B2, param, true));
 }
Пример #8
0
 private List <ushort> AssembleCLF(List <string> param, OpcodeFlag opcodeFlag, ParserState state)
 {
     Guard.RequireParamCountMinMax(param, 1, 4);
     Guard.RequireOpcodeFlag(opcodeFlag, new[] { OpcodeFlag.BitWidth16 });
     return(state.Parser.AssembleFLG(0x00AF, param));
 }