1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00

New module

git-svn-id: svn://svn.cc65.org/cc65/trunk@2010 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2003-03-07 11:53:17 +00:00
parent 2be826ded6
commit 9257570050
2 changed files with 41 additions and 0 deletions

View File

@ -41,6 +41,7 @@ OBJS = add.o \
bneg.o \ bneg.o \
bpushbsp.o \ bpushbsp.o \
call.o \ call.o \
callmain.o \
compl.o \ compl.o \
condes.o \ condes.o \
decax1.o \ decax1.o \

40
libsrc/runtime/callmain.s Normal file
View File

@ -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