Re: [cc65] some patches

From: Kajtár Zsolt <kajtarzsolt1googlemail.com>
Date: 2010-03-16 17:45:22
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>> At the beginning of a the user's program would redefine a few routine calls to
>> alternative versions in the library header files (stdio.h, unistd.h) for
>> read/write and possibly seek.
> 
> That doesn't work.
> 
> If you use printf, write() is called internally. printf calls fprintf which
> calls vfprintf, which calls write. In this call chain, the address of write is
> part of the precompiled library and a simple #define in the user code won't
> change the contents of the library you're linking to your application.

Blockread/write only makes sense with bulk data transfers, and printf is
usually not used like that.

>> What is the reason for the final RESTOR? Interrupts are restored already,
>> anything else?
> 
> The call to RESTOR is probably a relict from older versions that didn't have
> destructors.  Some parts of the library set their own vectors (the debugger
> for example takes over the BREAK vector). RESTOR is called so that even in
> case of a program abort, the machine is not left in an unstable state. I
> haven't checked the code, it may be possible to add destructors if they're not
> already present and remove the call.

Ok, I see.

>>> So we will have to live with the fact that the cc65 do only cover the most
>>> common case. If it is cheap, they can also cover a few less common ones, too.
>> There would be no cost if it's not selected.
> 
> How are you going to "select" it? As said above, using #defines won't work.
> The only thing that works is a separate library, but ...
> 
>> I'm not sure if this is a good idea, at least I would not do it.
> 
> ... that doesn't seem to get your approval :-)

Because probably I would not update it often enough.

Ok, so I know the answers now, thanks!

- --
						    -soci-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkuftaIACgkQyBOVYiJltRZzhgCfY5QvzPZKJ4Jgh7nXfPzVFZOe
KhYAn1HMWQdhcrenOAMDF9V8O+lV9/lc
=HByk
-----END PGP SIGNATURE-----
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Mar 16 17:47:10 2010

This archive was generated by hypermail 2.1.8 : 2010-03-16 17:47:13 CET