Move constructor code into the INIT segment
git-svn-id: svn://svn.cc65.org/cc65/trunk@3405 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -59,7 +59,7 @@ L2: sta ENABLE_ROM ; Bank in the ROM
|
||||
.constructor initkbd
|
||||
.destructor donekbd
|
||||
|
||||
.code ; Can go into the normal code segment
|
||||
.segment "INIT" ; Special init code segment may get overwritten
|
||||
|
||||
.proc initkbd
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
; Ullrich von Bassewitz, 2003-03-07
|
||||
; Based on code from Stefan A. Haubenthal, <polluks@web.de>
|
||||
; 2003-05-18, Greg King
|
||||
; 2004-04-28, Ullrich von Bassewitz
|
||||
; 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.
|
||||
@@ -26,15 +26,18 @@
|
||||
.import __argc, __argv
|
||||
|
||||
.include "plus4.inc"
|
||||
|
||||
|
||||
|
||||
|
||||
MAXARGS = 10 ; Maximum number of arguments allowed
|
||||
REM = $8f ; BASIC token-code
|
||||
NAME_LEN = 16 ; maximum length of command-name
|
||||
REM = $8f ; BASIC token-code
|
||||
NAME_LEN = 16 ; maximum length of command-name
|
||||
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; which may be reused after the startup code is run
|
||||
|
||||
.segment "INIT"
|
||||
|
||||
; Get possible command-line arguments.
|
||||
;
|
||||
initmainargs:
|
||||
|
||||
; Assume that the program was loaded, a moment ago, by the traditional LOAD
|
||||
@@ -117,12 +120,13 @@ argloop:lda BASIC_BUF,x
|
||||
|
||||
; (The last vector in argv[] already is NULL.)
|
||||
|
||||
done: lda #<argv
|
||||
done: lda #<argv
|
||||
ldx #>argv
|
||||
sta __argv
|
||||
stx __argv + 1
|
||||
rts
|
||||
|
||||
|
||||
; --------------------------------------------------------------------------
|
||||
; These arrays are zeroed before initmainargs is called.
|
||||
; char name[16+1];
|
||||
; char* argv[MAXARGS+1]={name};
|
||||
|
||||
Reference in New Issue
Block a user