1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-07-17 11:28:55 +00:00

An instruction used for its opcode should not be elidable

This commit is contained in:
Karol Stasiak 2018-01-04 01:08:47 +01:00
parent 504cb56ee7
commit 1f020e2ced

View File

@ -52,15 +52,16 @@ object DecimalBuiltIns {
val constantLabel = MlCompiler.nextLabel("c8")
val skipHiDigit = 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)
} else {
AssemblyLine.absolute(BIT, Label(constantLabel))
}
List(
if (rotate) AssemblyLine.implied(ROR) else AssemblyLine.implied(LSR),
AssemblyLine.label(constantLabel),
AssemblyLine.implied(PHP),
AssemblyLine(LABEL, DoesNotExist, Label(constantLabel).toAddress, elidable = cmos),
AssemblyLine(PHP, Implied, Constant.Zero, elidable = cmos),
AssemblyLine.relative(BPL, skipHiDigit),
AssemblyLine.implied(SEC),
AssemblyLine.immediate(SBC, 0x30),