mirror of
https://github.com/KarolS/millfork.git
synced 2024-09-13 15:56:42 +00:00
An instruction used for its opcode should not be elidable
This commit is contained in:
parent
504cb56ee7
commit
1f020e2ced
@ -52,15 +52,16 @@ object DecimalBuiltIns {
|
|||||||
val constantLabel = MlCompiler.nextLabel("c8")
|
val constantLabel = MlCompiler.nextLabel("c8")
|
||||||
val skipHiDigit = MlCompiler.nextLabel("ds")
|
val skipHiDigit = MlCompiler.nextLabel("ds")
|
||||||
val skipLoDigit = MlCompiler.nextLabel("ds")
|
val skipLoDigit = MlCompiler.nextLabel("ds")
|
||||||
val bit = if (ctx.options.flags(CompilationFlag.EmitCmosOpcodes)) {
|
val cmos = ctx.options.flags(CompilationFlag.EmitCmosOpcodes)
|
||||||
|
val bit = if (cmos) {
|
||||||
AssemblyLine.immediate(BIT, 8)
|
AssemblyLine.immediate(BIT, 8)
|
||||||
} else {
|
} else {
|
||||||
AssemblyLine.absolute(BIT, Label(constantLabel))
|
AssemblyLine.absolute(BIT, Label(constantLabel))
|
||||||
}
|
}
|
||||||
List(
|
List(
|
||||||
if (rotate) AssemblyLine.implied(ROR) else AssemblyLine.implied(LSR),
|
if (rotate) AssemblyLine.implied(ROR) else AssemblyLine.implied(LSR),
|
||||||
AssemblyLine.label(constantLabel),
|
AssemblyLine(LABEL, DoesNotExist, Label(constantLabel).toAddress, elidable = cmos),
|
||||||
AssemblyLine.implied(PHP),
|
AssemblyLine(PHP, Implied, Constant.Zero, elidable = cmos),
|
||||||
AssemblyLine.relative(BPL, skipHiDigit),
|
AssemblyLine.relative(BPL, skipHiDigit),
|
||||||
AssemblyLine.implied(SEC),
|
AssemblyLine.implied(SEC),
|
||||||
AssemblyLine.immediate(SBC, 0x30),
|
AssemblyLine.immediate(SBC, 0x30),
|
||||||
|
Loading…
Reference in New Issue
Block a user