Fixed wrong carry condition code info, how could that go unnoticed so long.

This commit is contained in:
Chris Hodges 2025-09-25 22:20:28 +02:00
parent a3f979b48b
commit 6233cefd20
2 changed files with 17 additions and 25 deletions

View File

@ -88,13 +88,13 @@ fun getCcInfo(cc: Int): Map<String, Pair<String, String>> {
CC_V_OR -> "*" to CC_OR_STR
else -> "*" to "$CC_RES_STR (usually for overflows)"
}
xnzvcMap["C"] = when (cc and CC_V_TST) {
xnzvcMap["C"] = when (cc and CC_C_TST) {
0 -> "-" to CC_NOT_AFFECTED_STR
CC_V_SET -> "1" to CC_ALWAYS_SET_STR
CC_V_CLEAR -> "0" to CC_ALWAYS_CLEAR_STR
CC_V_UNDEF -> "U" to CC_UNDEFINED_STR
CC_V_AND -> "*" to CC_AND_STR
CC_V_OR -> "*" to CC_OR_STR
CC_C_SET -> "1" to CC_ALWAYS_SET_STR
CC_C_CLEAR -> "0" to CC_ALWAYS_CLEAR_STR
CC_C_UNDEF -> "U" to CC_UNDEFINED_STR
CC_C_AND -> "*" to CC_AND_STR
CC_C_OR -> "*" to CC_OR_STR
else -> "*" to "$CC_RES_STR (usually carry/borrow)"
}

View File

@ -1085,7 +1085,7 @@ object M68kIsa {
IsaData(
"stop", "Stop",
machine = ALL_MACHINES, isPrivileged = true,
modes = listOf(AllowedAdrMode(setOf(AddressMode.IMMEDIATE_DATA), null, OP_UNSIZED))
modes = listOf(AllowedAdrMode(setOf(AddressMode.IMMEDIATE_DATA), null, OP_UNSIZED, affectedCc = cc("*****")))
),
*autoExpandForOtherCpus(
@ -1208,10 +1208,10 @@ object M68kIsa {
private val mnemonicLookupMap = isaData.asSequence()
.flatMap {
(if (it.conditionCodes.isEmpty()) it.altMnemonics.plus(it.mnemonic) else it.altMnemonics.plus(it.conditionCodes
.map { cc ->
it.mnemonic.replace("CC", cc)
})).map { mnemonic -> mnemonic to it }
(if (it.conditionCodes.isEmpty()) it.altMnemonics.plus(it.mnemonic) else it.altMnemonics.plus(
it.conditionCodes
.map { cc -> it.mnemonic.replace("CC", cc) }))
.map { mnemonic -> mnemonic to it }
}
.groupBy({ it.first }) { it.second }
@ -1223,24 +1223,16 @@ object M68kIsa {
fun findMatchingOpMode(candidates: List<IsaData>, op1: AddressMode?, op2: AddressMode?, opSize: Int?, specialReg: String?): List<IsaData> {
return candidates.filter {
it.modes.any { am ->
isAddressModeMatching(am, op1, op2, specialReg)
&& ((opSize == null) || ((opSize and am.size) == opSize))
}
it.modes.any { am -> isAddressModeMatching(am, op1, op2, specialReg) && ((opSize == null) || ((opSize and am.size) == opSize)) }
}
}
fun findMatchingAddressMode(modes: List<AllowedAdrMode>, op1: AddressMode?, op2: AddressMode?, opSize: Int?, specialReg: String?): List<AllowedAdrMode> {
return modes.filter { am ->
isAddressModeMatching(am, op1, op2, specialReg)
&& ((opSize == null) || ((opSize and am.size) == opSize))
}
return modes.filter { am -> isAddressModeMatching(am, op1, op2, specialReg) && ((opSize == null) || ((opSize and am.size) == opSize)) }
}
fun findMatchingOpModeIgnoringSize(candidates: List<IsaData>, op1: AddressMode?, op2: AddressMode?, specialReg: String?): List<IsaData> {
return candidates.filter {
it.modes.any { am -> isAddressModeMatching(am, op1, op2, specialReg) }
}
return candidates.filter { it.modes.any { am -> isAddressModeMatching(am, op1, op2, specialReg) } }
}
fun findSupportedOpSizes(candidates: List<IsaData>, op1: AddressMode?, op2: AddressMode?, specialReg: String?): Int {