From: cuz Date: Fri, 7 Mar 2003 11:53:17 +0000 (+0000) Subject: New module X-Git-Tag: V2.12.0~1682 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9257570050fd4f402a9f3152c86d12e46325e848;p=cc65 New module git-svn-id: svn://svn.cc65.org/cc65/trunk@2010 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/runtime/Makefile b/libsrc/runtime/Makefile index ff7c4866c..f17099b4a 100644 --- a/libsrc/runtime/Makefile +++ b/libsrc/runtime/Makefile @@ -41,6 +41,7 @@ OBJS = add.o \ bneg.o \ bpushbsp.o \ call.o \ + callmain.o \ compl.o \ condes.o \ decax1.o \ diff --git a/libsrc/runtime/callmain.s b/libsrc/runtime/callmain.s new file mode 100644 index 000000000..7e7b6894e --- /dev/null +++ b/libsrc/runtime/callmain.s @@ -0,0 +1,40 @@ +; +; Ullrich von Bassewitz, 2003-03-07 +; +; Push arguments and call main() +; + + + .export callmain + .export __argc, __argv + + .import _main, pushax + +;--------------------------------------------------------------------------- +; Setup the stack for main(), then jump to it + +.proc callmain + + lda __argc + ldx __argc+1 + jsr pushax ; Push argc + + lda __argv + ldx __argv+1 + jsr pushax ; Push argv + + ldy #4 ; Argument size + jmp _main + +.endproc + +;--------------------------------------------------------------------------- +; Data + +.bss +__argc: .res 2 +__argv: .res 2 + + + +