1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-07-05 09:28:54 +00:00

6502: Fix word addition if zpreg is larger than 2

This commit is contained in:
Karol Stasiak 2018-08-07 17:35:40 +02:00
parent 3e7bbaf5fc
commit f937355c54

View File

@ -67,7 +67,7 @@ object PseudoregisterBuiltIns {
}
val b = ctx.env.get[Type]("byte")
val w = ctx.env.get[Type]("word")
val reg = ctx.env.get[VariableInMemory]("__reg")
val reg = ctx.env.get[VariableInMemory]("__reg.loword")
// TODO: smarter on 65816
val op = if (subtract) SBC else ADC
val prepareCarry = AssemblyLine.implied(if (subtract) SEC else CLC)