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:
@@ -43,6 +43,6 @@ initdostype:
|
||||
: sta __dos_type
|
||||
done: rts
|
||||
|
||||
.bss
|
||||
.data
|
||||
|
||||
__dos_type: .res 1
|
||||
__dos_type: .byte $00
|
||||
|
||||
@@ -90,6 +90,6 @@ iobuf_free:
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.bss
|
||||
.data
|
||||
|
||||
table: .res MAX_FDS
|
||||
|
||||
@@ -65,6 +65,6 @@ _get_ostype:
|
||||
ldx #$00
|
||||
rts
|
||||
|
||||
.bss
|
||||
.segment "INIT"
|
||||
|
||||
ostype: .res 1
|
||||
|
||||
@@ -83,6 +83,7 @@ initmainargs:
|
||||
; destroyed.
|
||||
|
||||
ldy #$00
|
||||
sty buffer + BUF_LEN - 1
|
||||
: lda BASIC_BUF,x
|
||||
sta buffer,y
|
||||
inx
|
||||
@@ -166,14 +167,13 @@ done: lda #<argv
|
||||
stx __argv+1
|
||||
rts
|
||||
|
||||
; This array is zeroed before initmainargs is called.
|
||||
; char* argv[MAXARGS+1] = {FNAM};
|
||||
|
||||
.data
|
||||
|
||||
; char* argv[MAXARGS+1] = {FNAM};
|
||||
|
||||
argv: .addr FNAM
|
||||
.res MAXARGS * 2
|
||||
|
||||
.bss
|
||||
.segment "INIT"
|
||||
|
||||
buffer: .res BUF_LEN
|
||||
|
||||
Reference in New Issue
Block a user