Re: [cc65] Permanent & Temporary Reservation of Memory

From: thefox xofeht <thefox1aspekt.fi>
Date: 2012-09-09 11:55:24
On Sun, Sep 9, 2012 at 1:23 AM, Michael Bazzinotti
<mbazzinotti@gmail.com> wrote:
> My question relates to permanent and temporary reservation of memory.
> (for symbols).

What I usually do (in a gist :)), is allocate a chunk of RAM using
.res, and then reference it using .struct symbols. E.g.:

.segment "BSS"

locals:   .res 16

.segment "CODE"

.proc func1
  .struct
    foo  .byte
    bar  .byte
  .endstruct
  lda locals+foo
  sta locals+bar
.endproc

.proc func2
  .struct
    goo  .byte
  .endstruct
  bit locals+goo
.endproc

As far as I know, the only way to otherwise reuse the same memory
areas is to have multiple memory/segment definitions for the same
memory area in the linker config file.

-thefox
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Sep 9 11:56:13 2012

This archive was generated by hypermail 2.1.8 : 2012-09-09 11:56:18 CEST