1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00

Use the .max function to calculate the backup space.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4584 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2010-02-11 18:56:47 +00:00
parent 61b69316c5
commit 8bae793f48

View File

@ -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
; ------------------------------------------------------------------------