/// <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); }
/// <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); }
public void WriteCmpReg(string dest, string srcB, ShiftOp shift = ShiftOp.None) { OutputBuilder.AppendLine($"cmp {dest}, {srcB}{ConvertShiftOp(shift)}"); InstructionCount++; }
public void WriteMovReg(string dest, string srcB, ShiftOp shift = ShiftOp.None, bool updateStatus = false) { OutputBuilder.AppendLine($"mov{(updateStatus ? "s" : "")} {dest}, {srcB}{ConvertShiftOp(shift)}"); InstructionCount++; }
public void WriteOrReg(string dest, string srcA, string srcB, ShiftOp shift = ShiftOp.None, bool updateStatus = false) { WriteType1("or", dest, srcA, srcB, shift, updateStatus); }
public void WriteSubtractCarryReg(string dest, string srcA, string srcB, ShiftOp shift = ShiftOp.None, bool updateStatus = false) { WriteType1("sbc", dest, srcA, srcB, shift, updateStatus); }
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)}]");
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++; }