From 7bb47d4b858c1837dc4c66af2c249679e748f10f Mon Sep 17 00:00:00 2001 From: Bobbi Webber-Manners Date: Tue, 13 Sep 2022 20:05:12 -0400 Subject: [PATCH] email.c: Turn off optimizer for inline asm --- apps/email.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/apps/email.c b/apps/email.c index 8ae2773..fffb8b9 100644 --- a/apps/email.c +++ b/apps/email.c @@ -925,6 +925,21 @@ void sanitize_filename(char *s) { enum aux_ops {FROMAUX, TOAUX}; +/* + * Asm code for copyaux() + */ +#pragma optimize (push, off) +void copyauxasm(enum aux_ops dir) { + if (dir == TOAUX) + __asm__("sec"); // Copy main->aux + else + __asm__("clc"); // Copy aux->main + __asm__("sta $c000"); // Turn off 80STORE + __asm__("jsr $c311"); // AUXMOVE + __asm__("sta $c001"); // Turn on 80STORE +} +#pragma optimize (pop) + /* * Aux memory copy routine */ @@ -935,13 +950,7 @@ void copyaux(char *src, char *dst, uint16_t len, enum aux_ops dir) { *a1 = src; *a2 = src + len - 1; // AUXMOVE moves length+1 bytes!! *a4 = dst; - if (dir == TOAUX) - __asm__("sec"); // Copy main->aux - else - __asm__("clc"); // Copy aux->main - __asm__("sta $c000"); // Turn off 80STORE - __asm__("jsr $c311"); // AUXMOVE - __asm__("sta $c001"); // Turn on 80STORE + copyauxasm(dir); } /*