Add options to disable BSS clear on startup

This commit is contained in:
drmortalwombat 2024-08-23 20:31:17 +02:00
parent b48b8b836d
commit 8fbe96b9ac
2 changed files with 6 additions and 1 deletions

View File

@ -141,6 +141,8 @@ A list of source files can be provided.
* -dNOLONG : no support for long in printf
* -dNOFLOAT : no float in printf
* -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

View File

@ -235,6 +235,7 @@ w0:
// Clear BSS Segment
#ifndef NOBSSCLEAR
lda #<BSSStart
sta ip
lda #>BSSStart
@ -264,7 +265,8 @@ l2: dey
sta (ip), y
bne l2
w2:
#endif
#ifndef NOZPCLEAR
ldx #<ZeroStart
cpx #<ZeroEnd
beq w3
@ -273,6 +275,7 @@ l3: sta $00, x
cpx #<ZeroEnd
bne l3
w3:
#endif
lda #<StackEnd - 2
sta sp
lda #>StackEnd - 2