]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/getargs.s
The spans do now contain the size of a span, no longer the end offset.
[cc65] / libsrc / atari / getargs.s
index d2d7157eadba7f2682951695bef8f3edc6819705..da7fd73aa8a79ab48b900cec5d6892154efbb223 100644 (file)
@@ -2,6 +2,11 @@
 
 ; Freddy Offenga, 4/21/2000
 
+; initmainargs is forcibly included by the C compiler if it encounters a
+; main() function with arguments. Therefore it isn't referenced by the
+; startup code but is nevertheless included in the compiled program when
+; needed.
+
 MAXARGS        = 16            ; max. amount of arguments in arg. table
 CL_SIZE = 64           ; command line buffer size
 SPACE  = 32            ; SPACE char.
@@ -12,8 +17,11 @@ SPACE        = 32            ; SPACE char.
        .import         __dos_type
        .constructor    initmainargs,25
 
+; --------------------------------------------------------------------------
 ; Get command line
 
+.segment        "INIT"
+
 initmainargs:
        lda     #0
        sta     __argc
@@ -32,7 +40,7 @@ nargdos:rts
 
 argdos:        lda     #ATEOL
        sta     ourcl+CL_SIZE
-        
+
 ; Move SpartaDOS command line to our own buffer
 
        lda     DOSVEC
@@ -112,7 +120,7 @@ eopar:
 
 finargs:
        lda     __argc
-       asl
+       asl           
        tax
        lda     #0
        sta     argv,x
@@ -123,7 +131,10 @@ finargs:
        stx     __argv+1
        rts
 
-       .bss
+; --------------------------------------------------------------------------
+; Data
+
+.bss
 
 argv:  .res    (1 + MAXARGS) * 2