Adjusted constructors.

The constructors are _NOT_ allowed anymore to access the BSS. Rather they must use the DATA segment or the INIT segment. The latter isn't cleared at any point so the constructors may use it to expose values to the main program. However they must make sure to always write the values as they are not pre-initialized.
This commit is contained in:
Oliver Schmidt
2016-03-16 16:28:32 +01:00
parent 3d6cbec6a1
commit 1d1ba3ed3b
16 changed files with 49 additions and 55 deletions

View File

@@ -48,6 +48,6 @@ done: rts
; ------------------------------------------------------------------------
; Data
.bss
.data
__dos_type: .res 1 ; default to ATARIDOS
__dos_type: .byte 0 ; default to ATARIDOS

View File

@@ -23,12 +23,6 @@ SPACE = 32 ; SPACE char.
.segment "ONCE"
initmainargs:
lda #0
sta __argc
sta __argc+1
sta __argv
sta __argv+1
lda __dos_type ; which DOS?
cmp #ATARIDOS
beq nargdos ; DOS does not support arguments
@@ -120,7 +114,7 @@ eopar:
finargs:
lda __argc
asl
asl
tax
lda #0
sta argv,x
@@ -134,7 +128,7 @@ finargs:
; --------------------------------------------------------------------------
; Data
.bss
.segment "INIT"
argv: .res (1 + MAXARGS) * 2