Brass Core Plugins

endsection/section

Defines a code section.

Remarks

There are instances when you need to control the structure of the program. For example, hardware constraints might dictate that all executable code must fit in the first 8KB of the binary, but data resources can appear after this point.

Code inside sections isn't compiled immediately. To compile it, you need to use the incsection directive.

Example

/* Main.asm */

.include "File1.asm"
.include "File2.asm"
.incsection Code
.incsection Data

/* File1.asm */

.section Code
.include "Code1.asm"
.endsection

.section Data
.include "Data1.inc"
.endsection

/* File2.asm */

.section Code
.include "Code2.asm"
.endsection

.section Data
.include "Data2.inc"
.endsection

/*
   This would assemble as the following:
   
   .include "Code1.asm"
   .include "Code2.asm"
   .include "Data1.inc"
   .include "Data2.inc"
   
*/

See Also