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

@@ -39,7 +39,7 @@ L2: jsr KBDREAD ; Read char and return in A
;--------------------------------------------------------------------------
; Module constructor/destructor
.bss
.segment "INIT"
keyvec: .res 2
.segment "ONCE"
@@ -48,9 +48,9 @@ initcgetc:
; Save the old vector
lda KeyStoreVec
ldx KeyStoreVec+1
sta keyvec
lda KeyStoreVec+1
sta keyvec+1
stx keyvec+1
; Set the new vector. I can only hope that this works for other C128
; versions...
@@ -68,5 +68,3 @@ SetVec: sei
stx KeyStoreVec+1
cli
rts