[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: An idea that might go nowhere - ProDOS + CC65 = :>?
On Sat, 30 Oct 2010, Oliver Schmidt wrote:
Hi Steve,
Dunno if it launch cc65 executables with full
argv support though (prolly not), which was what I wanted to do, so that I
could run commands like "cal 11 2010" or such which wouldn't really be
supported all that well on a shell that didn't understand specifically how
cc65 expected its command lines to be created
You are aware that you can already make use of the ProDOS startup file
protocol for system programs described here:
http://www.easy68k.com/paulrsm/6502/PDOS8TRM.HTM#5.1.5.1
My version of EHBASIC actually uses it. That of course gives you a single
parameter.
To do so use my LOADER.SYSTEM as described here:
http://www.cc65.org/doc/apple2-4.html#ss4.4
The startup file given to LOADER.SYSTEM will appear as argv[1] in the
cc65 main(). This works i.e. nicely with Davex or the GS/OS finder
using an icon file.
(apparently it uses the fpbasic parser?)
No.
I am basing on this:
http://www.cc65.org/doc/apple2-9.html#ss9.1
9.1 Passing arguments to the program
Command line arguments can be passed to main() after BLOAD. Since this is
not supported by BASIC, the following syntax was chosen:
]CALL2051:REM ARG1 " ARG2 IS QUOTED" ARG3 "" ARG5
1. Arguments are separated by spaces.
2. Arguments may be quoted.
3. Leading and trailing spaces around an argument are ignored. Spaces
within a quoted argument are allowed.
4. The first argument passed to main is the program name.
5. A maximum number of 10 arguments (including the program name) are
supported.
(End of quotation)
This is where my "apparently it uses the fpbasic parser?" originates.
I could imagine that you'd like to see two things:
1. Not requiring LOADER.SYSTEM but having the same capability with the
config described here:
http://www.cc65.org/doc/apple2-4.html#ss4.3
2. Being able to use argv[2] etc.
Pretty much, both. (And most likely I'd be using the CMD filetype or
some other filetype than SYS or BIN.)
The ProDOS startup file protocol mentioned above could easily be
"extended" to hand over several parameters to a cc65 program -
especially as the $2006 buffer size isn't limited to the ProDOS
pathname size but can be up to 255 bytes (set by $2005). There's just
no shell so far trying to do so ;-)
Given that MS-DOG places the command line, in the raw, at $0080 terminated
by a CR... just dumping the whole command line off as a Pascal string at
$2005 sounds perfectly viable to me, though then the command line parser
would need to be probably fairly complex. Naturally this is what Borland
C etc. have to do.
So here's the deal: If you come up with a working ProDOS shell with
reasonable functionality that uses the ProDOS startup file protocol to
"just" copy arbitrary command line parameters to the $2006 buffer let
me know and I'll add support for it to the C library thus overcoming
the current restrictions 1.) and 2.) stated above !
Regards,
Oliver
I wonder if this is *already* compatible with other shells?
-uso.