Add options to disable BSS clear on startup
This commit is contained in:
parent
b48b8b836d
commit
8fbe96b9ac
|
@ -141,6 +141,8 @@ A list of source files can be provided.
|
||||||
* -dNOLONG : no support for long in printf
|
* -dNOLONG : no support for long in printf
|
||||||
* -dNOFLOAT : no float in printf
|
* -dNOFLOAT : no float in printf
|
||||||
* -dHEAPCHECK : check heap allocate and free and jam if heap full or free out of range
|
* -dHEAPCHECK : check heap allocate and free and jam if heap full or free out of range
|
||||||
|
* -dNOBSSCLEAR : don't clear BSS segment on startup
|
||||||
|
* -dNOZPCLEAR : don't clear zeropage BSS segment on startup
|
||||||
|
|
||||||
#### Supported target machines
|
#### Supported target machines
|
||||||
|
|
||||||
|
|
|
@ -235,6 +235,7 @@ w0:
|
||||||
|
|
||||||
// Clear BSS Segment
|
// Clear BSS Segment
|
||||||
|
|
||||||
|
#ifndef NOBSSCLEAR
|
||||||
lda #<BSSStart
|
lda #<BSSStart
|
||||||
sta ip
|
sta ip
|
||||||
lda #>BSSStart
|
lda #>BSSStart
|
||||||
|
@ -264,7 +265,8 @@ l2: dey
|
||||||
sta (ip), y
|
sta (ip), y
|
||||||
bne l2
|
bne l2
|
||||||
w2:
|
w2:
|
||||||
|
#endif
|
||||||
|
#ifndef NOZPCLEAR
|
||||||
ldx #<ZeroStart
|
ldx #<ZeroStart
|
||||||
cpx #<ZeroEnd
|
cpx #<ZeroEnd
|
||||||
beq w3
|
beq w3
|
||||||
|
@ -273,6 +275,7 @@ l3: sta $00, x
|
||||||
cpx #<ZeroEnd
|
cpx #<ZeroEnd
|
||||||
bne l3
|
bne l3
|
||||||
w3:
|
w3:
|
||||||
|
#endif
|
||||||
lda #<StackEnd - 2
|
lda #<StackEnd - 2
|
||||||
sta sp
|
sta sp
|
||||||
lda #>StackEnd - 2
|
lda #>StackEnd - 2
|
||||||
|
|
Loading…
Reference in New Issue