[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 8-bit unzip utility
In article <1182319202.810467.211300@q19g2000prn.googlegroups.com>,
mdj <mdj.mdj@gmail.com> wrote:
> On Jun 20, 7:12 am, pau...@saaf.se (Paul Schlyter) wrote:
>
>> and compile it on any platform of one's choice, provided a suitable C
>> compiler is available for that platform. With e.g. Aztec C, one ought
>> to be able to produce executable files also for the 8-bit Apple II.
>
> You might have more luck cross-compiling it with cc65, since none of
> the native 8-bit C compilers are ANSI level, and even then it might be
> tricky since not even cc65 is a full implementation
I just glanced through the C sources of unzip:
> (no floating point,
No problem - unzip doesn't use floating point. Did you really believe it did?
> bit fields,
unzip doesn't use bit fields either....
> or passing structs as arguments to functions).
I didn't find any structs passed by value in the unzip C sources either....
unzip does however use "new style" function headers here and there, so these
headers might have to be rewritten in K&R style. It'll take maybe 15 minutes
or so to do that.
> Then there's the hassle that there's no command line interpreter on
> the Apple II,
REALLY? So you mean I cannot type e.g.
BRUN UNZIP
on the Apple II ????? <g>
There is a command line on the Apple II, but it doesn't take arbitrary
arguments. Any argument which doesn't follow the prescribed syntax
are treated as syntax errors - and those arguments which do follow the
prescribed syntax aren't passed by the program, but are consumed by
the "shell" (i.e. DOS 3.x or ProDOS).
But something like:
BRUN MYPROGRAM,S5,D2,A$5000
*is* a command line, and it's interpreted by DOS 3.x. Or do you think
it's a GUI? <evil grin>
Apple DOS 3.x contains three parts:
1. The command-line interpreter
2. The File Manager
3. RWTS
> so you'd need to construct some sort of wrapper program
> that handled argument passing, etc.
That ought to be included in cc65 already -- how else can the runtime
library of cc65 manage to fill the argv[] array with proper contents?
Quite naturally, unzip uses argc/argv to fetch its input arguments.
(I'm here making the optimistic assumption that cc65 will produce
executable binaries for the Apple II, but maybe that assumption is false).
> More luck may be had with the WDC's 65xx toolchain, which is
> supposedly an ANSI C implementation, but it more than likely produces
> 65C02 code, and quite possibly uses the Rockwell/WDC extensions as
> well.
That should be runnable on the IIe, which also is an 8-bit computer.
Also: if WDC's 65xx toolchain is any good, it ought to have some
compiler switch which makes it generate working code also for the
original 6502. But maybe WDC's 65xx toolchain isn't any good?
> Matt
--
----------------------------------------------------------------
Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN
e-mail: pausch at stockholm dot bostream dot se
WWW: http://stjarnhimlen.se/