[cc65] [PATCH 1/3] Allow Bcc from one segment to another.

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2012-08-17 21:11:39
From: Spiro Trikaliotis <spiro.trikaliotis@gmx.de>

This patch allows ca65 to emit branch statements (Bcc) from one
segment to another.

ld65 handles these branches correctly as long as there is no range error
(-128 .. 127); unfortunately, if the range is too big, bit the
difference would fit into 1 byte, ld65 does not emit an error, but
generates wrong code.
---
 src/ca65/segment.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/ca65/segment.c b/src/ca65/segment.c
index d0367ce..ee08a35 100644
--- a/src/ca65/segment.c
+++ b/src/ca65/segment.c
@@ -416,7 +416,7 @@ void SegDone (void)
      	     	     * the linker. However, we can check if the address size
                      * matches the fragment size, and we will do so.
      	    	     */
-                    if ((F->Len == 1 && ED.AddrSize > ADDR_SIZE_ZP)  ||
+                    if (/* (F->Len == 1 && ED.AddrSize > ADDR_SIZE_ZP)  || */
                         (F->Len == 2 && ED.AddrSize > ADDR_SIZE_ABS) ||
                         (F->Len == 3 && ED.AddrSize > ADDR_SIZE_FAR)) {
      	       	        LIError (&F->LI, "Range error");
-- 
1.7.9

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Aug 17 21:12:43 2012

This archive was generated by hypermail 2.1.8 : 2012-08-17 21:12:46 CEST