From 8bae793f485eb687f8d4cfef15d8c418fcefa321 Mon Sep 17 00:00:00 2001 From: uz Date: Thu, 11 Feb 2010 18:56:47 +0000 Subject: [PATCH] Use the .max function to calculate the backup space. git-svn-id: svn://svn.cc65.org/cc65/trunk@4584 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/c64/c64-c256k.s | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libsrc/c64/c64-c256k.s b/libsrc/c64/c64-c256k.s index 317d8ce88..c1455595b 100755 --- a/libsrc/c64/c64-c256k.s +++ b/libsrc/c64/c64-c256k.s @@ -89,24 +89,19 @@ done: stx $01 .reloc .endproc -; Since the functions above are copied to $200, the current contents of this -; memory area must be saved into backup storage. Calculate the amount of -; space necessary. -.if .sizeof (c256kcopycode) > .sizeof (c256kcheckcode) -backupspace = .sizeof (c256kcopycode) -.else -backupspace = .sizeof (c256kcheckcode) -.endif .bss curpage: .res 2 ; Current page number curbank: .res 1 ; Current bank -backup: .res backupspace ; Backup area of data in the location - ; where the copy and check routines will be window: .res 256 ; Memory "window" +; Since the functions above are copied to $200, the current contents of this +; memory area must be saved into backup storage. Allocate enough space. +backup: .res .max (.sizeof (c256kcopycode), .sizeof (c256kcheckcode)) + + .code ; ------------------------------------------------------------------------ -- 2.39.5