From 8fbe96b9ac1beb25cc2967712a139447f1536496 Mon Sep 17 00:00:00 2001 From: drmortalwombat <90205530+drmortalwombat@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:31:17 +0200 Subject: [PATCH] Add options to disable BSS clear on startup --- README.md | 2 ++ include/crt.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 518738d..55cfea0 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/include/crt.c b/include/crt.c index 4f82061..24a5568 100644 --- a/include/crt.c +++ b/include/crt.c @@ -235,6 +235,7 @@ w0: // Clear BSS Segment +#ifndef NOBSSCLEAR lda #BSSStart @@ -264,7 +265,8 @@ l2: dey sta (ip), y bne l2 w2: - +#endif +#ifndef NOZPCLEAR ldx #StackEnd - 2