1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-24 11:31:31 +00:00

Move constructor code into the INIT segment. Note: Didn't change any

obsolete modules.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3407 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2005-02-26 09:38:46 +00:00
parent 8e95d036e3
commit 54240ffad3
3 changed files with 19 additions and 5 deletions

View File

@ -161,6 +161,8 @@ L2: lda zpsave,x
; setup sp ; setup sp
.segment "INIT"
initsp: initsp:
lda APPMHI lda APPMHI
sta sp sta sp
@ -168,7 +170,7 @@ initsp:
sta sp+1 sta sp+1
rts rts
.data .data
zpsave: .res zpspace zpsave: .res zpspace

View File

@ -8,8 +8,11 @@
.constructor detect,26 .constructor detect,26
.export __dos_type .export __dos_type
; ------------------------------------------------------------------------
; DOS type detection ; DOS type detection
.segment "INIT"
detect: lda #ATARIDOS detect: lda #ATARIDOS
sta __dos_type ; set default sta __dos_type ; set default
@ -43,7 +46,10 @@ mydos: lda #MYDOS
sta __dos_type sta __dos_type
rts rts
.bss ; ------------------------------------------------------------------------
; Data
.bss
__dos_type: .res 1 __dos_type: .res 1

View File

@ -12,8 +12,11 @@ SPACE = 32 ; SPACE char.
.import __dos_type .import __dos_type
.constructor initmainargs,25 .constructor initmainargs,25
; --------------------------------------------------------------------------
; Get command line ; Get command line
.segment "INIT"
initmainargs: initmainargs:
lda #0 lda #0
sta __argc sta __argc
@ -32,7 +35,7 @@ nargdos:rts
argdos: lda #ATEOL argdos: lda #ATEOL
sta ourcl+CL_SIZE sta ourcl+CL_SIZE
; Move SpartaDOS command line to our own buffer ; Move SpartaDOS command line to our own buffer
lda DOSVEC lda DOSVEC
@ -112,7 +115,7 @@ eopar:
finargs: finargs:
lda __argc lda __argc
asl asl
tax tax
lda #0 lda #0
sta argv,x sta argv,x
@ -123,7 +126,10 @@ finargs:
stx __argv+1 stx __argv+1
rts rts
.bss ; --------------------------------------------------------------------------
; Data
.bss
argv: .res (1 + MAXARGS) * 2 argv: .res (1 + MAXARGS) * 2