mirror of
https://github.com/fadden/6502bench.git
synced 2025-07-23 16:24:07 +00:00
Update 64tass handling of StackInt ops
The operands for BRK and COP must be expressed as immediate mode constants, with a leading '#'.
This commit is contained in:
@@ -153,6 +153,7 @@ namespace SourceGen.AsmGen {
|
|||||||
|
|
||||||
Project = project;
|
Project = project;
|
||||||
Quirks = new AssemblerQuirks();
|
Quirks = new AssemblerQuirks();
|
||||||
|
Quirks.StackIntOperandIsImmediate = true;
|
||||||
|
|
||||||
mWorkDirectory = workDirectory;
|
mWorkDirectory = workDirectory;
|
||||||
mFileNameBase = fileNameBase;
|
mFileNameBase = fileNameBase;
|
||||||
@@ -326,8 +327,8 @@ namespace SourceGen.AsmGen {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (op == OpDef.OpCOP_StackInt || op == OpDef.OpWDM_WDM) {
|
if (op == OpDef.OpWDM_WDM) {
|
||||||
// 64tass doesn't like these to have an operand. Output as hex.
|
// 64tass v1.54 doesn't like this to have an operand. Output as hex.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return string.Empty; // indicate original is fine
|
return string.Empty; // indicate original is fine
|
||||||
|
@@ -267,6 +267,11 @@ namespace SourceGen.AsmGen {
|
|||||||
}
|
}
|
||||||
string operandStr = formatter.FormatOperand(op, formattedOperand, wdis);
|
string operandStr = formatter.FormatOperand(op, formattedOperand, wdis);
|
||||||
|
|
||||||
|
if (gen.Quirks.StackIntOperandIsImmediate && op.AddrMode == OpDef.AddressMode.StackInt) {
|
||||||
|
// COP $02 is standard, but some require COP #$02
|
||||||
|
operandStr = '#' + operandStr;
|
||||||
|
}
|
||||||
|
|
||||||
string eolComment = proj.Comments[offset];
|
string eolComment = proj.Comments[offset];
|
||||||
if (doAddCycles) {
|
if (doAddCycles) {
|
||||||
bool branchCross = (attr.Address & 0xff00) != (operandForSymbol & 0xff00);
|
bool branchCross = (attr.Address & 0xff00) != (operandForSymbol & 0xff00);
|
||||||
|
@@ -178,6 +178,11 @@ namespace SourceGen.AsmGen {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool BlockMoveArgsNoHash { get; set; }
|
public bool BlockMoveArgsNoHash { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Do 8-bit constant args to StackInt ops (BRK/COP) require a leading '#'?
|
||||||
|
/// </summary>
|
||||||
|
public bool StackIntOperandIsImmediate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Does the assembler configure assembler widths based on SEP/REP, but doesn't
|
/// Does the assembler configure assembler widths based on SEP/REP, but doesn't
|
||||||
/// track the emulation bit?
|
/// track the emulation bit?
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
.byte $ff
|
.byte $ff
|
||||||
|
|
||||||
L101F ora ($ff,x)
|
L101F ora ($ff,x)
|
||||||
.byte $02,$ff
|
cop #$ff
|
||||||
ora $ff,s
|
ora $ff,s
|
||||||
tsb $ff
|
tsb $ff
|
||||||
ora $ff
|
ora $ff
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
.byte $00
|
.byte $00
|
||||||
|
|
||||||
L101F ora ($00,x)
|
L101F ora ($00,x)
|
||||||
.byte $02,$00
|
cop #$00
|
||||||
ora $00,s
|
ora $00,s
|
||||||
tsb $00
|
tsb $00
|
||||||
ora $00
|
ora $00
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
.byte $80
|
.byte $80
|
||||||
|
|
||||||
L101F ora (L0080,x)
|
L101F ora (L0080,x)
|
||||||
.byte $02,$80
|
cop #$80
|
||||||
ora $80,s
|
ora $80,s
|
||||||
tsb L0080
|
tsb L0080
|
||||||
ora L0080
|
ora L0080
|
||||||
|
Reference in New Issue
Block a user