From 016b03e3562666db24e5364b8034ad07314a96fc Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Tue, 7 Mar 2023 17:00:38 -0500 Subject: [PATCH 1/2] ca65 jmp (abs) wrap warning only applies to 6502, later CPUs do not have this bug --- src/ca65/instr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ca65/instr.c b/src/ca65/instr.c index b72be6711..7cbefaecf 100644 --- a/src/ca65/instr.c +++ b/src/ca65/instr.c @@ -1617,11 +1617,12 @@ static void PutJMP (const InsDesc* Ins) if (EvalEA (Ins, &A)) { /* Check for indirect addressing */ - if (A.AddrModeBit & AM65_ABS_IND) { + if (A.AddrModeBit & AM65_ABS_IND && CPU < CPU_65SC02) { /* 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 - ** things will go weird later. + ** things will go weird later. This only affects the 6502 CPU, + ** and was corrected in 65C02 and later CPUs in this family. */ ExprNode* E = GenNE (GenByteExpr (CloneExpr (A.Expr)), 0xFF); From 08223360d539aede5719696be9d287747950500b Mon Sep 17 00:00:00 2001 From: Bob Andrews Date: Tue, 2 May 2023 12:43:50 +0200 Subject: [PATCH 2/2] Update instr.c --- src/ca65/instr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ca65/instr.c b/src/ca65/instr.c index 7cbefaecf..4f95ec75c 100644 --- a/src/ca65/instr.c +++ b/src/ca65/instr.c @@ -1617,7 +1617,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)) { /* 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