mirror of
https://github.com/fadden/6502bench.git
synced 2025-01-20 14:31:17 +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:
parent
434f0506d5
commit
0abea2beac
@ -153,6 +153,7 @@ namespace SourceGen.AsmGen {
|
||||
|
||||
Project = project;
|
||||
Quirks = new AssemblerQuirks();
|
||||
Quirks.StackIntOperandIsImmediate = true;
|
||||
|
||||
mWorkDirectory = workDirectory;
|
||||
mFileNameBase = fileNameBase;
|
||||
@ -326,8 +327,8 @@ namespace SourceGen.AsmGen {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (op == OpDef.OpCOP_StackInt || op == OpDef.OpWDM_WDM) {
|
||||
// 64tass doesn't like these to have an operand. Output as hex.
|
||||
if (op == OpDef.OpWDM_WDM) {
|
||||
// 64tass v1.54 doesn't like this to have an operand. Output as hex.
|
||||
return null;
|
||||
}
|
||||
return string.Empty; // indicate original is fine
|
||||
|
@ -267,6 +267,11 @@ namespace SourceGen.AsmGen {
|
||||
}
|
||||
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];
|
||||
if (doAddCycles) {
|
||||
bool branchCross = (attr.Address & 0xff00) != (operandForSymbol & 0xff00);
|
||||
|
@ -178,6 +178,11 @@ namespace SourceGen.AsmGen {
|
||||
/// </summary>
|
||||
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>
|
||||
/// Does the assembler configure assembler widths based on SEP/REP, but doesn't
|
||||
/// track the emulation bit?
|
||||
|
@ -20,7 +20,7 @@
|
||||
.byte $ff
|
||||
|
||||
L101F ora ($ff,x)
|
||||
.byte $02,$ff
|
||||
cop #$ff
|
||||
ora $ff,s
|
||||
tsb $ff
|
||||
ora $ff
|
||||
|
@ -20,7 +20,7 @@
|
||||
.byte $00
|
||||
|
||||
L101F ora ($00,x)
|
||||
.byte $02,$00
|
||||
cop #$00
|
||||
ora $00,s
|
||||
tsb $00
|
||||
ora $00
|
||||
|
@ -21,7 +21,7 @@
|
||||
.byte $80
|
||||
|
||||
L101F ora (L0080,x)
|
||||
.byte $02,$80
|
||||
cop #$80
|
||||
ora $80,s
|
||||
tsb L0080
|
||||
ora L0080
|
||||
|
Loading…
x
Reference in New Issue
Block a user