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:
cuz
2003-03-10 21:21:46 +00:00
parent 065b8f2596
commit 467d8ad9c5
34 changed files with 340 additions and 90 deletions

View File

@@ -20,6 +20,7 @@
C_OBJS =
S_OBJS = crt0.o \
mainargs.o \
systime.o
#--------------------------------------------------------------------------

View File

@@ -8,7 +8,7 @@
.export _exit
.import initlib, donelib
.import push0, _main, zerobss
.import push0, callmain, zerobss
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
.importzp sp
@@ -41,13 +41,9 @@
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/atmos/mainargs.s Normal file
View 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