Re: [cc65] Modules with self modifying code

From: Gábor Lénárt <lgb1lgb.hu>
Date: 2011-02-07 09:26:51
Hi,

On Sun, Feb 06, 2011 at 08:38:26PM +0100, Ullrich von Bassewitz wrote:
> 
> Hi!
> 
> On Sun, Feb 06, 2011 at 04:49:56PM +0100, Oliver Schmidt wrote:
> > And placing the smc code in the data segment as I suggested wouldn't
> > cause any surprise even for those:
> 
> Ok, convinced. Let it be the data segment.

As far as I see, these segment names and purposes are a bit confusing on
6502 any way, these were designed for platforms where there is more hw level
protection of segments like:

non-executable + read only = RODATA
non-executable + read-write = DATA or BSS (the difference: BSS is not stored
  but initialized to zero on run-time)
executable + read only = CODE (or called TEXT originally??)
executable + read-write = (would be) SMC??

I always felt, that in most cases a 6502 target does not need to be
separated (at least not with "default" targets, for sure, some targets like
an OS - though I am not sure with lunix - may need these), the only thing is
writeable or not, so in theory there is even not so much 

But if it's true, that we have not-so-much valid segment types (in the sense
of 6502) then we could have even more one, the writable CODE segment, which
would be the place for smc. The other solution would be the DATA segment,
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 ...)
----------------------------------------------------------------------
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 09:26:59 2011

This archive was generated by hypermail 2.1.8 : 2011-02-07 09:27:04 CET