MPASM USER'S GUIDE Chapter 3. Directive Language Introduction This chapter describes the MPASM directive language. Directives are assembler commands that appear in the source code but are not translated directly into opcodes. They are used to control the assembler: its input, output, and data allocation. Many of the assembler directives have alternate names and formats. These may exist to provide backward compatibility with previous assemblers from Microchip and to be compatible with individual programming practices. If portable code is desired, it is recommended that programs be written using the specifications contained within this document. There are four basic types of directives provided by MPASM. Highlights The points that will be highlighted in this chapter are: ù Data Directives ù Listing Directives ù Control Directives ù Macro Directives Terms Data Directives Data Directives are those that control the allocation of memory and provide a way to refer to data items symbolically, that is, by meaningful names. Listing Directives Listing Directives are those directives that control the MPASM listing file and format. They allow the specification of titles, page ejects and other listing control. Control Directives Control directives permit sections of conditionally assembled code. Macro Directives These directives control the execution and data allocation within macro body definitions. Directive Details The remainder of this chapter is dedicated to providing a detailed description of the directives supported by MPASM. Each definition will show: ù Syntax ù Description ù Example A table of the MPASM directives is provided as a quick reference at the end of this document. CBANK - Future Feature Syntax Description Example See Also CBLOCK - Define a Block of Constants Syntax cblock [] Description Define a list of named constants. Each is assigned a value of one higher than the last one. The purpose of this directive is to assign address offsets to many labels. The list of names end when and ENDC directive is encountered. indicates the starting value for the first name in the block. If no expression is found, the first name will receive a value one higher than the final name in the previous CBLOCK or the current program counter. Multiple names may be given on a line, separated by commas. Example cblock 0x20 ; name_1 will be ; assigned 20 name_1, name_2 ; name_2, 21 and so on name_3, name_4 ; name_4 is assigned 23. endc See Also ENDC CONSTANT - Declare Symbol Constant Syntax constant