RequireParamCountMinMax() public static method

public static RequireParamCountMinMax ( List param, int min, int max ) : void
param List
min int
max int
return void
Beispiel #1
0
 private List <ushort> AssembleJSR(List <string> param, OpcodeFlag opcodeFlag, ParserState state)
 {
     if (opcodeFlag.HasFlag(OpcodeFlag.FarJump))
     {
         Guard.RequireParamCountMinMax(param, 1, 2); // allow two params for immediate far jump.
         return(state.Parser.AssembleJMI(0x01B9, param[0], param.Count == 2 ? param[1] : null, state));
     }
     Guard.RequireParamCountExact(param, 1);
     return(state.Parser.AssembleJMI(0x00B9, param[0], null, state));
 }
Beispiel #2
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));
 }
Beispiel #3
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));
 }
Beispiel #4
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));
 }