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:
@@ -37,6 +37,7 @@ OBJS = _scrsize.o \
|
||||
kplot.o \
|
||||
kscnkey.o \
|
||||
kudtim.o \
|
||||
mainargs.o \
|
||||
peeksys.o \
|
||||
pokesys.o \
|
||||
randomize.o \
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
.exportzp ktab2, ktab3, ktab4, time, RecvBuf, SendBuf
|
||||
|
||||
.import initlib, donelib
|
||||
.import push0, _main
|
||||
.import push0, callmain
|
||||
.import __BSS_RUN__, __BSS_SIZE__
|
||||
.import irq, nmi
|
||||
.import k_irq, k_nmi, PLOT, UDTIM, SCNKEY
|
||||
@@ -214,11 +214,6 @@ Z4:
|
||||
|
||||
jsr initlib
|
||||
|
||||
; Create the (empty) command line for the program
|
||||
|
||||
jsr push0 ; argc
|
||||
jsr push0 ; argv
|
||||
|
||||
; Execute the program code
|
||||
|
||||
jmp Start
|
||||
@@ -293,10 +288,9 @@ Start:
|
||||
|
||||
cli
|
||||
|
||||
; Call the user code
|
||||
; Push arguments and call main()
|
||||
|
||||
ldy #4 ; Argument size
|
||||
jsr _main ; call the users code
|
||||
jsr callmain
|
||||
|
||||
; Call module destructors. This is also the _exit entry.
|
||||
|
||||
|
||||
21
libsrc/cbm610/mainargs.s
Normal file
21
libsrc/cbm610/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