Re: [cc65] Modules with self modifying code

From: Oliver Schmidt <ol.sc1web.de>
Date: 2011-02-07 12:59:11
Hi Gábor,

> hmmm but then I can't clearly say why we mix two different things into one
> segment, then we can also say that RODATA and CODE is the same (read-only)
> so we don't need two separated segment for that either (it's fair if we can
> say that DATA is ok for - smc - code too ...)

I totally agree with you !

If we put smc in DATA (as I strongly prefer over CODE) than the
distinction between RODATA and CODE is "inconsistent" because we say
that we only distinct r/w vs. r/o segments. I personally could live
very well with that approach. r/o is an attribute expressable in the
linker config and there are usescases for it (i.e. ROM carts). I still
remember that when I started with cc65 I was surprised that the
assmbler would let me place opcodes in RODATA - so I learned that
RODATA vs. CODE is more a logic distinction than a technical one.

I was actually somewhat surprised that Uz argued against another
segment for smc because of  linker config readability. Because with
that mindset I believe we should have never introduced ZPSAVE just to
shave a vew bytes from the binary (not from RAM usage !).

I can imagine two consistent policies:

1. Have many segments allowing for logic distinguishing: Then we
should introduce RWCODE (or SMCODE or ...).

2. Have few segments maximizing linker config readability and limiting
to the technical distinguishing of r/w vs. r/o: Then we should remove
RODATA and ZPSAVE and put smc into DATA.

Just my two - yet again lengthy - cents,
Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Feb 7 12:59:30 2011

This archive was generated by hypermail 2.1.8 : 2011-02-07 12:59:32 CET