]> git.sur5r.net Git - cc65/blobdiff - libsrc/c64/mainargs.s
fix comments
[cc65] / libsrc / c64 / mainargs.s
index ffd396cf99f8d7d591a6c1c71ec64accee804587..6b2f624bf2f572a9528fbe14b1b086028eebcf1a 100644 (file)
@@ -3,20 +3,21 @@
 ; Ullrich von Bassewitz, 2003-03-07
 ; Based on code from Stefan A. Haubenthal, <polluks@web.de>
 ; 2003-05-18, Greg King
+; 2004-04-28, 2005-02-26, Ullrich von Bassewitz
 ;
 ; Scan a group of arguments that are in BASIC's input-buffer.
 ; Build an array that points to the beginning of each argument.
 ; Send, to main(), that array and the count of the arguments.
-
+;
 ; Command-lines look like these lines:
 ;
 ; run
-; run : rem  no arguments because no comma!
-; run:rem,arg1," arg 2" , arg 3 ,, arg5, ...
+; run : rem
+; run:rem arg1 " arg 2 is quoted "  arg3 "" arg5
+;
+; "run" and "rem" are entokenned; the args. are not.  Leading and trailing
+; spaces outside of quotes are ignored.
 ;
-; "run" and "rem" are entokenned; the args. are not.  Leading spaces are
-; ignored; trailing spaces are included -- unless the argument was quoted.
-
 ; TO-DO:
 ; - The "file-name" might be a path-name; don't copy the directory-components.
 ; - Add a control-character quoting mechanism.
@@ -32,8 +33,11 @@ MAXARGS       = 10                   ; Maximum number of arguments allowed
 REM     = $8f                  ; BASIC token-code
 NAME_LEN = 16                  ; maximum length of command-name
 
-; Get possible command-line arguments.
-;
+; Get possible command-line arguments. Goes into the special INIT segment,
+; which may be reused after the startup code is run
+
+.segment        "INIT"
+
 initmainargs:
 
 ; Assume that the program was loaded, a moment ago, by the traditional LOAD
@@ -133,4 +137,4 @@ name:       .res    NAME_LEN + 1
 .data
 argv:   .addr   name
         .res           MAXARGS * 2
-                 
+