Merge pull request #2006 from bbbradsmith/ca65_jmp_abs_wrap_error

jmp (abs) wrap warning promoted to an error, suppressed on 65C02/etc
This commit is contained in:
Bob Andrews
2023-09-08 18:26:55 +02:00
committed by GitHub
4 changed files with 32 additions and 7 deletions

View File

@@ -1618,7 +1618,7 @@ static void PutJMP (const InsDesc* Ins)
if (EvalEA (Ins, &A)) {
/* Check for indirect addressing */
if ((A.AddrModeBit & AM65_ABS_IND) && (CPU < CPU_65SC02)) {
if ((A.AddrModeBit & AM65_ABS_IND) && (CPU < CPU_65SC02) && (RelaxChecks == 0)) {
/* Compare the low byte of the expression to 0xFF to check for
** a page cross. Be sure to use a copy of the expression otherwise
@@ -1631,7 +1631,7 @@ static void PutJMP (const InsDesc* Ins)
unsigned Msg = GetStringId ("\"jmp (abs)\" across page border");
/* Generate the assertion */
AddAssertion (E, ASSERT_ACT_WARN, Msg);
AddAssertion (E, ASSERT_ACT_ERROR, Msg);
}
/* No error, output code */