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:
@@ -48,6 +48,6 @@ done: rts
|
||||
; ------------------------------------------------------------------------
|
||||
; Data
|
||||
|
||||
.bss
|
||||
.data
|
||||
|
||||
__dos_type: .res 1 ; default to ATARIDOS
|
||||
__dos_type: .byte 0 ; default to ATARIDOS
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user