libtonc
tonc_asminc.h File Reference

Macros

#define DEF_SIZE(_name)   .size _name, .-_name
 
Section definitions for assembly.
#define CSEC_TEXT   .text
 Standard code section directive.
 
#define CSEC_EWRAM   .ewram
 EWRAM code section directive.
 
#define CSEC_IWRAM   .iwram
 IWRAM code section directive.
 
#define DSEC_DATA   .data
 Standard code section directive.
 
#define DSEC_ROM   .section .rodata
 ROM data section directive.
 
#define DSEC_BSS   .section .bss
 Uninited data (RAM) section directive.
 
#define DSEC_SBSS   .section .sbss
 Uninited data (DTCM?) section directive.
 
#define ARM_FUNC   .arm
 Indicates an ARM function.
 
#define THUMB_FUNC   .thumb_func
 Indicates a Thumb function.
 
Function definition macros.
#define BEGIN_FUNC(_name, _section, _iset)
 Start an assembly function.
 
#define END_FUNC(_name)   DEF_SIZE(_name)
 End of a function.
 
#define BEGIN_FUNC_ARM(_name, _section)   BEGIN_FUNC(_name, _section, ARM_FUNC)
 Begin an ARM function.
 
#define BEGIN_FUNC_THUMB(_name, _section)   BEGIN_FUNC(_name, _section, THUMB_FUNC)
 Begin a THUMB function.
 
Data definition macros.
#define BEGIN_SYMBOL(_name, _section)
 
#define END_SYMBOL(_name)   DEF_SIZE(_name)
 
TSurface member offsets.
#define TSRF_data   0
 
#define TSRF_pitch   4
 
#define TSRF_width   8
 
#define TSRF_height   10
 
#define TSRF_bpp   12
 
#define TSRF_type   13
 
#define TSRF_palSize   14
 
#define TSRF_pal   16
 

Detailed Description

Author
J Vijn
Date
20081019 - 20120519

Macro Definition Documentation

◆ BEGIN_FUNC

#define BEGIN_FUNC (   _name,
  _section,
  _iset 
)
Value:
.section _section._name , "ax", %progbits; \
_iset; \
.align 2; \
.global _name; \
.type _name STT_FUNC; \
_name:

Start an assembly function.

Parameters
_nameName of function.
_sectionSection to place function in (like .text)

◆ BEGIN_FUNC_ARM

#define BEGIN_FUNC_ARM (   _name,
  _section 
)    BEGIN_FUNC(_name, _section, ARM_FUNC)

Begin an ARM function.

Parameters
_nameName of function.
_sectionSection to place function in (like .text)

◆ BEGIN_FUNC_THUMB

#define BEGIN_FUNC_THUMB (   _name,
  _section 
)    BEGIN_FUNC(_name, _section, THUMB_FUNC)

Begin a THUMB function.

Parameters
_nameName of function.
_sectionSection to place function in (like .text)

◆ BEGIN_SYMBOL

#define BEGIN_SYMBOL (   _name,
  _section 
)
Value:
_section; \
.align; \
.global _name; \
_name: