You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
712 B
ArmAsm
41 lines
712 B
ArmAsm
;
|
|
; 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
|
|
|
|
|
|
|
|
|