2003-03-07 11:53:17 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 2003-03-07
|
|
|
|
;
|
|
|
|
; Push arguments and call main()
|
|
|
|
;
|
|
|
|
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export callmain
|
|
|
|
.export __argc, __argv
|
2003-03-07 11:53:17 +00:00
|
|
|
|
|
|
|
.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
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
ldy #4 ; Argument size
|
2003-03-07 11:53:17 +00:00
|
|
|
jmp _main
|
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------------
|
|
|
|
; Data
|
|
|
|
|
2015-10-14 20:52:09 +00:00
|
|
|
.data
|
|
|
|
__argc: .word 0
|
|
|
|
__argv: .addr 0
|
2003-03-07 11:53:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|