Added routines to handle command line params
git-svn-id: svn://svn.cc65.org/cc65/trunk@2012 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -38,6 +38,7 @@ OBJS = _scrsize.o \
|
||||
kbhit.o \
|
||||
kernal.o \
|
||||
kplot.o \
|
||||
mainargs.o \
|
||||
randomize.o \
|
||||
revers.o
|
||||
|
||||
@@ -66,4 +67,4 @@ clean:
|
||||
zap: clean
|
||||
@rm -f $(EMDS) $(JOYS) $(TGIS)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
.export _exit
|
||||
.import initlib, donelib
|
||||
.import zerobss, push0
|
||||
.import _main
|
||||
.import callmain
|
||||
.import RESTOR, BSOUT, CLRCH
|
||||
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
||||
|
||||
@@ -75,13 +75,9 @@ L1: lda sp,x
|
||||
|
||||
jsr initlib
|
||||
|
||||
; Pass an empty command line
|
||||
; Push arguments and call main()
|
||||
|
||||
jsr push0 ; argc
|
||||
jsr push0 ; argv
|
||||
|
||||
ldy #4 ; Argument size
|
||||
jsr _main ; call the users code
|
||||
jsr callmain
|
||||
|
||||
; Call module destructors. This is also the _exit entry.
|
||||
|
||||
|
||||
21
libsrc/vic20/mainargs.s
Normal file
21
libsrc/vic20/mainargs.s
Normal file
@@ -0,0 +1,21 @@
|
||||
;
|
||||
; Ullrich von Bassewitz, 2003-03-07
|
||||
;
|
||||
; Setup arguments for main
|
||||
;
|
||||
|
||||
|
||||
.constructor initmainargs, 24
|
||||
.import __argc, __argv
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Setup arguments for main
|
||||
|
||||
.proc initmainargs
|
||||
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user