]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/getargs.s
no TGI_ERR_NO_MEM or TGI_ERR_NO_IOCB anymore: replaced by TGI_ERR_NO_RES
[cc65] / libsrc / atari / getargs.s
index f8f24793750891d7e8f164d2b7b4dc4fc43831ac..7a43407c49838306faa722e47fd0776697dfc151 100644 (file)
@@ -12,8 +12,11 @@ SPACE        = 32            ; SPACE char.
        .import         __dos_type
        .constructor    initmainargs,25
 
+; --------------------------------------------------------------------------
 ; Get command line
 
+.segment        "INIT"
+
 initmainargs:
        lda     #0
        sta     __argc
@@ -23,14 +26,16 @@ initmainargs:
 
        lda     __dos_type      ; which DOS?
        cmp     #ATARIDOS
+       beq     nargdos         ; DOS does not support arguments
+       cmp     #MYDOS
        bne     argdos          ; DOS supports arguments
-       rts
+nargdos:rts
 
 ; Initialize ourcl buffer
 
 argdos:        lda     #ATEOL
        sta     ourcl+CL_SIZE
-        
+
 ; Move SpartaDOS command line to our own buffer
 
        lda     DOSVEC
@@ -110,7 +115,7 @@ eopar:
 
 finargs:
        lda     __argc
-       asl
+       asl           
        tax
        lda     #0
        sta     argv,x
@@ -121,7 +126,10 @@ finargs:
        stx     __argv+1
        rts
 
-       .bss
+; --------------------------------------------------------------------------
+; Data
+
+.bss
 
 argv:  .res    (1 + MAXARGS) * 2