User Tools

Site Tools


wswan:guide:memory_management

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wswan:guide:memory_management [2025/04/03 18:24] – [Addressing RAM and ROM] asiewswan:guide:memory_management [2025/08/15 10:33] (current) – [Advanced section names] asie
Line 60: Line 60:
 </code> </code>
  
-The quoted component refers to section flags. The most useful ones are:+The quoted component at the end, like ''"ax"'', contains the ELF flags for a given sectionThese are not optional! The most useful ones are:
  
-  * ''a'' - section is allocated in RAM/ROM+  * ''a'' - section is allocated in RAM/ROM; if not used, the binary may end up not containing the data at all!
   * ''w'' - section is writable   * ''w'' - section is writable
   * ''x'' - section is executable   * ''x'' - section is executable
-  * ''R'' - section is retained even if not used by any code+  * ''R'' - section is retainedeven if not used by any code
  
 All section flags are listed in [[https://wonderful.asie.pl/doc/binutils-ia16/as.html#Section-Name-Substitutions|the assembler manual]]. All section flags are listed in [[https://wonderful.asie.pl/doc/binutils-ia16/as.html#Section-Name-Substitutions|the assembler manual]].
Line 105: Line 105:
 with the following optional arguments: with the following optional arguments:
  
-  * **bank index** - the index of a bank, padded to the top of ROM. +  * **bank index** - the index of a bank, in hexadecimal, padded to the top of ROM. For example, ''.rom0_f'' always refers to the final bank, even if the ROM has more than 16 banks
-  * **offset** - the absolute offset within a bank or memory location.+  * **offset** - the absolute offset within a bank or memory location, in hexademical. For example, ''.rom0_ffff_1234'' would place at location ''0x..FFFF1234'' in the cartridge image.
  
 Note that the linker requires //distinct// section names to place things separately: in other banks, memory locations, or for garbage collection. One can use ''.'' after the prefix to specify an unique name. Note that the linker requires //distinct// section names to place things separately: in other banks, memory locations, or for garbage collection. One can use ''.'' after the prefix to specify an unique name.
wswan/guide/memory_management.1743704653.txt.gz · Last modified: by asie