z80:Directives:SECTION/ENDSECTION

From Learn @ Cemetech
Jump to: navigation, search

Defines a code section.

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

Syntax

   /* 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"
   */


Allowed inputs

Uses

See Also

incsection