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; }
public Operand Build(TokenBase token) { this.Operand = this.CreateOperand(token); this.SetRegisterValue(token); this.SetNextWordValue(token); this.SetLabelValue(token); return this.Operand; }
public CpuOperation(Operand operand, ICpuStateOperations cpuStateManager) { this.operand = operand; this.cpuStateManager = cpuStateManager; }
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); } } }