You are here

Assembler Directives to Specify RAM Area and Code Area | Cypress Semiconductor

Support & Community

Assembler Directives to Specify RAM Area and Code Area

Last Updated: March 27, 2011

What are the reserved words in assembler to designate code and data areas?


Following directives should be used before declaring variables and code in assembly. The parentheses should have RAM, ROM, REL, CON, ABS, OVR as required. AREA bss() will not have ROM. For an explanation on each of these AREAs, please refer to Assembler Directives of the PSoC Designer Assembly Language User Guide, located in PSoC Designer >> Help >> Documentation >> Assembly User Guide.

area bss(ram) is the directive used when variables has to be declared in RAM.

area text(rom) is the directive used when code is written.  After using the "area bss(ram)" and declaring variables, "area text(rom)" has to be used before entering code.

So, the general order would be:
1: Include your files first:
include "" // include m8c specific declarations
include "" // include User Module API specific declarations.

2: Make your variables global (if required):
export _main // main is global
export SomeVar1
export SomeVar2

3: Declare your variables:
area bss(RAM) // inform assembler that variables follow
SomeVar1: blk 2 // 2 bytes in size
SomeVar2: blk 1 // 1 byte in size

4: Start with your code:
area text(ROM,REL) // inform assembler that program code follows
_main :
M8C_EnableGInt       // Enable Global interrupts

Knowledge Base Tags: 

Provide feedback on this article

Browse KB By Product

Browse KB by Type