public Operand Create(ushort operandValue)
 {
     var key = OperandTypeMapper.Keys.Last(k => k.Any(e => e <= operandValue));
     this.Operand = OperandTypeMapper[key]();
     this.Operand.OperandValue = operandValue;
     return this.Operand;
 }
示例#2
0
        public Operand Build(TokenBase token)
        {
            this.Operand = this.CreateOperand(token);

            this.SetRegisterValue(token);
            this.SetNextWordValue(token);
            this.SetLabelValue(token);

            return this.Operand;
        }
示例#3
0
 public CpuOperation(Operand operand, ICpuStateOperations cpuStateManager)
 {
     this.operand = operand;
     this.cpuStateManager = cpuStateManager;
 }
示例#4
0
 private void AssembleNextWordOperand(Operand operand)
 {
     if (operand is NextWordOperand || operand is IndirectNextWordOperand || operand is IndirectNextWordOffsetOperand)
     {
         if (!string.IsNullOrEmpty(operand.Label))
         {
             this.labelReferences[this.program.Count] = operand.Label;
             this.program.Add(0);
         }
         else if (operand.NextWord > OperandLiteralMax)
         {
             this.program.Add((ushort)operand.NextWord);
         }
     }
 }