/// <summary>
 /// Instantiate a new instance of the EvalNodeShiftOp node.
 /// </summary>
 /// <param name="operation">Specifies the shift operation to represent.</param>
 /// <param name="child">Specifies the first child node.</param>
 /// <param name="language">Language used for evaluation.</param>
 public EvalNodeShiftOp(ShiftOp operation,
                        EvalNode child,
                        Language language)
 {
     _operation = operation;
     _language = language;
     Append(child);
 }
예제 #2
0
 /// <summary>
 /// Instantiate a new instance of the EvalNodeShiftOp node.
 /// </summary>
 /// <param name="operation">Specifies the shift operation to represent.</param>
 /// <param name="child">Specifies the first child node.</param>
 /// <param name="language">Language used for evaluation.</param>
 public EvalNodeShiftOp(ShiftOp operation,
                        EvalNode child,
                        Language language)
 {
     _operation = operation;
     _language  = language;
     Append(child);
 }
예제 #3
0
 public void WriteCmpReg(string dest, string srcB, ShiftOp shift = ShiftOp.None)
 {
     OutputBuilder.AppendLine($"cmp {dest}, {srcB}{ConvertShiftOp(shift)}");
     InstructionCount++;
 }
예제 #4
0
 public void WriteMovReg(string dest, string srcB, ShiftOp shift = ShiftOp.None, bool updateStatus = false)
 {
     OutputBuilder.AppendLine($"mov{(updateStatus ? "s" : "")} {dest}, {srcB}{ConvertShiftOp(shift)}");
     InstructionCount++;
 }
예제 #5
0
 public void WriteOrReg(string dest, string srcA, string srcB, ShiftOp shift = ShiftOp.None, bool updateStatus = false)
 {
     WriteType1("or", dest, srcA, srcB, shift, updateStatus);
 }
예제 #6
0
 public void WriteSubtractCarryReg(string dest, string srcA, string srcB, ShiftOp shift = ShiftOp.None, bool updateStatus = false)
 {
     WriteType1("sbc", dest, srcA, srcB, shift, updateStatus);
 }
예제 #7
0
 public void WriteStore(string value, string addrA, string addrB = null, ShiftOp shift = ShiftOp.None)
 {
     OutputBuilder.AppendLine($"st {value}, [{addrA}{(string.IsNullOrWhiteSpace(addrB) ? "" : $", {addrB}")}{ConvertShiftOp(shift)}]");
예제 #8
0
 private void WriteType1(string op, string dest, string srcA, string srcB, ShiftOp shift = ShiftOp.None, bool updateStatus = false)
 {
     OutputBuilder.AppendLine($"{op}{(updateStatus ? "s" : "")} {dest}, {srcA}, {srcB}{ConvertShiftOp(shift)}");
     InstructionCount++;
 }