コード例 #1
0
 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
ファイル: Assembler.cs プロジェクト: pedromsantos/DCPU16.Net
 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);
         }
     }
 }