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:
@@ -60,6 +60,7 @@ OBJS = _scrsize.o \
|
||||
ktalk.o \
|
||||
kunlsn.o \
|
||||
kuntlk.o \
|
||||
mainargs.o \
|
||||
randomize.o \
|
||||
revers.o \
|
||||
tgi_mode_table.o
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
.export brk_jmp
|
||||
|
||||
.import condes, initlib, donelib
|
||||
.import push0, _main, zerobss
|
||||
.import push0, callmain, zerobss
|
||||
.import __IRQFUNC_TABLE__, __IRQFUNC_COUNT__
|
||||
|
||||
.include "zeropage.inc"
|
||||
@@ -99,13 +99,9 @@ L1: lda sp,x
|
||||
stx IRQVec+1
|
||||
cli
|
||||
|
||||
; Pass an empty command line
|
||||
; Push arguments and call main()
|
||||
|
||||
NoIRQ1: jsr push0 ; argc
|
||||
jsr push0 ; argv
|
||||
|
||||
ldy #4 ; Argument size
|
||||
jsr _main ; call the users code
|
||||
NoIRQ1: jsr callmain
|
||||
|
||||
; Back from main (this is also the _exit entry). Reset the IRQ vector if
|
||||
; we chained it.
|
||||
|
||||
21
libsrc/plus4/mainargs.s
Normal file
21
libsrc/plus4/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