1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-04 13:29:35 +00:00
cc65/libsrc/apple2
Oliver Schmidt 3c1cd0d867 Added cmdline support to exec().
The starting point is the CALL2051:REM <cmdline> approach. It uses the BASIC input buffer at $200. ProDOS stores the name of the loaded program at $280 (which we want for argv[0]) leaving us with 128 char buffer. If we run the program via exec() we don't need the CALL2051 but only the REM token (which is just one char). So have a maximum cmdline length of 126 (plus a terminating zero).

There's no specification for ProDOS BIN file cmdline parameters so exec() just supports the CALL2051:REM <cmdline> approach. In contrast ProDOS SYS files allow for a 'startup filename'. A ProDOS filename is short than 126 chars so having exec() general cut the cmdline after 126 chars seems reasonable. If the SYS file we exec() allows for less we cut the cmdline further.

Our 'loader.system' SYS file however allows for an unusually 126 char long "startup filename" as it is targeted towards cc65 BIN porgrams with their 126 cmdline length.
2015-04-26 14:09:20 +02:00
..
emd Create static drivers directly from source files. 2014-06-04 23:50:18 +02:00
extra Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
joy Create static drivers directly from source files. 2014-06-04 23:50:18 +02:00
mou Create static drivers directly from source files. 2014-06-04 23:50:18 +02:00
ser Create static drivers directly from source files. 2014-06-04 23:50:18 +02:00
targetutil Added cmdline support to exec(). 2015-04-26 14:09:20 +02:00
tgi Create static drivers directly from source files. 2014-06-04 23:50:18 +02:00
_scrsize.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
break.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
cclear.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
cgetc.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
chline.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
close.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
closedir.c Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
clrscr.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
color.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
cout.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
cputc.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
crt0.s Moved interrupt enabling to the interrupt constructor. 2015-02-16 15:43:08 +01:00
ctype.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
curdevice.s Introduced getcurrentdevice() and implemented it for CBM and Apple. 2012-10-21 14:35:17 +00:00
cvline.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
devicedir.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
dioclose.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
diocommon.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
dioopen.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
dioread.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
diosectcount.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
diosectsize.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
diowrite.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
dir.h Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
dosdetect.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
exec.s Added cmdline support to exec(). 2015-04-26 14:09:20 +02:00
exehdr.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
filedes.inc Cosmetic changes from Oliver Schmidt 2005-04-15 08:27:09 +00:00
filedes.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
filename.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
get_ostype.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
getdevice.s I wasn't aware that the unit numbers in the ProDOS device list contain device type identifiers in the low nibble. So if we can't use the device list entries as-is we can as well present the high nibble as low nibble to the user thus providing more meaningful device numbers. 2012-10-15 21:59:51 +00:00
gotoxy.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
gotoy.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
home.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
initcwd.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
iobuf.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
irq.s Moved interrupt enabling to the interrupt constructor. 2015-02-16 15:43:08 +01:00
isdevice.s I wasn't aware that the unit numbers in the ProDOS device list contain device type identifiers in the low nibble. So if we can't use the device list entries as-is we can as well present the high nibble as low nibble to the user thus providing more meaningful device numbers. 2012-10-15 21:59:51 +00:00
joy_stat_stddrv.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
joy_stddrv.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
kbhit.s Cosmetic changes requested by Oliver Schmidt 2005-03-30 18:17:57 +00:00
libref.s Added library reference tgi_libref to TGI interface. 2013-06-01 12:42:00 +02:00
lseek.s assert parm count 2014-11-24 10:07:16 -08:00
mainargs.s Added cmdline support to exec(). 2015-04-26 14:09:20 +02:00
mcbdefault.s Some fine tuning of the mouse driver interface harmonization. 2014-01-17 21:09:15 +01:00
mli.inc Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
mli.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
mouse_stat_stddrv.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
mouse_stddrv.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
open.s Defined a struct to contain the date and time data 2013-08-03 19:08:36 +02:00
opendir.c Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
oserrlist.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
oserror.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
randomize.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
rdkey.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
read.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
readdir.c Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
reboot.s Avoid indirect jmp with unknown vector address. 2014-01-26 18:10:01 +01:00
revers.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
rewinddir.c Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
rwcommon.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
syschdir.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
sysmkdir.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
sysremove.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
sysrename.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
sysrmdir.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
systime.s Changed multi-line C comments into another style. 2014-06-30 16:51:07 -04:00
sysuname.s New uname function 2003-08-12 17:24:02 +00:00
textframe.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
tgi_colors.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
tgi_stat_stddrv.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
tgi_stddrv.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
toascii.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
videomode.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
vtabz.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
wherex.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
wherey.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
write.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00